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 "x-api-key: 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 x-api-key header. Keys are generated from the dashboard.
| Header | Value | Required |
|---|---|---|
| x-api-key | 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 x-api-key header |
| 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 |