TECHNICAL TUTORIAL

Birth Chart API Tutorial: Generate Natal Charts Programmatically

Complete guide to generating birth charts (Kundali) via API with planetary positions, houses, aspects, and yogas.

December 22, 2025 15 min read

What's in a Birth Chart?

A birth chart (natal chart or Kundali) is a snapshot of the sky at the exact moment of birth. It includes:

  • Planetary positions - Sun, Moon, Mercury through Pluto
  • House placements - 12 houses representing life areas
  • Aspects - Angular relationships between planets
  • Ascendant (Lagna) - Rising sign at birth
  • Nakshatras - 27 lunar mansions (Vedic)
  • Yogas - Special planetary combinations

API Request

POST https://api.vedika.io/v1/charts/birth-chart

{
  "dateOfBirth": "1990-05-15",
  "timeOfBirth": "14:30:00",
  "placeOfBirth": "Mumbai, India",
  "ayanamsa": "lahiri",
  "houseSystem": "placidus"
}

API Response

{
  "ascendant": {
    "sign": "Virgo",
    "degree": 15.42,
    "nakshatra": "Hasta",
    "pada": 2
  },
  "planets": [
    {
      "name": "Sun",
      "sign": "Taurus",
      "degree": 24.18,
      "house": 9,
      "nakshatra": "Mrigashira",
      "retrograde": false
    },
    {
      "name": "Moon",
      "sign": "Cancer",
      "degree": 8.55,
      "house": 11,
      "nakshatra": "Pushya",
      "retrograde": false
    }
    // ... all planets
  ],
  "houses": [
    {"house": 1, "sign": "Virgo", "degree": 15.42},
    {"house": 2, "sign": "Libra", "degree": 12.18}
    // ... all 12 houses
  ],
  "aspects": [
    {"planet1": "Sun", "planet2": "Moon", "aspect": "sextile", "orb": 2.3},
    {"planet1": "Mars", "planet2": "Saturn", "aspect": "square", "orb": 1.8}
  ],
  "yogas": [
    {"name": "Budhaditya Yoga", "formed": true, "strength": "strong"},
    {"name": "Gajakesari Yoga", "formed": true, "strength": "medium"}
  ]
}

Python Implementation

import requests
from datetime import datetime

def generate_birth_chart(dob, tob, place):
    response = requests.post(
        "https://api.vedika.io/v1/charts/birth-chart",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        json={
            "dateOfBirth": dob,
            "timeOfBirth": tob,
            "placeOfBirth": place,
            "ayanamsa": "lahiri"
        }
    )
    return response.json()

# Generate chart
chart = generate_birth_chart("1990-05-15", "14:30:00", "Mumbai, India")

# Access data
print(f"Ascendant: {chart['ascendant']['sign']}")
print(f"Moon Sign: {next(p['sign'] for p in chart['planets'] if p['name'] == 'Moon')}")

# Check for yogas
for yoga in chart['yogas']:
    if yoga['formed']:
        print(f"Yoga: {yoga['name']} ({yoga['strength']})")

Ayanamsa Options

Vedika supports 8 ayanamsa systems:

  • lahiri - Most common in India
  • raman - B.V. Raman system
  • krishnamurti - KP system
  • fagan_bradley - Western sidereal
  • true_chitra - True Chitrapaksha
  • galactic_center - Galactic alignment
  • djwhal_khul - Esoteric system
  • yukteshwar - Sri Yukteshwar

House Systems

Supported house systems:

  • Placidus - Most popular in Western astrology
  • Whole Sign - Traditional Vedic (recommended)
  • Equal House - Equal 30° houses
  • Koch - Time-based system
  • Campanus - Space-based
  • Regiomontanus - Medieval system

Build Your Astrology App

Vedika provides the most comprehensive birth chart API with 300+ yogas and Swiss Ephemeris accuracy.

Get Free API Key