asterwise
The official TypeScript library for Asterwise — Vedic + Western astrology, numerology, tarot, crystals, and dreams. 129 endpoints, generated from the API's OpenAPI document so the types match what the server sends. Every position is checked against NASA JPL Horizons, median 0.050 arcseconds over 80 positions from 1950 to 2050. Compared row by row with seven other astrology APIs, every claim sourced, at asterwise.com/compare.
Documentation · API Reference · Pricing · MCP server · Postman collection
Installation
npm install asterwise
Quickstart
import { createClient, createConfig, natalChart } from 'asterwise';
const client = createClient(createConfig({
baseUrl: 'https://api.asterwise.com',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
}));
const result = await natalChart({
client,
body: {
date: '1985-11-12',
time: '06:45',
location: 'Mumbai, India',
ayanamsa: 'lahiri',
},
});
console.log(result.data);
Get a free API key at asterwise.com.
What you can build
143 typed SDK functions covering 129 REST endpoints (5 endpoints keep a deprecated GET method next to the POST one; 9 endpoints also answer on GET with the same fields as query parameters).
What makes Asterwise different
- Classical interpretation text alongside the calculations on chart endpoints (natal chart, dasha, yogas, doshas)
- 5-level Vimshottari Dasha (Maha → Antar → Pratyantar → Sookshma → Prana) — most APIs return two
- Rajju and Vedha as hard vetoes in matchmaking — not just point scores
- HMAC-signed responses for auditability
- Panchanga as printed panchangs show it: every tithi, nakshatra, yoga and karana of the day with start and end times, the festival and vrat calendar, and muhurta search with exact ISO times
- Typed responses for every operation, generated from the OpenAPI document
- MCP server with 118 tools for Claude and Cursor integration
Examples
import {
createClient,
createConfig,
westernNatalChart,
lifePathPost,
tarotThreeCard,
} from 'asterwise';
const client = createClient(createConfig({
baseUrl: 'https://api.asterwise.com',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
}));
const western = await westernNatalChart({
client,
body: {
date: '1985-11-12',
time: '06:45',
location: 'Mumbai, India',
},
});
const path = await lifePathPost({
client,
body: { date: '1985-11-12' },
});
const spread = await tarotThreeCard({
client,
body: { question: 'What should I focus on this month?' },
});
Requirements
Node.js 18+. An API key from asterwise.com.
Documentation
Full API reference: docs.asterwise.com
Development
Regenerate from https://api.asterwise.com/openapi-sdk.json:
npm run generate
The scripts/post-generate.mjs hook re-exports createClient and createConfig from the package root after each generation.
Releasing: npm run generate → bump version in package.json → npm install (syncs the lockfile) → update CHANGELOG.md → npm test and npm run verify:nodenext → commit → push a typescript-v<version> tag. The publish workflow checks the tag against package.json, runs the tests and the nodenext check, builds and publishes with provenance.
Support
License
MIT. See LICENSE.