Skip to main content

TypeScript SDK

The official Asterwise TypeScript SDK provides typed access to all 115+ public API endpoints. Works with Node.js and modern bundlers (Vite, webpack, esbuild).

Installation

npm install asterwise

Requirements: Node.js 18+

Quick start

import { client } from 'asterwise/dist/client.gen.js';
import { natalChart } from 'asterwise/dist/index.js';

client.setConfig({
baseUrl: 'https://api.asterwise.com',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});

const result = await natalChart({
body: {
date: '1985-11-12',
time: '06:45',
location: 'Mumbai, India',
ayanamsa: 'lahiri',
},
});

console.log(result.data);

Get your API key from asterwise.com/dashboard.

Setup

Import the client and configure it once at the top of your application. All SDK functions share the same client instance.

import { client } from 'asterwise/dist/client.gen.js';

client.setConfig({
baseUrl: 'https://api.asterwise.com',
headers: {
Authorization: `Bearer ${process.env.ASTERWISE_API_KEY}`,
},
});

Examples

Vimshottari Dasha

import { dasha } from 'asterwise/dist/index.js';

const result = await dasha({
body: {
date: '1985-11-12',
time: '06:45',
location: 'Mumbai, India',
ayanamsa: 'lahiri',
levels: 2,
},
});

console.log(result.data);

Numerology profile

import { numerologyProfile } from 'asterwise/dist/index.js';

const result = await numerologyProfile({
body: {
name: 'Arjun Mehta',
date: '1985-11-12',
},
});

console.log(result.data);

Matchmaking

import { matchmaking } from 'asterwise/dist/index.js';

const result = await matchmaking({
body: {
person1: {
date: '1985-11-12',
time: '06:45',
location: 'Mumbai, India',
ayanamsa: 'lahiri',
},
person2: {
date: '1990-06-21',
time: '15:30',
location: 'Rome, Italy',
ayanamsa: 'lahiri',
},
},
});

console.log(result.data);

Horoscope

import { horoscopeDaily } from 'asterwise/dist/index.js';

const result = await horoscopeDaily({
path: { moon_sign: 'tula' },
});

console.log(result.data);

All available functions

All 115+ endpoint functions are exported from asterwise/dist/index.js. Key functions include:

natalChart · dasha · yogas · doshas · matchmaking · matchmakingDashakoot · matchmakingPorutham · panchanga · panchangaCalendar · muhurta · varshaphal · prashna · remedies · gemstones · ashtakavarga · atmakaraka · ishtaDevata · kpChart · kpRulingPlanets · lalKitabChart · yoginiDasha · ashtottariDasha · charDasha · transits · gochar · sadeSati · dashaTransits · divisionalCharts · strength · nakshatra · chartSvg · numerologyProfile · numerologyCompatibility · lifePath · personalYear · luckyNumbers · numberMeaning · nameCorrection · businessName · chaldean · loShu · mobileNumber · vehicleNumber · horoscopeDaily · horoscopeWeekly · horoscopeMonthly · horoscopeYearly · geocode · timezone