TutorialApril 20266 min read
Vedic Astrology API in Python: Birth Chart in 5 Lines of Code
The VedIntel Python SDK handles authentication, retries, and response parsing for you. This guide goes from zero to a complete birth chart in under 5 minutes.
Install
pip install vedintel
The 5-line version
from vedintel import VedIntel
client = VedIntel(api_key="vai_your_key_here")
chart = client.horoscope.planet_details(
dob="01/10/1977", tob="11:40",
lat=11, lon=77, tz=5.5
)
print(chart) # Full planet positions, nakshatras, house placementsFetch multiple endpoints at once
For a full horoscope dashboard, you typically need planets, ascendant, dasha, and panchang. The SDK supports concurrent calls:
from vedintel import VedIntel
import json
client = VedIntel(api_key="vai_your_key_here")
birth = dict(dob="01/10/1977", tob="11:40", lat=11.0, lon=77.0, tz=5.5)
# Fetch everything in parallel
planets = client.horoscope.planet_details(**birth)
ascendant = client.extended_horoscope.find_ascendant(**birth)
dasha = client.dashas.current_mahadasha(**birth)
panchang = client.panchang.panchang(**birth)
print(f"Ascendant: {ascendant['ascendant']}")
print(f"Moon Sign: {planets[1]['zodiac']}") # index 1 = Moon
print(f"Mahadasha: {dasha['name']} until {dasha['end']}")
print(f"Today's Nakshatra: {panchang['nakshatra']['name']}")Response shape
# planets response shape
{
"0": { "name": "Ascendant", "zodiac": "Sagittarius", "house": 1, "degree": 14.2 },
"1": { "name": "Sun", "zodiac": "Virgo", "house": 10, "degree": 14.8, "nakshatra": "Hasta" },
"2": { "name": "Moon", "zodiac": "Aries", "house": 5, "degree": 6.3, "nakshatra": "Krittika" },
"3": { "name": "Mars", "zodiac": "Gemini", "house": 7, "degree": 1.1, "retro": false },
...
}Add AI interpretation (optional)
On any paid plan, one more line gives you a 700-word Claude chart reading (charges 1 call from your quota):
# AI chart interpretation (requires paid plan) reading = client.ai.interpret_chart(**birth) print(reading['interpretation']) # 700+ word Claude reading
SDK features
- Automatic retry with exponential backoff on 429 and 5xx
- Configurable timeout (default 30s, set 60s for AI endpoints)
- Full type hints — works with mypy in strict mode
- Access to all 116 endpoints via namespaced methods
- Sync and async (
AsyncVedIntel) clients
500 free calls/month. No credit card required.
Get free API key →