Developer Resources

SDKs & Code Examples

Copy-paste ready code snippets in Python, JavaScript, and cURL. Sandbox snippets need no key; production SDK and AI examples require an API key.

Quick Start (30 seconds)

No signup, no API key — the FREE Sandbox below returns real response shapes on the spot.

Building with a coding agent? Use the Vedika apps skill pack (download .zip).

FREE No API key needed for Sandbox
# Get a birth chart instantly (no signup required)
curl -X POST "https://api.vedika.io/sandbox/astrology/birth-chart" \
  -H "Content-Type: application/json" \
  -d '{"datetime":"1990-05-15T10:30:00","latitude":28.6139,"longitude":77.2090,"timezone":"+05:30"}'

Python

Official vedika-sdk, plus raw requests examples for matching and the AI chatbot endpoint.

Installation Official SDK

# Install official Vedika SDK from PyPI
pip install vedika-sdk

# JavaScript / Node.js, from npm
npm install @vedika-io/sdk

Current versions: Python 3.3.0 · JavaScript 3.3.0

View on PyPI

Quick Start with SDK

from vedika import VedikaClient

# Initialize with your API key
client = VedikaClient(api_key="YOUR_API_KEY")

# Ask astrology questions
response = client.ask_question(
    "What is my moon sign?",
    birth_details={
        "datetime": "1990-05-15T10:30:00",
        "latitude": 28.6139,
        "longitude": 77.2090,
        "timezone": "+05:30"
    }
)
print(response.answer)

# The free sandbox needs no key: call the /sandbox routes with plain
# HTTP (see the Raw HTTP section below).

Predictions NEW v1.1.0

from vedika import VedikaClient

client = VedikaClient(api_key="YOUR_API_KEY")

# Daily prediction by rashi (moon sign)
daily = client.get_prediction("daily", rashi="Aries")
print(f"Score: {daily['data']['overallScore']}")
print(f"Career: {daily['data']['predictions']['career']['text']}")

# Weekly, Monthly, Quarterly, Yearly predictions
weekly = client.get_prediction("weekly", rashi="Taurus")
monthly = client.get_prediction("monthly", rashi="Gemini")
quarterly = client.get_prediction("quarterly", rashi="Leo")
yearly = client.get_prediction("yearly", rashi="Scorpio")

Birth Chart (Kundali)

from vedika import VedikaClient

client = VedikaClient(api_key="YOUR_API_KEY")

# Generate birth chart
chart = client.request("POST", "/v2/astrology/birth-chart", json={
    "datetime": "1990-05-15T10:30:00",
    "latitude": 28.6139,
    "longitude": 77.2090,
    "timezone": "+05:30"
})
print(f"Ascendant: {chart['data']['ascendant']['sign']}")
print(f"Moon Sign: {chart['data']['moonSign']}")

Kundali Matching (36 Guna Milan)

import requests

SANDBOX_URL = "https://api.vedika.io/sandbox"

def match_kundali(male, female):
    """Calculate compatibility between two birth charts"""
    response = requests.post(
        f"{SANDBOX_URL}/astrology/guna-milan",
        json={
            "male": male,
            "female": female
        }
    )
    return response.json()["data"]

# Example
male = {"datetime": "1992-07-22T14:15:00", "latitude": 19.07, "longitude": 72.87, "timezone": "+05:30"}
female = {"datetime": "1995-03-15T10:30:00", "latitude": 28.61, "longitude": 77.20, "timezone": "+05:30"}

result = match_kundali(male, female)
print(f"Score: {result['total_points']}/{result['maximum_points']}")
print(f"Verdict: {result['match_result']}")

AI Chatbot Query

import requests

def ask_vedika(question, api_key, birth_details=None, language="en"):
    """Ask natural language astrology question (requires API key)"""
    payload = {
        "question": question,
        "language": language
    }
    if birth_details:
        payload["birthDetails"] = birth_details

    response = requests.post(
        "https://api.vedika.io/api/v1/astrology/query",
        headers={"Authorization": f"Bearer {api_key}"},
        json=payload
    )
    return response.json()

# Example: Personalized question
birth = {"datetime": "1990-05-15T10:30:00", "latitude": 28.61, "longitude": 77.20, "timezone": "+05:30"}
answer = ask_vedika("How is my career looking this year?", api_key="YOUR_API_KEY", birth_details=birth)
print(answer["response"])

# Same question in Hindi
answer = ask_vedika("How is my career looking this year?", api_key="YOUR_API_KEY", birth_details=birth, language="hi")
print(answer["response"])  # Response in Hindi

JavaScript / Node.js

Official CLI, browser fetch, Node with axios, and a React hook.

Vedika CLI Official CLI v1.1.2

# Run directly with npx (no install needed)
npx @vedika-io/cli --help

# Or install globally
npm install -g @vedika-io/cli

# Login with your API key
vedika login

# Get predictions
vedika predict daily --rashi Aries
vedika predict weekly --rashi Taurus
vedika predict monthly --rashi Gemini

# Get panchang
vedika panchang
vedika panchang 2026-01-15

# AI astrology chat
vedika ask "What is my moon sign?" --datetime "1990-05-15T10:30:00" --lat 28.6139 --lon 77.2090

View on npm

Browser (Fetch API)

const SANDBOX_URL = 'https://api.vedika.io/sandbox';

async function getKundali(datetime, latitude, longitude, timezone) {
  const response = await fetch(`${SANDBOX_URL}/astrology/birth-chart`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ datetime, latitude, longitude, timezone })
  });
  return response.json();
}

// Usage
const chart = await getKundali('1990-05-15T10:30:00', 28.6139, 77.2090, '+05:30');
console.log(`Ascendant: ${chart.data.ascendant.sign}`);

Node.js (with axios)

