Five ways to integrate Vedika into your application: REST API, JavaScript SDK, Python SDK, SSE streaming for real-time AI responses, and webhooks for async workflows.
Standard JSON over HTTPS. All endpoints accept POST requests with JSON body and return JSON responses. Base URL: https://api.vedika.io
curl -X POST https://api.vedika.io/v2/astrology/kundli \
-H "Content-Type: application/json" \
-H "Authorization: Bearer vk_live_your_key_here" \
-d '{
"datetime": "1990-06-15T10:30:00",
"latitude": 19.0760,
"longitude": 72.8777,
"timezone": "+05:30"
}'
{
"success": true,
"data": {
"planets": [
{ "name": "Sun", "sign": "Taurus", "house": 11, "degree": 0.89, "nakshatra": "Mrigashira" },
{ "name": "Moon", "sign": "Capricorn", "house": 5, "degree": 15.23, "nakshatra": "Shravana" }
],
"houses": [ ... ],
"ascendant": { "sign": "Leo", "degree": 3.45 }
}
}
Typed interfaces, auto-retry with exponential backoff, streaming support, and error handling built in. Works in Node.js 18+ and modern browsers.
import { VedikaClient } from '@vedika-io/sdk';
const vedika = new VedikaClient({ apiKey: process.env.VEDIKA_API_KEY });
// Birth chart
const chart = await vedika.astrology.kundli({
datetime: '1990-06-15T10:30:00',
latitude: 19.0760,
longitude: 72.8777,
timezone: '+05:30'
});
console.log(chart.planets); // Typed planet array
console.log(chart.ascendant); // { sign, degree, nakshatra }
Pythonic interface with type hints, async support, and automatic retries. Compatible with Python 3.8+.
from vedika import VedikaClient
client = VedikaClient(api_key="vk_live_your_key")
chart = client.astrology.kundli(
datetime="1990-06-15T10:30:00",
latitude=19.0760,
longitude=72.8777,
timezone="+05:30"
)
print(chart.planets) # List of Planet objects
print(chart.ascendant) # Ascendant with sign, degree, nakshatra
The AI chatbot endpoint supports real-time streaming via SSE. Responses are delivered token-by-token for a typing-like experience. Ideal for chat interfaces.
const evtSource = new EventSource(
'https://api.vedika.io/api/vedika/chat/stream?' +
new URLSearchParams({
question: 'What does my career look like?',
datetime: '1990-06-15T10:30:00',
latitude: '19.0760',
longitude: '72.8777',
timezone: '+05:30',
apiKey: 'vk_live_your_key'
})
);
evtSource.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'token') {
document.getElementById('response').textContent += data.content;
}
if (data.type === 'done') {
evtSource.close();
}
};
For long-running AI analysis or batch processing, configure a webhook URL to receive results asynchronously. Useful when you want to offload processing and get notified when results are ready.
{
"event": "query.completed",
"queryId": "q_abc123",
"timestamp": "2026-02-23T14:30:00Z",
"data": {
"question": "Career analysis for 1990 birth chart",
"response": "Based on your chart, the 10th lord Mercury is...",
"confidence": 0.95
}
}
All requests require an API key passed in the Authorization: Bearer header. Keys are generated from the dashboard.
| Header | Value | Required |
|---|---|---|
| Authorization: Bearer | vk_live_your_key_here | Yes (all requests) |
| Content-Type | application/json | Yes (POST requests) |
vk_live_vk_ent_vk_test_) are rejected in production| Status | Meaning | Action |
|---|---|---|
| 200 | Success | Parse response body |
| 400 | Bad request (missing/invalid fields) | Check request body schema |
| 401 | Invalid or missing API key | Check Authorization: Bearer <key> header (x-api-key also accepted during deprecation window until 2026-10-20) |
| 402 | Insufficient wallet balance | Add funds from dashboard |
| 429 | Rate limit exceeded | Back off and retry after Retry-After header |
| 500 | Server error | Retry with exponential backoff |
Every birth chart requires latitude, longitude, and timezone. Instead of integrating a separate geocoding vendor, use Vedika's built-in geocode endpoints — $0.01 per call flat, no external-vendor markup, no ToS restrictions on reselling results.
What makes it different: the resolve endpoint returns the historical timezone offset at the moment of birth, not the modern one. For births before 1970, US DST rule changes of 2007, or India's pre-1945 timezone shifts, this gives you the mathematically correct UTC offset — which every competing astrology API gets wrong.
| Endpoint | Purpose | Price | Rate limit |
|---|---|---|---|
GET /v2/geocode/search | Autocomplete place name → ranked list | $0.01 / call | Plan default |
GET /v2/geocode/resolve | placeId (+ optional birthDate) → full details + historical timezone | $0.01 / call | Plan default |
GET /v2/geocode/reverse | lat/lng → nearest city | $0.01 / call | Plan default |
# 1. Autocomplete
curl "https://api.vedika.io/v2/geocode/search?q=mumbai&country=IN&limit=1" \
-H "Authorization: Bearer vk_live_your_key"
# Returns: { placeId: "IN-16-Mumbai-1275339", ... timezone: "Asia/Kolkata" }
# 2. Resolve with birthDate → historical offset
curl "https://api.vedika.io/v2/geocode/resolve?placeId=IN-16-Mumbai-1275339&birthDate=1962-06-15T07:42:00" \
-H "Authorization: Bearer vk_live_your_key"
# Returns:
# {
# "success": true,
# "place": { "name": "Mumbai", "latitude": 19.07283, "longitude": 72.88261, ... },
# "timezoneAtBirth": {
# "ianaZone": "Asia/Kolkata",
# "utcOffsetMinutes": 330,
# "utcOffsetString": "+05:30",
# "isDst": false,
# "resolvedFor": "1962-06-15T07:42:00.000Z"
# }
# }
const API = 'https://api.vedika.io';
const KEY = 'vk_live_your_key';
async function getBirthCoords(placeQuery, birthDate) {
const search = await fetch(`${API}/v2/geocode/search?q=${encodeURIComponent(placeQuery)}&limit=1`, {
headers: { Authorization: `Bearer ${KEY}` }
}).then(r => r.json());
if (!search.results.length) throw new Error('Place not found');
const placeId = search.results[0].placeId;
const resolved = await fetch(`${API}/v2/geocode/resolve?placeId=${placeId}&birthDate=${birthDate}`, {
headers: { Authorization: `Bearer ${KEY}` }
}).then(r => r.json());
return {
latitude: resolved.place.latitude,
longitude: resolved.place.longitude,
timezone: resolved.timezoneAtBirth.utcOffsetString // e.g. "+05:30"
};
}
// Feed directly into any /v2/astrology/* endpoint
const coords = await getBirthCoords('Bombay', '1962-06-15T07:42:00');
import requests
API = 'https://api.vedika.io'
KEY = 'vk_live_your_key'
headers = {'Authorization': f'Bearer {KEY}'}
def get_birth_coords(place_query, birth_date):
s = requests.get(f'{API}/v2/geocode/search',
params={'q': place_query, 'limit': 1},
headers=headers).json()
if not s['results']:
raise ValueError('Place not found')
place_id = s['results'][0]['placeId']
r = requests.get(f'{API}/v2/geocode/resolve',
params={'placeId': place_id, 'birthDate': birth_date},
headers=headers).json()
return {
'latitude': r['place']['latitude'],
'longitude': r['place']['longitude'],
'timezone': r['timezoneAtBirth']['utcOffsetString']
}
coords = get_birth_coords('Bombay', '1962-06-15T07:42:00')
These are mapped for you — passing the old name returns the modern city: