5 Minutes FREE Sandbox

Quickstart Guide

Get your first Vedika API call working in under 5 minutes. Instant sandbox access. No signup needed for sandbox.

Progress Step 0 of 4
1

Get Your Sandbox URL

The sandbox environment returns realistic mock data - perfect for development. It answers with one fixed sample whatever you send (today's horoscope comes back for Sagittarius), so the examples below ask for Sagittarius. A live key answers for the sign you send. No API key required!

https://api.vedika.io/sandbox

Tip: When you're ready for production with real astronomical data, get your API key from the Console.

2

Make Your First Request

Let's get a daily horoscope. Choose your preferred language:

import requests

# Sandbox URL - no API key needed!
url = "https://api.vedika.io/sandbox/astrology/horoscope/sagittarius"

response = requests.get(url)
data = response.json()["data"]

print(f"Today's Horoscope for {data['sign']}:")
print(data["prediction"])
print(f"\nLucky Number: {data['luckyNumber']}")
print(f"Lucky Color: {data['luckyColor']}")
3

Parse the Response

Here's what the JSON response looks like:

{
  "success": true,
  "data": {
    "sign": "Sagittarius",
    "rating": 4,
    "theme": "travel",
    "prediction": "Today's focus is on travel. Energy rating: 4/5. Lucky color: Gold, lucky number: 42. Compatible sign: Leo.",
    "luckyNumber": 42,
    "luckyColor": "Gold",
    "luckyTime": "10:00-12:00",
    "compatibleSign": "Leo"
  },
  "billing": {
    "charged": 0,
    "currency": "USD"
  }
}

Response Fields

  • data.prediction - Daily prediction text
  • data.luckyNumber - Today's lucky number
  • data.luckyColor - Auspicious color
  • data.compatibleSign - Best match sign

Available Signs

aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces

AI

Try the AI Chatbot Needs an API key

The AI endpoint is what makes Vedika unique. Ask any astrology question in natural language. Requires an API key.

curl -X POST https://api.vedika.io/api/v1/astrology/query \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer vk_live_YOUR_KEY" \
  -d '{
    "question": "What are my career prospects?",
    "birthDetails": {
      "datetime": "1990-05-15T14:30:00",
      "latitude": 19.076,
      "longitude": 72.877,
      "timezone": "+05:30"
    }
  }'

Key Fields

  • question - Any astrology question in natural language
  • birthDetails.datetime - ISO 8601 format (YYYY-MM-DDTHH:MM:SS)
  • birthDetails.timezone - UTC offset like "+05:30". IANA names like "Asia/Kolkata" also work
  • birthDetails.latitude/longitude - Birth place coordinates

Tip: Sandbox flat fields (date, time) also work on the live API, just add question and your API key header.

4

Build Your App!

You're ready to build! Here's a complete example:

import requests

BASE_URL = "https://api.vedika.io"

class VedikaAPI:
    """Simple Vedika API client: sandbox without a key, live routes with a key"""

    def __init__(self, api_key=None):
        self.api_key = api_key

    def _headers(self):
        headers = {"Content-Type": "application/json"}
        if self.api_key:
            headers["Authorization"] = f"Bearer {self.api_key}"
        return headers

    def get_horoscope(self, sign):
        """Get daily horoscope for a zodiac sign"""
        prefix = "/v2/astrology" if self.api_key else "/sandbox/astrology"
        response = requests.get(
            f"{BASE_URL}{prefix}/horoscope/{sign}",
            headers=self._headers()
        )
        return response.json()

    def get_birth_chart(self, datetime_str, latitude, longitude, timezone="+05:30"):
        """Generate a birth chart (Kundali)"""
        prefix = "/v2/astrology" if self.api_key else "/sandbox/astrology"
        response = requests.post(
            f"{BASE_URL}{prefix}/birth-chart",
            json={
                "datetime": datetime_str,
                "latitude": latitude,
                "longitude": longitude,
                "timezone": timezone
            },
            headers=self._headers()
        )
        return response.json()

    def ask_ai(self, question, birth_details=None):
        """Ask the AI astrologer a question (requires an API key)"""
        payload = {"question": question}
        if birth_details:
            payload["birthDetails"] = birth_details

        response = requests.post(
            f"{BASE_URL}/api/v1/astrology/query",
            json=payload,
            headers=self._headers()
        )
        return response.json()

# Usage
api = VedikaAPI()  # Sandbox mode (no API key)

# Get horoscope
horoscope = api.get_horoscope("leo")
print(horoscope["data"]["prediction"])

# Ask AI (requires API key)
api = VedikaAPI(api_key="YOUR_API_KEY")
answer = api.ask_ai(
    "What does Mercury retrograde mean for my career?",
    {"datetime": "1990-01-15T14:30:00", "latitude": 19.076, "longitude": 72.877, "timezone": "+05:30"}
)
print(answer["response"])