Python Quickstart
Your first API call in 5 minutes
1. Install the SDK
python -m pip install "vedika-sdk==3.1.3"
2. Initialize the Client
from vedika import VedikaClient
client = VedikaClient(timeout=15, max_retries=0) # Protected server environment
3. Make Your First Call
import json
birth_details = {"datetime": "1990-05-15T10:30:00+05:30", "latitude": 28.6139, "longitude": 77.2090, "timezone": "Asia/Kolkata"}
envelope = client.get_birth_chart_v2("birth-chart", birth_details) # V2: success/data/billing/meta
print(json.dumps(envelope["data"], ensure_ascii=False))
Complete Working Example
#!/usr/bin/env python3
"""quickstart.py - Vedika SDK Quickstart"""
import os
import json
from datetime import date
from vedika import VedikaClient
from vedika import VedikaAPIError
def main():
birth_details = {
"datetime": "1990-05-15T10:30:00+05:30",
"latitude": 28.6139,
"longitude": 77.2090,
"timezone": "Asia/Kolkata"
}
try:
client = VedikaClient(timeout=15, max_retries=0)
# 1. Get Birth Chart
print("Fetching birth chart...")
chart = client.get_birth_chart_v2("birth-chart", birth_details)
print(json.dumps(chart["data"], ensure_ascii=False))
# 2. Get Today's Panchang
print("\nFetching today's panchang...")
panchang = client.get_panchang(
date=date.today().isoformat(),
latitude=28.6139, longitude=77.2090, timezone="+05:30"
)
print(json.dumps(panchang["data"], ensure_ascii=False))
# 3. Get Dasha Periods
print("\nFetching dasha periods...")
dasha = client.get_vimshottari_dasha(birth_details)
print(json.dumps(dasha["data"], ensure_ascii=False))
# 4. AI-Powered Question
print("\nAsking AI about career...")
response = client.ask_question(
question="What are the career prospects?",
birth_details=birth_details, language="en"
)
print(f"AI Response: {response.answer[:200]}...")
except VedikaAPIError:
print("Request failed; review protected server diagnostics.")
if __name__ == "__main__":
main()
Run the Example
# Provision VEDIKA_API_KEY in your protected server environment.
python quickstart.py
Fetching birth chart...
Chart: JSON from envelope.data (runtime values)
Fetching today's panchang...
Panchang: JSON from envelope.data (runtime values)
Fetching dasha periods...
Dasha: JSON from envelope.data (runtime values)
Synthetic fixtures are test data, not a chart prediction.
SDK Methods Overview
| Method | Description | Pricing |
|---|---|---|
get_birth_chart_v2() |
Generate complete birth chart | $0.02 |
get_panchang() |
Daily Hindu calendar | $0.01 |
get_guna_milan() |
Marriage compatibility | $0.05 |
get_vimshottari_dasha() |
Dasha period calculation | $0.03 |
get_doshas_v2() |
Manglik check | $0.03 |
ask_question() |
AI-powered questions | $0.01-0.05 |