API TUTORIAL
Dasha Calculation API: Vimshottari Mahadasha Calculator
Complete guide to calculating planetary period (dasha) systems via API. Mahadasha, Antardasha, and Pratyantar with precise timing.
January 7, 2026
-
16 min read
Understanding Vimshottari Dasha
Vimshottari is a 120-year planetary period system used in Vedic astrology for timing predictions. Each planet rules a specific number of years:
| Planet | Years | Starting Nakshatra |
|---|---|---|
| Ketu | 7 | Ashwini, Magha, Mula |
| Venus | 20 | Bharani, P.Phalguni, P.Ashadha |
| Sun | 6 | Krittika, U.Phalguni, U.Ashadha |
| Moon | 10 | Rohini, Hasta, Shravana |
| Mars | 7 | Mrigashira, Chitra, Dhanishta |
| Rahu | 18 | Ardra, Swati, Shatabhisha |
| Jupiter | 16 | Punarvasu, Vishakha, P.Bhadra |
| Saturn | 19 | Pushya, Anuradha, U.Bhadra |
| Mercury | 17 | Ashlesha, Jyeshtha, Revati |
Get Current Dasha Periods
// Current and upcoming Vimshottari dasha periods
const response = await fetch('https://api.vedika.io/v2/astrology/vimshottari-dasha', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
datetime: '1990-05-15T14:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
})
});
const { data } = await response.json();
const { maha_dasha, antar_dasha, pratyantar_dasha } = data.current_dasha;
console.log(`Running: ${maha_dasha.planet} > ${antar_dasha.planet} > ${pratyantar_dasha.planet}`);
console.log(`Antardasha ends ${antar_dasha.end_date}`);
// data, trimmed. The running periods depend on the day you call; this is 15 October 2026:
// {
// "current_dasha": {
// "maha_dasha": { "planet": "Rahu", "start_date": "2011-01-06", "end_date": "2029-01-06" },
// "antar_dasha": { "planet": "Moon", "start_date": "2026-06-20", "end_date": "2027-12-20" },
// "pratyantar_dasha": { "planet": "Rahu", "start_date": "2026-09-06", "end_date": "2026-11-27" }
// },
// "dasha_balance": { "planet": "Sun", "years": 3, "months": 7, "days": 22 },
// "maha_dasha": [
// { "planet": "Sun", "start_date": "1990-05-15", "end_date": "...", "is_current": false, "antar_dasha": [ ... ] },
// ... 9 mahadashas in all
// ]
// }
Full Antardasha Breakdown
import requests
def get_antardasha_details(birth_datetime, lat, lng, mahadasha_planet, timezone='+05:30'):
"""List the antardashas inside one mahadasha."""
response = requests.post(
'https://api.vedika.io/v2/astrology/antardasha',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'datetime': birth_datetime,
'latitude': lat,
'longitude': lng,
'timezone': timezone
}
)
response.raise_for_status()
data = response.json()['data']
# data['maha_dasha'] holds all nine mahadashas; each carries its own 'antar_dasha' list
mahadasha = next(md for md in data['maha_dasha'] if md['planet'] == mahadasha_planet)
print(f"\n{mahadasha_planet} Mahadasha Antardashas:")
print("-" * 50)
for ad in mahadasha['antar_dasha']:
print(f"{ad['planet']:10} | {ad['start_date'][:10]} to {ad['end_date'][:10]}")
return mahadasha['antar_dasha']
# Example: Get all antardashas in Jupiter Mahadasha
antardashas = get_antardasha_details(
'1990-05-15T14:30:00',
28.6139,
77.2090,
'Jupiter'
)
# Output:
# Jupiter Mahadasha Antardashas:
# --------------------------------------------------
# Jupiter | 2029-01-06 to 2031-02-24
# Saturn | 2031-02-24 to 2033-09-06
# Mercury | 2033-09-06 to 2035-12-13
# Ketu | 2035-12-13 to 2036-11-18
# Venus | 2036-11-18 to 2039-07-20
# Sun | 2039-07-20 to 2040-05-07
# Moon | 2040-05-07 to 2041-09-06
# Mars | 2041-09-06 to 2042-08-13
# Rahu | 2042-08-13 to 2045-01-06
Pratyantar Dasha (Sub-Sub Period)
// The pratyantardasha (level 3) route returns the same dasha ladder as vimshottari-dasha,
// with the pratyantar period running today under current_dasha
const pratyantarResponse = await fetch('https://api.vedika.io/v2/astrology/pratyantardasha', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
datetime: '1990-05-15T14:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
})
});
const { data: pratyantars } = await pratyantarResponse.json();
const { maha_dasha, antar_dasha, pratyantar_dasha } = pratyantars.current_dasha;
console.log(`${maha_dasha.planet} / ${antar_dasha.planet} / ${pratyantar_dasha.planet}`);
console.log(`${pratyantar_dasha.start_date} to ${pratyantar_dasha.end_date}`);
// Output on 15 October 2026:
// Rahu / Moon / Rahu
// 2026-09-06 to 2026-11-27
Alternative Dasha Systems
Vedika API supports multiple dasha systems:
// Yogini Dasha (36-year cycle)
const birth = {
datetime: '1990-05-15T14:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
};
const headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
};
const yoginiResponse = await fetch('https://api.vedika.io/v2/astrology/yogini-dasha', {
method: 'POST',
headers,
body: JSON.stringify(birth)
});
const { data: yogini } = await yoginiResponse.json();
console.log(`Yogini: ${yogini.currentDasha.yogini} (ruler ${yogini.currentDasha.ruler}), ends ${yogini.currentDasha.endDate}`);
// Chara Dasha (Jaimini system, sign-based)
const charaResponse = await fetch('https://api.vedika.io/v2/astrology/chara-dasha', {
method: 'POST',
headers,
body: JSON.stringify(birth)
});
const { data: chara } = await charaResponse.json();
console.log(`Chara: ${chara.currentMahaDasha.sign} > ${chara.currentAntarDasha.sign}`);
// Other systems have their own routes: ashtottari-dasha, kalachakra-dasha, narayana-dasha, panchottari-dasha
Dasha Timeline Visualization
// React component for dasha timeline
// In production call the API from your server: a key in browser code is public.
import { useEffect, useState } from 'react';
async function fetchDasha(birthDetails) {
const res = await fetch('https://api.vedika.io/v2/astrology/vimshottari-dasha', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify(birthDetails)
});
return (await res.json()).data;
}
function DashaTimeline({ birthDetails }) {
const [dasha, setDasha] = useState(null);
useEffect(() => {
fetchDasha(birthDetails).then(setDasha);
}, [birthDetails]);
if (!dasha) return <p>Loading...</p>;
const { maha_dasha, antar_dasha } = dasha.current_dasha;
return (
<div>
<h2>Your Dasha Periods</h2>
{/* Current period highlight */}
<section>
<h3>Currently Running</h3>
<p>{maha_dasha.planet} Mahadasha > {antar_dasha.planet} Antardasha</p>
<p>Antardasha ends {antar_dasha.end_date}</p>
</section>
{/* Timeline */}
<ol>
{dasha.maha_dasha.map((md) => (
<li key={md.planet} style={{ fontWeight: md.is_current ? 'bold' : 'normal' }}>
{md.planet}: {md.start_date} to {md.end_date} ({md.duration_years} years)
</li>
))}
</ol>
</div>
);
}
Precise Dasha Calculations
Vedika API calculates dasha periods to the second using XALEN Ephemeris. Support for Vimshottari, Yogini, Chara, and Ashtottari systems.
Get API Key