Cookbook

Task-focused recipes that connect the docs into one path, plus one worked example.

Task-focused recipes that connect the reference docs into one path — pick the one that matches what you are building and follow the link for the full detail.

#Recipes

#Example: a multi-turn conversation

Two calls to the same endpoint, sharing one conversationId. The first response returns the id; the second call passes it back so the follow-up question is answered against the same chart and the prior turn.

import os, requests

BASE = "https://api.vedika.io/api/v1/astrology/query"
HEADERS = {"x-api-key": os.environ["VEDIKA_KEY"]}
BIRTH = {
    "datetime": "1990-05-15T10:30:00",
    "latitude": 28.6139, "longitude": 77.2090,
    "timezone": "Asia/Kolkata",
}

# Turn 1
r1 = requests.post(BASE, headers=HEADERS, json={
    "question": "What does my chart say about career direction?",
    "birthDetails": BIRTH,
}, timeout=180)
d1 = r1.json()
conversation_id = d1["conversationId"]
print(d1["answer"])

# Turn 2 — same conversationId, follow-up question
r2 = requests.post(BASE, headers=HEADERS, json={
    "question": "Which months this year are best for a job change?",
    "birthDetails": BIRTH,
    "conversationId": conversation_id,
}, timeout=180)
print(r2.json()["answer"])