Kundli guide

One call returns a complete birth chart: ascendant, houses, planet positions and a summary.

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 chart. This call is POST /sandbox/kundli 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"}' \
  "https://api.vedika.io/sandbox/kundli"

JavaScript

// Node.js 18 or later.
const response = await fetch('https://api.vedika.io/sandbox/kundli', {
  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"
  }),
});
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/kundli',
    method='POST',
    data=json.dumps({
        "datetime": "1990-05-15T10:30:00",
        "latitude": 19.07,
        "longitude": 72.87,
        "timezone": "+05:30"
    }).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/kundli with your key. A Kundli costs $0.016 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"}' \
  "https://api.vedika.io/v2/astrology/kundli"

JavaScript

// Node.js 18 or later.
const response = await fetch('https://api.vedika.io/v2/astrology/kundli', {
  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"
  }),
});
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/kundli',
    method='POST',
    data=json.dumps({
        "datetime": "1990-05-15T10:30:00",
        "latitude": 19.07,
        "longitude": 72.87,
        "timezone": "+05:30"
    }).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:

ascendant, ayanamsa, birth_details, chart, houses, moonSign, nakshatra, planets, source, summary, sunSign, svg, tithi, zodiacSystem, zodiacType.

Parameters

Body fields for /v2/astrology/kundli.

ParameterTypeRequiredDescription
datetimestringYesBirth date and time as an ISO-8601 timestamp.
latitudenumberYesBirth latitude in decimal degrees.
longitudenumberYesBirth longitude in decimal degrees.
timezonestringYesIANA timezone or numeric UTC offset for the birth place.

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