Dasha guide
One call returns the Vimshottari Dasha timeline for a birth: the Mahadasha list with sub-periods, the running period and guidance.
1. Run it in the sandbox
The sandbox needs no key and charges nothing. It answers with a fixed sample (the meta block says "mode": "sandbox"), so use it to check your integration, not to read a real timeline. This call is POST /sandbox/dasha with the same body as production.
curl
curl --fail-with-body --silent --show-error -X POST \
-H "Content-Type: application/json" \
-d '{"datetime":"1990-05-15T10:30:00","latitude":19.07,"longitude":72.87,"timezone":"+05:30","depth":3}' \
"https://api.vedika.io/sandbox/dasha"JavaScript
// Node.js 18 or later.
const response = await fetch('https://api.vedika.io/sandbox/dasha', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30",
"depth": 3
}),
});
const result = await response.json();
if (!response.ok) throw new Error(result.error?.message ?? response.status);
console.log(result.data);Python
# Python 3, standard library only.
import json, os, urllib.request
request = urllib.request.Request(
'https://api.vedika.io/sandbox/dasha',
method='POST',
data=json.dumps({
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30",
"depth": 3
}).encode(),
headers={'Content-Type': 'application/json'},
)
with urllib.request.urlopen(request) as response:
print(json.load(response)['data'])The sandbox is limited per caller (10 requests a minute, 50 an hour, 100 a UTC day); a 429 means wait and retry later.
2. Call it in production
Send your own details to POST /v2/astrology/dasha with your key. A Dasha timeline costs $0.028 per call; the billing block of every response reports the charge that was made. Keep the key on your server and read it from the environment, as in the authentication notes.
curl
curl --fail-with-body --silent --show-error -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VEDIKA_API_KEY" \
-d '{"datetime":"1990-05-15T10:30:00","latitude":19.07,"longitude":72.87,"timezone":"+05:30","depth":3}' \
"https://api.vedika.io/v2/astrology/dasha"JavaScript
// Node.js 18 or later.
const response = await fetch('https://api.vedika.io/v2/astrology/dasha', {
method: 'POST',
headers: { 'Authorization': 'Bearer ' + process.env.VEDIKA_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30",
"depth": 3
}),
});
const result = await response.json();
if (!response.ok) throw new Error(result.error?.message ?? response.status);
console.log(result.data);Python
# Python 3, standard library only.
import json, os, urllib.request
request = urllib.request.Request(
'https://api.vedika.io/v2/astrology/dasha',
method='POST',
data=json.dumps({
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30",
"depth": 3
}).encode(),
headers={'Authorization': 'Bearer ' + os.environ['VEDIKA_API_KEY'], 'Content-Type': 'application/json'},
)
with urllib.request.urlopen(request) as response:
print(json.load(response)['data'])What comes back
A successful response has success, data, billing and meta. These are the fields of data:
current_dasha, dasha_balance, guidance, maha_dasha, nakshatra.
maha_dasha lists every Mahadasha with its sub-periods. current_dasha names the Mahadasha, Antardasha and Pratyantar running now.
Parameters
Body fields for /v2/astrology/dasha.
| Parameter | Type | Required | Description |
|---|---|---|---|
datetime | string | Yes | Birth date and time as an ISO-8601 timestamp. |
latitude | number | Yes | Birth latitude in decimal degrees. |
longitude | number | Yes | Birth longitude in decimal degrees. |
timezone | string | Yes | IANA timezone or numeric UTC offset for the birth place. |
depth | integer | No | Depth of sub-period nesting. The catalog describes Mahadasha, Antardasha and optional deeper sub-periods; the sample body sends 3. |
Errors and limits
Check the HTTP status before reading data. Fix invalid input before retrying; a 401 or 403 means check your key and plan; on a 429 honour Retry-After and back off. Details are in Errors & limits.
Next steps
- Dasha SDK page: the same data through a client library.
- Kundli guide: the birth chart for the same inputs.
- API reference: every operation with inputs and recorded responses.