Vedic Horoscope API: Integration Guide With a Typed SDK
Vedic horoscope API integration with a typed SDK: birth charts, Panchang, Vimshottari dasha and Gun Milan scores from one key, no manual parsing.
TL;DR
- A Vedic horoscope API returns typed birth charts, Panchang, Vimshottari dasha periods and Gun Milan scores from one key, so an app needs no sidereal astronomy or ayanamsa code of its own.
- The RoxyAPI TypeScript SDK (
@roxyapi/sdk) gives you typed access to every Vedic astrology endpoint with one line of setup - Generate birth charts, Panchang, Vimshottari dasha periods, and Gun Milan compatibility scores
- Every response is fully typed: no manual interfaces, no raw fetch, no JSON parsing
- Get your API key and make your first call in under 5 minutes
Integrating Vedic astrology calculations into your application normally requires deep knowledge of sidereal astronomy, Lahiri ayanamsa corrections, and the Vimshottari dasha system. Building this from scratch means implementing astronomical position algorithms, nakshatra boundary tables, dasha period math, and Ashtakoot compatibility scoring. The RoxyAPI Vedic Astrology API handles all of this behind verified, tested endpoints that return structured, interpreted data.
This guide shows you how to integrate birth charts, Panchang, dasha periods, and Kundli compatibility matching into any TypeScript or Node.js application using the official SDK. All planetary positions are verified against NASA JPL Horizons data and cross-referenced against 3,000+ gold standard test cases from a widely used panchang reference site and a public KP reference site.
How to install and configure the SDK
Install the TypeScript SDK and create your client in two steps. The SDK provides full types for every endpoint, so you never need to write manual TypeScript interfaces.
npm install @roxyapi/sdkimport { createRoxy } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY!);That is the entire setup. The SDK configures the base URL (https://roxyapi.com/api/v2), authentication headers, and response typing automatically. Every method returns a { data, error, response } object. If error is defined, the request failed and error.code tells you why. If data is defined, you have a fully typed result. No custom error classes, no retry wrappers, no raw fetch calls needed.
Official clients include TypeScript, Python, PHP, C#, Go, Rust and Dart; see SDK setup. You can also call the REST endpoints directly from Python or other languages with the same request bodies and an X-API-Key header. The curl examples at the end of this guide show the exact HTTP calls. All endpoints are standard REST with JSON request and response bodies, so any HTTP client works.
# Python example using requests
import requests
API_KEY = "your_api_key"
BASE = "https://roxyapi.com/api/v2/vedic-astrology"
headers = {"Content-Type": "application/json", "X-API-Key": API_KEY}
response = requests.post(f"{BASE}/birth-chart", json={
"date": "1990-07-15",
"time": "14:30:00",
"latitude": 28.6139,
"longitude": 77.209,
"timezone": 5.5,
}, headers=headers)
chart = response.json()
print(f"Lagna: {chart['meta']['Lagna']['rashi']}")Ready to build this? RoxyAPI Vedic Astrology API gives you endpoints for birth charts, Panchang, dasha, compatibility, doshas, and more. See pricing.
How to generate a Vedic birth chart (D1 Rashi)
The birth chart endpoint returns all 9 Navagraha positions plus Lagna, grouped by rashi house, with nakshatra and pada data for each planet.
const { data, error } = await roxy.vedicAstrology.generateBirthChart({
body: {
date: '1990-07-15',
time: '14:30:00',
latitude: 28.6139,
longitude: 77.209,
timezone: 5.5,
},
});
if (data) {
console.log('Lagna:', data.meta.Lagna.rashi);
console.log('Moon:', data.meta.Moon.nakshatra.name, 'Pada', data.meta.Moon.nakshatra.pada);
// Check combustion (planets too close to Sun)
for (const c of data.combustion) {
console.log(`${c.planet} is combust: ${c.distanceFromSun.toFixed(1)} deg from Sun`);
}
// Check planetary war (planets within 1 degree)
for (const w of data.planetaryWar) {
console.log(`${w.planet1} vs ${w.planet2}: ${w.winner} wins`);
}
}The response includes 12 rashi house objects (each with a signs array of planets), a meta lookup keyed by planet name, a houses array with a reading of each bhava written for that chart, combustion data using Surya Siddhanta orb values, planetaryWar detection, and per-planet interpretations with rashi and nakshatra readings. Here is a partial response showing the structure:
{
"aries": {
"rashi": "aries",
"signs": [
{
"graha": "Mars",
"nakshatra": { "name": "Ashwini", "pada": 3, "key": 1 },
"longitude": 8.15,
"isRetrograde": false
}
]
},
"meta": {
"Lagna": {
"graha": "Lagna",
"rashi": "Libra",
"longitude": 198.45,
"nakshatra": { "name": "Swati", "pada": 2, "key": 15 }
},
"Sun": {
"graha": "Sun",
"rashi": "Gemini",
"longitude": 88.92,
"nakshatra": { "name": "Punarvasu", "pada": 3, "key": 7 },
"isRetrograde": false
}
},
"houses": [
{ "number": 1, "name": "Lagna", "description": "Identity absorbs faith and good luck with your 1st lord in the 9th..." }
],
"combustion": [
{ "planet": "Mercury", "distanceFromSun": 4.2, "orb": 14 }
],
"planetaryWar": [],
"interpretations": {
"Sun": {
"rashi": "Bright, articulate and open-handed, your Sun in Gemini makes you the person who reads the manual and then explains it kindly...",
"nakshatra": "The name Punarvasu means the good returning, and after every closing you find a way back in..."
}
},
"interpretation": {
"summary": "Six and eight rashis apart, Libra rising and the Moon in Pisces follow separate laws, which makes you deeper than you look...",
"detailed": "..."
}
}Combustion and planetary war detection are unique to RoxyAPI. Most Vedic astrology APIs return only planet positions, but this endpoint also flags combust planets and planetary war conditions based on classical Jyotish texts, saving you from implementing these rules manually.
How to calculate daily Panchang (Tithi, Nakshatra, Yoga, Karana)
The Panchang endpoint returns all five limbs of the Hindu calendar for any date and location.
const { data } = await roxy.vedicAstrology.getBasicPanchang({
body: {
date: '2026-03-30',
time: '06:00:00',
latitude: 28.6139,
longitude: 77.209,
timezone: 5.5,
},
});
if (data) {
console.log('Tithi:', data.tithi.name, `(${data.tithi.paksha})`);
console.log('Nakshatra:', data.nakshatra.name, '| Lord:', data.nakshatra.lord);
console.log('Yoga:', data.yoga.name);
console.log('Karana:', data.karana.name);
}The response structure for each element includes a name, number, and descriptive fields. Tithi includes paksha ("Shukla" or "Krishna") and percent completion. Nakshatra includes lord (ruling planet), pada, deity, and symbol. Use the detailed Panchang endpoint (getDetailedPanchang) if you also need sunrise, sunset, moonrise, Rahu Kaal, Yamaganda, and Gulika Kaal timings.
How to get current Vimshottari dasha periods
The dasha endpoint returns the active Mahadasha, Antardasha, and Pratyantardasha based on the birth Moon nakshatra position.
const { data } = await roxy.vedicAstrology.getCurrentDasha({
body: {
date: '1990-07-15',
time: '14:30:00',
latitude: 28.6139,
longitude: 77.209,
timezone: 5.5,
},
});
if (data) {
console.log('Birth Nakshatra:', data.nakshatraName, '| Lord:', data.nakshatraLord);
console.log('Mahadasha:', data.mahadasha.planet);
console.log(' Period:', data.mahadasha.startDate, 'to', data.mahadasha.endDate);
console.log(' Remaining:', data.remainingInMahadasha.years, 'y',
data.remainingInMahadasha.months, 'm', data.remainingInMahadasha.days, 'd');
console.log('Antardasha:', data.antardasha.planet);
console.log('Pratyantardasha:', data.pratyantardasha.planet);
}Each dasha period includes planet, startDate, endDate, durationYears, and an interpretation string. Remaining time for each level is in a separate object with years, months, days, and totalDays fields:
{
"nakshatraName": "Revati",
"nakshatraLord": "Mercury",
"mahadasha": {
"planet": "Moon",
"startDate": "2023-01-15T00:00:00Z",
"endDate": "2033-01-15T00:00:00Z",
"durationYears": 10,
"interpretation": "Moon Mahadasha brings emotional growth..."
},
"remainingInMahadasha": {
"years": 6,
"months": 9,
"days": 16,
"totalDays": 2482
},
"antardasha": {
"planet": "Jupiter",
"mahadashaLord": "Moon",
"startDate": "2025-12-15T00:00:00Z",
"endDate": "2027-04-15T00:00:00Z",
"durationYears": 1.33
},
"remainingInAntardasha": { "years": 1, "months": 0, "days": 16, "totalDays": 381 }
}Use getMajorDashas() to get the full 120-year Vimshottari cycle, or getSubDashas() for Antardasha sub-periods within a specific Mahadasha.
How to check Kundli compatibility with Gun Milan
The 36-point Ashtakoot Gun Milan endpoint calculates compatibility between two birth charts across 8 kootas.
const { data } = await roxy.vedicAstrology.calculateGunMilan({
body: {
person1: {
date: '1990-07-15',
time: '14:30:00',
latitude: 28.6139,
longitude: 77.209,
timezone: 5.5,
},
person2: {
date: '1992-03-20',
time: '10:00:00',
latitude: 19.076,
longitude: 72.8777,
timezone: 5.5,
},
},
});
if (data) {
console.log(`Score: ${data.total}/${data.maxScore} (${data.percentage}%)`);
console.log('Compatible:', data.isCompatible);
console.log('Recommendation:', data.recommendation);
for (const koota of data.breakdown) {
console.log(` ${koota.category}: ${koota.score}/${koota.maxScore}`);
}
// Check active doshas and cancellations
if (data.doshas.length > 0) {
console.log('Active doshas:', data.doshas.join(', '));
}
for (const cancel of data.doshaCancellations) {
console.log(` ${cancel.dosha} cancelled: ${cancel.reason}`);
}
}The breakdown array covers all 8 Ashtakoot kootas: Varna (spiritual compatibility), Vashya (mutual attraction), Tara (birth star harmony), Yoni (physical compatibility), Graha Maitri (mental compatibility), Gana (temperament), Bhakoot (love and prosperity), and Nadi (health and progeny). Each entry includes score, maxScore, and the classification for both persons. The response also includes a recommendation string, active doshas, and doshaCancellations with reasons, making it easy to display a complete compatibility report for matrimonial applications without writing any interpretation logic.
How to test the endpoints with curl
Use these curl commands to verify API responses before integrating into your application:
# Birth chart
curl -X POST https://roxyapi.com/api/v2/vedic-astrology/birth-chart \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"date":"1990-07-15","time":"14:30:00","latitude":28.6139,"longitude":77.209,"timezone":5.5}'
# Panchang
curl -X POST https://roxyapi.com/api/v2/vedic-astrology/panchang/basic \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"date":"2026-03-30","time":"06:00:00","latitude":28.6139,"longitude":77.209,"timezone":5.5}'
# Current dasha
curl -X POST https://roxyapi.com/api/v2/vedic-astrology/dasha/current \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"date":"1990-07-15","time":"14:30:00","latitude":28.6139,"longitude":77.209,"timezone":5.5}'Replace YOUR_API_KEY with your RoxyAPI key. Test all endpoints live in the Vedic Astrology API reference.
Frequently Asked Questions
Q: What input format does every Vedic astrology endpoint use?
A: All endpoints accept the same five fields: date (YYYY-MM-DD), time (HH:MM:SS, 24-hour), latitude, longitude, and timezone (UTC offset, defaults to 5.5 for IST). Compatibility endpoints wrap these fields in person1 and person2 objects.
Q: Does the API use tropical or sidereal calculations? A: All positions are sidereal using the Lahiri ayanamsa, which is the Indian government standard for Vedic astrology. Planetary positions are verified against NASA JPL Horizons data with sub-arc-second precision.
Q: How do I handle timezones for birth data? A: Send the local birth time as-is with the UTC offset as a decimal number. India IST is 5.5, Nepal NPT is 5.75, US Eastern is -5, UK GMT is 0. The API handles all internal conversions. Do not convert to UTC manually.
Q: Can I use the API from Python or other languages? A: Yes. Official SDKs support TypeScript, Python, PHP, C#, Go, Rust and Dart. Choose the client for your stack in the SDK guide. The same JSON REST API is available to other languages.
Q: What other Vedic astrology endpoints are available? A: Beyond the four shown here, the API covers Navamsa (D9) and the supported divisional charts listed in the endpoint reference, Manglik and Kalsarpa dosha detection, Sadhesati (Saturn transit) analysis, Shadbala (6-fold strength) and Ashtakavarga (8-fold strength) scoring, planetary aspects (drishti), monthly transits, KP (Krishnamurti Paddhati) charts with star and sub-lord tables, Choghadiya muhurta periods, Hora planetary hours, and reference data for rashis, nakshatras, and yogas. Every endpoint is available under a single API key.
Q: How do I get Navamsa or other divisional charts?
A: Use roxy.vedicAstrology.generateNavamsa() for the D9 chart or roxy.vedicAstrology.generateDivisionalChart() with a division parameter (2 through 60) for any other divisional chart. The request body is the same birth data format used by the birth chart endpoint.
Conclusion
The RoxyAPI TypeScript SDK gives you typed access to the full Vedic astrology calculation engine with a single createRoxy() call. No custom API wrappers, no manual type definitions, no raw HTTP logic. Every endpoint returns structured, interpreted data verified against authoritative Jyotish sources. Whether you are building a Kundli generator, a matrimonial matching platform, a daily Panchang widget, or a full-featured Jyotish application, the same API key and SDK cover every endpoint across birth charts, dashas, doshas, divisional charts, transits, and reference data.
Start integrating at RoxyAPI Vedic Astrology API or browse the full Vedic Astrology API reference. Check pricing for plan details.