Panchang guide

One call returns the Panchang for a moment and place: tithi, nakshatra, yoga, karana, weekday 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 Panchang. This call is POST /sandbox/panchang with the same body as production.

curl

curl --fail-with-body --silent --show-error -X POST \
  -H "Content-Type: application/json" \
  -d '{"datetime":"2026-03-23T12:00:00","latitude":28.6139,"longitude":77.209,"timezone":"+05:30","lang":"hi"}' \
  "https://api.vedika.io/sandbox/panchang"

JavaScript

// Node.js 18 or later.
const response = await fetch('https://api.vedika.io/sandbox/panchang', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "datetime": "2026-03-23T12:00:00",
    "latitude": 28.6139,
    "longitude": 77.209,
    "timezone": "+05:30",
    "lang": "hi"
  }),
});
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/panchang',
    method='POST',
    data=json.dumps({
        "datetime": "2026-03-23T12:00:00",
        "latitude": 28.6139,
        "longitude": 77.209,
        "timezone": "+05:30",
        "lang": "hi"
    }).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/panchang with your key. A Panchang costs $0.012 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":"2026-03-23T12:00:00","latitude":28.6139,"longitude":77.209,"timezone":"+05:30","lang":"hi"}' \
  "https://api.vedika.io/v2/astrology/panchang"

JavaScript

// Node.js 18 or later.
const response = await fetch('https://api.vedika.io/v2/astrology/panchang', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer ' + process.env.VEDIKA_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "datetime": "2026-03-23T12:00:00",
    "latitude": 28.6139,
    "longitude": 77.209,
    "timezone": "+05:30",
    "lang": "hi"
  }),
});
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/panchang',
    method='POST',
    data=json.dumps({
        "datetime": "2026-03-23T12:00:00",
        "latitude": 28.6139,
        "longitude": 77.209,
        "timezone": "+05:30",
        "lang": "hi"
    }).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:

coordinates, datetime, disha_shool, guidance, karana, masa, nakshatra, ritu, timezone, tithi, vaara, yoga.

When lang is not English the response also carries language and _translation next to data.

Parameters

Body fields for /v2/astrology/panchang.

ParameterTypeRequiredDescription
datetimestringYesThe moment to read, as an ISO-8601 timestamp.
latitudenumberYesLatitude of the place, in decimal degrees.
longitudenumberYesLongitude of the place, in decimal degrees.
timezonestringYesIANA timezone or numeric UTC offset for the place.
includestringNoAdd-on blocks such as sunrise and muhurta. Each one adds to the price and returns its own field in data; the samples leave it out.
langstringNoResponse language code, for example hi. The sample body sends hi.

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