Skip to content
Astratva
Search
Colour mode: Light Colour mode: Dark Colour mode: System
English, Language
Sign in
Menu

Developers

The Astratva API

Panchang, horoscope, transits, birth charts and compatibility over HTTP. It is the same engine, the same ayanamsha and the same caches as the website, so an answer from the API matches what a visitor sees on screen.

Who it is for

App makers who need a Panchang or a chart without running an ephemeris, temple and community sites that show the day's tithi and nakshatra, and astrologers who build their own tools. You pay for a plan, create keys, watch your usage and can receive signed webhook events. There is no free API tier.

What you can call

Seven endpoints under https://astratva.com/api/v1. Each answer is JSON in one envelope, with the result under data.

  • Panchang GET /panchang, GET /panchang/month Tithi, nakshatra, yoga, karana, sunrise, sunset, moonrise, moonset and the day's auspicious and inauspicious periods for any place and date.
  • Horoscope GET /horoscope/{sign} The daily horoscope for a sign, by Gochara from the transits. Today and one day either side.
  • Transits GET /transits, GET /transits/calendar Where the nine grahas are at a moment, and the sign changes and station days in a window of up to 90 days.
  • Birth charts POST /charts Lagna, planets, houses, the Navamsa and the Vimshottari dasha from birth details. Birth data is used for the calculation and not stored.
  • Compatibility POST /compatibility Guna Milan and Ten Porutham for two people. Birth data is used for the calculation and not stored.

Your first call

Send your key as a bearer token. This asks for the Panchang of 12 November 2026 in Chennai.

curl "https://astratva.com/api/v1/panchang?date=2026-11-12&lat=13.0827&lon=80.2707&tz=Asia/Kolkata" \
  -H "Authorization: Bearer YOUR_API_KEY"

The POST endpoints (/charts and /compatibility) take a JSON body and an optional Idempotency-Key header. The API reference lists every parameter, with examples you can copy. You can also download the OpenAPI document or the Postman collection.

Every answer says how it was calculated

Each successful response carries meta.provenance: version identifiers for the calculation and its data, the ayanamsha, the house system and the node convention. Store it with the result if you need to explain a number later.

Review status in compatibility

The Guna Milan and Ten Porutham rule tables are reviewed: in the answer from POST /compatibility, each system's review_status is "reviewed". The draft_rules field is deprecated and always false; it stays for existing clients. The Porutham rule set ID in the answer, porutham.rule_set.id, is now porutham.tamil.south_indian (it was porutham.tamil.south_indian.draft). The former note and porutham_note fields are no longer sent.

Errors, retries and what is charged

  • One request is one unit of your monthly quota, even when it is served from cache.
  • Failed requests (4xx and 5xx) are not charged.
  • An error has success: false and an error.code such as VALIDATION_FAILED. For a 422, error.details.fields names each field and why it was refused.
  • A 429 means the per-minute rate (RATE_LIMIT_EXCEEDED) or the monthly quota (QUOTA_EXCEEDED) is used up. Only RATE_LIMIT_EXCEEDED carries Retry-After, the seconds to wait; a used-up quota comes back at the start of the next month.
  • X-RateLimit-Remaining and X-Quota-Remaining come with every success except a replay of an idempotent request, which carries X-Idempotent-Replay: true instead.

Idempotency-Key and retries

On a POST, an Idempotency-Key makes a retry safe: the same key with the same body replays the recorded result instead of calculating again. After a request is rejected (4xx), a client that retries with a corrected body needs a new Idempotency-Key, because the old key replays the recorded result, the rejection, for the same key. A request refused with 429 or 5xx is not recorded, so you can retry it with the same key. A changed body with an old key is answered 409 IDEMPOTENCY_CONFLICT.

Use it from an AI assistant

The same calculations are also tools for Claude, Cursor, VS Code and other MCP clients, on the same plan and keys. Connect an assistant over MCP.

Open the API reference See plans and prices Webhooks