const axios = require('axios');

const SANDBOX_URL = 'https://api.vedika.io/sandbox';
// For production:
// const PROD_URL = 'https://api.vedika.io';
// const headers = { 'Authorization': 'Bearer YOUR_API_KEY' };

async function matchKundali(male, female) {
  const { data } = await axios.post(
    `${SANDBOX_URL}/astrology/guna-milan`,
    { male, female }
  );
  return data.data;
}

// Usage
const male = { datetime: '1992-07-22T14:15:00', latitude: 19.07, longitude: 72.87, timezone: '+05:30' };
const female = { datetime: '1995-03-15T10:30:00', latitude: 28.61, longitude: 77.20, timezone: '+05:30' };

const result = await matchKundali(male, female);
console.log(`Score: ${result.total_points}/${result.maximum_points} - ${result.match_result}`);

React Hook Example

import { useState, useEffect } from 'react';

function useHoroscope(sign) {
  const [horoscope, setHoroscope] = useState(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  useEffect(() => {
    async function fetchHoroscope() {
      try {
        const res = await fetch(
          `https://api.vedika.io/sandbox/astrology/horoscope/${sign}`
        );
        const body = await res.json();
        setHoroscope(body.data);
      } catch (err) {
        setError(err.message);
      } finally {
        setLoading(false);
      }
    }
    fetchHoroscope();
  }, [sign]);

  return { horoscope, loading, error };
}

// Usage in component
function DailyHoroscope({ sign }) {
  const { horoscope, loading } = useHoroscope(sign);
  if (loading) return <p>Loading...</p>;
  return <p>{horoscope.prediction}</p>;
}

Swift 1.4.2

Add the SwiftPM package, then choose VedikaSDK for API calls and VedikaRoomCapture for native room capture:

.package(url: "https://github.com/vedika-io/vedika-sdk-swift.git", from: "1.4.2")
// In your target dependencies:
.product(name: "VedikaSDK", package: "vedika-sdk-swift"),
.product(name: "VedikaRoomCapture", package: "vedika-sdk-swift")

CocoaPods 1.4.2 is on the CocoaPods trunk and installs the API client, VedikaSDK. VedikaRoomCapture is SwiftPM only.

# Podfile
pod 'VedikaSDK', '~> 1.4'

Native Vastu integration guide · Swift 1.4.2 release

Review device requirements and current evidence in the guide. Real-phone accuracy is not yet measured.

Android · client 2.0.0 and AR 2.0.0

For the API client without AR, add JitPack and install client 2.0.0. This major release changes some Vastu response accessor types; read the 2.0.0 migration notes before upgrading a 1.x integration.

// In dependencyResolutionManagement.repositories:
maven { url = uri("https://jitpack.io") }
// In your app dependencies:
implementation("com.github.vedika-io:vedika-sdk-android:2.0.0")

For native AR capture, use the matching client and AR 2.0.0 pair below. The AR module declares client 2.0.0 as a public dependency. These are alternative installation blocks; upgrading a 1.x integration requires checking the breaking core changes linked above.

// With the JitPack repository configured:
implementation("com.github.vedika-io:vedika-sdk-android:2.0.0")
implementation("com.github.vedika-io:vedika-sdk-android-ar:2.0.0")

Native Vastu integration guide · Client 2.0.0 artifact · AR artifact · AR dependency declaration · AR 2.0.0 release

AR 2.0.0 includes floor-merge session support alongside capture and relocalization. Validate the complete consumer APK, including transitive native libraries, on supported Android devices and 16 KB page configurations. Real-phone accuracy is not yet measured.

Flutter 1.0.5

The Flutter SDK is published on pub.dev as vedika_sdk, version 1.0.5:

# pubspec.yaml
dependencies:
  vedika_sdk: ^1.0.5

To pin the same release from GitHub instead, use its release tag:

# pubspec.yaml
dependencies:
  vedika_sdk:
    git:
      url: https://github.com/vedika-io/vedika-sdk-flutter.git
      ref: v1.0.5

Flutter integration guide · Flutter v1.0.5 release

cURL

Raw HTTP: sandbox first, then production once you add an API key.

Birth Chart

curl -X POST "https://api.vedika.io/sandbox/astrology/birth-chart" \
  -H "Content-Type: application/json" \
  -d '{"datetime":"1990-05-15T10:30:00","latitude":28.6139,"longitude":77.2090,"timezone":"+05:30"}'

Kundali Matching

curl -X POST "https://api.vedika.io/sandbox/astrology/guna-milan" \
  -H "Content-Type: application/json" \
  -d '{
    "male": {"datetime": "1992-07-22T14:15:00", "latitude": 19.07, "longitude": 72.87, "timezone": "+05:30"},
    "female": {"datetime": "1995-03-15T10:30:00", "latitude": 28.61, "longitude": 77.20, "timezone": "+05:30"}
  }'

AI Chatbot Query

curl -X POST "https://api.vedika.io/api/v1/astrology/query" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "question": "What does Saturn in 10th house mean for career?",
    "birthDetails": {"datetime": "1990-05-15T10:30:00", "latitude": 28.6139, "longitude": 77.2090, "timezone": "+05:30"},
    "language": "en"
  }'

Daily Panchang

curl "https://api.vedika.io/sandbox/astrology/panchang?latitude=28.6139&longitude=77.2090&timezone=%2B05:30"

Production API (with API Key)

# Replace YOUR_API_KEY with your actual API key from dashboard
curl -X POST "https://api.vedika.io/v2/astrology/kundli" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"datetime":"1990-05-15T10:30:00","latitude":28.6139,"longitude":77.2090,"timezone":"+05:30"}'

Ready to build?

Start with the FREE Sandbox — no signup required. When you're ready for production, get your API key from the dashboard.