Complete API Reference • 3500+ Words
Complete Birth Chart API Guide with Code Examples
All endpoints explained with examples in Python, JavaScript, and PHP. Response formats and best practices included.
The Vedika Kundali API provides comprehensive Vedic astrology calculations through simple REST endpoints. This guide covers all birth chart related endpoints with complete examples.
https://api.vedika.io
Free Sandbox
Test with mock data at /sandbox/* endpoints — no API key needed. Subscribe from $12/mo for live data.
All API requests require authentication using your API key in the Authorization: Bearer <key> header.
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
curl -X POST https://api.vedika.io/v2/astrology/birth-chart \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30"
}'
Security Note
Never expose your API key in client-side code. Use environment variables or backend proxies.
/v2/astrology/birth-chart
Generate a complete Vedic birth chart with planetary positions, houses and nakshatras.
| Parameter | Type | Required | Description |
|---|---|---|---|
datetime |
string | Required | Birth date and time in ISO 8601 format, local time at the birth place (e.g., "1990-05-15T10:30:00") |
latitude |
number | Required | Birth location latitude (-90 to 90) |
longitude |
number | Required | Birth location longitude (-180 to 180) |
timezone |
string | Required | UTC offset of the birth place (e.g., "+05:30" for IST) |
ayanamsa |
string | Optional | Ayanamsa system: "lahiri" (default), "raman", "kp", "yukteshwar" |
language |
string | Optional | Response language: "en" (default), "hi", "es", etc. |
{
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30",
"ayanamsa": "lahiri",
"language": "en"
}
{
"success": true,
"data": {
"ascendant": {
"sign": "Cancer",
"signLord": "Moon",
"degree": 2.41,
"fullDegree": 92.41,
"nakshatra": {"name": "Punarvasu", "lord": "Jupiter", "pada": 4}
},
"sunSign": "Taurus",
"moonSign": "Sagittarius",
"nakshatra": "Uttara Ashadha",
"tithi": "Krishna Panchami",
"planets": [
{
"name": "Sun",
"sign": "Taurus",
"signLord": "Venus",
"house": 11,
"degree": 0.4,
"fullDegree": 30.4,
"isRetrograde": false,
"nakshatra": {"name": "Krittika", "lord": "Sun", "pada": 2}
}
// ... other planets
],
"houses": [
{"number": 1, "sign": "Cancer", "lord": "Moon", "cusp": 90}
// ... houses 2-12
]
},
"billing": {"charged": 0.02, "currency": "USD", "category": "chart"}
}
/v2/astrology/planetary-positions
Get detailed planetary positions including speed, latitude, and dignities.
| Dignity | Sanskrit | Description | Strength |
|---|---|---|---|
| Exalted | Uchcha | Planet in its exaltation sign | Very Strong |
| Own Sign | Swakshetra | Planet in sign it rules | Strong |
| Friendly | Mitra | Planet in friend's sign | Moderate |
| Neutral | Sama | Planet in neutral sign | Neutral |
| Enemical | Shatru | Planet in enemy sign | Weak |
| Debilitated | Neecha | Planet in debilitation sign | Very Weak |
/v2/astrology/divisional-chart
Generate any of the 60 divisional charts (D1-D60).
| Chart | Division | Signification | Parameter |
|---|---|---|---|
| Rashi (D1) | 1 | Birth chart, overall life | d1 |
| Hora (D2) | 2 | Wealth, finances | d2 |
| Drekkana (D3) | 3 | Siblings, courage | d3 |
| Chaturthamsa (D4) | 4 | Fortune, property | d4 |
| Saptamsa (D7) | 7 | Children, progeny | d7 |
| Navamsa (D9) | 9 | Spouse, dharma, soul | d9 |
| Dasamsa (D10) | 10 | Career, profession | d10 |
| Dwadasamsa (D12) | 12 | Parents, ancestry | d12 |
| Shodasamsa (D16) | 16 | Vehicles, comforts | d16 |
| Vimsamsa (D20) | 20 | Spiritual pursuits | d20 |
POST /v2/astrology/navamsa
{
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30"
}
/v2/astrology/vimshottari-dasha
Calculate Vimshottari Dasha periods for entire life (120 years).
| Planet | Mahadasha Years | Characteristics |
|---|---|---|
| Ketu | 7 years | Spirituality, detachment, sudden events |
| Venus | 20 years | Luxury, relationships, arts, comforts |
| Sun | 6 years | Authority, government, father, health |
| Moon | 10 years | Emotions, mother, mind, public |
| Mars | 7 years | Energy, property, siblings, courage |
| Rahu | 18 years | Materialism, foreign, unconventional |
| Jupiter | 16 years | Wisdom, children, wealth, expansion |
| Saturn | 19 years | Karma, delays, hard work, longevity |
| Mercury | 17 years | Intelligence, business, communication |
{
"success": true,
"data": {
"nakshatra": {"id": 21, "name": "Uttara Ashadha", "lord": "Sun", "pada": 1},
"dasha_balance": {"planet": "Sun", "years": 4, "months": 6, "days": 24},
"current_dasha": {
"maha_dasha": {"planet": "Rahu", "start_date": "2011-12-09", "end_date": "2029-12-09"},
"antar_dasha": {"planet": "Sun", "start_date": "2026-06-28", "end_date": "2027-05-23"},
"pratyantar_dasha": {"planet": "Rahu", "start_date": "2026-08-29", "end_date": "2026-10-17"}
},
"maha_dasha": [
{
"planet": "Sun",
"start_date": "1990-05-15",
"end_date": "1994-12-08",
"duration_years": 4.57,
"is_current": false,
"antar_dasha": [...]
}
// ... remaining mahadashas
]
}
}
/v2/astrology/jaimini/rajayogas
Detect Jaimini Rajayogas (sign-based combinations indicating power, status and success) in the birth chart.
{
"success": true,
"data": {
"system": "jaimini",
"rajayogas": [
{
"name": "Atmakaraka-Amatyakaraka conjunction",
"formed": true,
"planets": ["Saturn", "Mercury"],
"houses": [9, 10],
"description": "Soul significator joined with the minister significator",
"strength": "strong"
}
]
}
}
/v2/astrology/guna-milan
Calculate Ashtakoota compatibility (36 Gunas) between two charts.
| Koota | Points | Signification |
|---|---|---|
| Varna | 1 | Spiritual compatibility |
| Vashya | 2 | Mutual attraction |
| Tara | 3 | Birth star compatibility |
| Yoni | 4 | Sexual compatibility |
| Graha Maitri | 5 | Mental compatibility |
| Gana | 6 | Temperament compatibility |
| Bhakoot | 7 | Emotional compatibility |
| Nadi | 8 | Health and progeny |
{
"male": {
"datetime": "1995-06-20T10:30:00",
"latitude": 28.6139,
"longitude": 77.209,
"timezone": "+05:30"
},
"female": {
"datetime": "1997-03-15T14:00:00",
"latitude": 19.076,
"longitude": 72.8777,
"timezone": "+05:30"
}
}
{
"success": true,
"data": {
"total_points": 17.5,
"maximum_points": 36,
"percentage": 49,
"match_result": "Not Compatible",
"recommendation": "Low compatibility - Not recommended for marriage",
"guna_kootas": [
{"name": "Varna", "points": 1, "maximum_points": 1, "description": "Brahmin (male) vs Vaishya (female)"},
{"name": "Vasya", "points": 1, "maximum_points": 2, "description": "Partial Vasya"},
{"name": "Tara", "points": 1.5, "maximum_points": 3}
// ... remaining kootas
],
"male_info": {"moon_nakshatra": "Uttara Bhadrapada", "moon_sign": "Pisces"},
"female_info": {"moon_nakshatra": "Mrigashira", "moon_sign": "Taurus"}
}
}
import os
import requests
class VedikaAPI:
def __init__(self, api_key):
self.base_url = "https://api.vedika.io"
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
def post(self, path, body):
"""Every v2 call returns {"success": true, "data": {...}, "billing": {...}}"""
response = requests.post(f"{self.base_url}{path}", json=body, headers=self.headers)
response.raise_for_status()
return response.json()
def get_birth_chart(self, birth_data):
"""Get complete birth chart"""
return self.post("/v2/astrology/birth-chart", birth_data)
def get_dashas(self, birth_data):
"""Get Vimshottari dasha periods"""
return self.post("/v2/astrology/vimshottari-dasha", birth_data)
def match_kundali(self, male, female):
"""Ashtakoota (36 guna) matching"""
return self.post("/v2/astrology/guna-milan", {"male": male, "female": female})
# Usage
api = VedikaAPI(os.environ["VEDIKA_API_KEY"])
birth_data = {
"datetime": "1990-05-15T10:30:00",
"latitude": 19.07,
"longitude": 72.87,
"timezone": "+05:30",
"ayanamsa": "lahiri"
}
# Get birth chart
chart = api.get_birth_chart(birth_data)["data"]
print(f"Sun Sign: {chart['sunSign']}")
print(f"Moon Sign: {chart['moonSign']}")
print(f"Ascendant: {chart['ascendant']['sign']}")
for planet in chart["planets"]:
print(f"- {planet['name']}: {planet['sign']}, house {planet['house']}")
# Get current dasha
dashas = api.get_dashas(birth_data)["data"]
print(f"\nCurrent Mahadasha: {dashas['current_dasha']['maha_dasha']['planet']}")
print(f"Current Antardasha: {dashas['current_dasha']['antar_dasha']['planet']}")
# Match two charts
male = {"datetime": "1995-06-20T10:30:00", "latitude": 28.6139, "longitude": 77.209, "timezone": "+05:30"}
female = {"datetime": "1997-03-15T14:00:00", "latitude": 19.076, "longitude": 72.8777, "timezone": "+05:30"}
match = api.match_kundali(male, female)["data"]
print(f"\nGuna Milan: {match['total_points']} / {match['maximum_points']} ({match['match_result']})")
const axios = require('axios');
class VedikaAPI {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseURL = 'https://api.vedika.io';
this.headers = {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
};
}
// Every v2 call returns { success, data, billing }
async post(path, body) {
const response = await axios.post(`${this.baseURL}${path}`, body, { headers: this.headers });
return response.data;
}
async getBirthChart(birthData) {
return this.post('/v2/astrology/birth-chart', birthData);
}
async getDivisionalChart(division, birthData) {
return this.post('/v2/astrology/divisional-chart', { ...birthData, division });
}
async getYogas(birthData) {
return this.post('/v2/astrology/jaimini/rajayogas', birthData);
}
}
// Usage
const api = new VedikaAPI(process.env.VEDIKA_API_KEY);
const birthData = {
datetime: '1990-05-15T10:30:00',
latitude: 19.07,
longitude: 72.87,
timezone: '+05:30'
};
(async () => {
// Get birth chart
const chart = await api.getBirthChart(birthData);
console.log('Planetary Positions:');
chart.data.planets.forEach((planet) => {
console.log(`${planet.name}: ${planet.sign} (${planet.degree.toFixed(2)}°)`);
});
// Get Navamsa chart (division 9)
const navamsa = await api.getDivisionalChart(9, birthData);
console.log('\nNavamsa Chart:');
console.log(navamsa.data);
// Get Jaimini rajayogas
const yogas = await api.getYogas(birthData);
console.log('\nRajayogas:');
console.log(yogas.data);
})();
<?php
class VedikaAPI {
private $apiKey;
private $baseURL = 'https://api.vedika.io';
public function __construct($apiKey) {
$this->apiKey = $apiKey;
}
private function makeRequest($endpoint, $data) {
$ch = curl_init($this->baseURL . $endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $this->apiKey,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode !== 200) {
throw new Exception("API Error: " . $response);
}
return json_decode($response, true);
}
public function getBirthChart($birthData) {
return $this->makeRequest('/v2/astrology/birth-chart', $birthData);
}
public function getDashas($birthData) {
return $this->makeRequest('/v2/astrology/vimshottari-dasha', $birthData);
}
public function matchKundali($male, $female) {
return $this->makeRequest('/v2/astrology/guna-milan', [
'male' => $male,
'female' => $female
]);
}
}
// Usage
$api = new VedikaAPI(getenv('VEDIKA_API_KEY'));
$birthData = [
'datetime' => '1990-05-15T10:30:00',
'latitude' => 19.07,
'longitude' => 72.87,
'timezone' => '+05:30'
];
try {
// Get birth chart
$chart = $api->getBirthChart($birthData);
echo "Birth Chart Analysis\n";
echo "===================\n\n";
echo "Sun sign: " . $chart['data']['sunSign'] . "\n";
echo "Moon sign: " . $chart['data']['moonSign'] . "\n";
echo "Ascendant: " . $chart['data']['ascendant']['sign'] . "\n\n";
// Get dashas
$dashas = $api->getDashas($birthData);
echo "Current Dasha Periods:\n";
echo "Mahadasha: " . $dashas['data']['current_dasha']['maha_dasha']['planet'] . "\n";
echo "Antardasha: " . $dashas['data']['current_dasha']['antar_dasha']['planet'] . "\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
?>
Always implement comprehensive error handling:
try {
const chart = await api.getBirthChart(birthData);
} catch (error) {
if (error.response) {
// Server error
if (error.response.status === 400) {
console.error('Invalid birth data');
} else if (error.response.status === 401) {
console.error('Invalid API key');
} else if (error.response.status === 429) {
console.error('Rate limit exceeded');
}
} else {
// Network error
console.error('Network error');
}
}
Cache birth charts to reduce API calls:
Validate data before API calls:
Respect API rate limits:
Free sandbox for testing. Plans from $12/mo with wallet-based billing.