Skip to content
96Astro API

Documentation

API reference

Every endpoint with its parameters, credit cost, example requests in seven languages, a real example response and the errors it can return. Generated from the calculation engine, so nothing here is a promise without a route behind it.
  • 906 capabilities
  • 27 families
  • POST JSON body
  • Bearer key

Browse

By family

Introduction

906 capabilities in 27 families (911 API routes in all: one for each capability, plus the PDF and audio job routes and the file and image downloads), generated from the calculation engine. 906 are callable on /v1 today. Every endpoint is POST https://api.96astroapi.com/v1/{family}/{capability} with a JSON body (Content-Type: application/json) and answers JSON: data holds the result and meta the request id, credits used and warnings.

Each endpoint below shows its credit cost, headers, every body field (type, required, default, allowed values, limits and an example), an example request in cURL, JavaScript, Python, PHP, Go and both SDKs, a captured example response and the errors it can return. Send the local date and time with an IANA time zone, and places in decimal degrees (see requests and responses).

OpenAPI 3.1 specification

Every endpoint callable today, with its request schema, an example request, an example response, error responses and credit cost (x-credits), in one file for code generators, Postman and API clients. Download the OpenAPI document or fetch it live from https://api.96astroapi.com/v1/openapi.json (no key needed). Each example response was captured from the live engine with a sandbox key and trimmed for size; AI reading examples are written by hand and marked illustrative. The schema of data says where it comes from in x-schema-source: authored is the hand-written contract of a main endpoint; sampled is measured from several real answers to different inputs (x-schema-samples says how many), so a required field was in every one and a field may be null only where one of them was; example, used only where neither exists, is inferred from the one example and is a guide to the shape, not a contract.

Base URL
https://api.96astroapi.com/v1
Every successful response
{
  "data": {},
  "meta": {
    "request_id": "req_6e985a89a166b73ea220",
    "api_version": "v1",
    "credits_used": 3,
    "warnings": [],
    "language": "en"
  }
}

Authentication

Every request is authenticated with an API key sent in a header. Keys are never accepted in the URL, so they cannot leak into server logs, proxies or browser history.

Authorization: Bearer sk_live_...

X-API-Key: sk_live_... is accepted as an alternative for clients that cannot set Authorization.

PrefixEnvironmentChargedUse it for
sk_test_SandboxNoDevelopment and CI: real calculations, up to 500 calls a day
sk_live_LiveYesProduction traffic

A key works only in its own environment. Call the API from your backend: a key inside a mobile app, a single-page app or a theme can be extracted by anyone. Send an Idempotency-Key header with every request so a retry is never charged twice (idempotency).

Read the full guide →

Your first request

Replace YOUR_API_KEY with a sandbox key (sk_test_) to try it free.

Errors

Errors use standard HTTP status codes and one JSON shape. field names the input at fault, or is null when no single field is. Retry only when retryable is true, with exponential backoff and the same idempotency key. You are never charged for an error.

StatusCodesMeaning
400invalid_requestThe request could not be read: invalid JSON, a key in the URL, or a bad Idempotency-Key.
401invalid_key, expired_keyThe API key is missing, invalid, revoked or expired.
402payment_requiredThe plan's payment is overdue past its grace period: live calls stop until it is paid.
403account_suspended, plan_upgrade_required, plan_family_not_included, key_scope_denied, ip_not_allowed, origin_not_allowed, publishable_key_not_allowedThe account is not active, the Free plan does not include this (AI readings, and PDF and audio jobs on live keys), or the key's restrictions refuse the call: key_scope_denied (outside the key's scopes), ip_not_allowed (not from the key's IP allow-list), origin_not_allowed (a publishable key from an origin it does not allow), publishable_key_not_allowed (a publishable key on an endpoint for secret keys only).
404not_foundThere is no such capability, job or file.
409idempotency_conflictThe Idempotency-Key was reused with a different body, is still in progress, or expired.
410link_expired, file_expiredThe download link or the file has expired.
413payload_too_largeThe request body is larger than 1 MiB.
422invalid_request, unsupported_languageThe input failed validation.
429rate_limited, quota_exhausted, spend_cap_reached, project_budget_exceededRate limit reached (retry after Retry-After), credits/quota exhausted, the opt-in overage's monthly spend cap reached (spend_cap_reached: raise the cap or top up; retrying will not help), or the key's project has used its monthly credit budget (project_budget_exceeded: raise the budget or wait for next month; retrying will not help).
500computation_failedThe calculation failed on our side.
502unavailableThe calculation service returned an unusable answer.
503unavailable, maintenance, temporarily_unavailableThe calculation service is temporarily unavailable (unavailable), the API or the capability's family is in announced maintenance (maintenance: Retry-After and error.maintenance.ends_at say when it ends), or the capability has been switched off for now (temporarily_unavailable: try again later).
504deadline_exceededThe calculation took too long.

Read the full guide →

422 · error envelope
{
  "error": {
    "code": "invalid_request",
    "message": "Input should be less than or equal to 90",
    "field": "latitude",
    "request_id": "req_6e985a89a166b73ea220",
    "retryable": false
  }
}

Program against code, which is stable; message is for people and may change.

Rate limits & credits

Each successful call uses credits from your plan; the cost of every endpoint is shown on it and returned in meta.credits_used. Errors are never charged, and sandbox keys never use credits.

Compute classCredits per call
Light and standard1
Heavy3
Reports10
AI readingsMetered from the same credits: typically 60-170 (fast), 250-750 (balanced) or 1,500-4,000 (deep)
PDF of a report (POST /v1/jobs/pdf)The report's 10, plus 120

Each plan has a rate limit in units per second, shared by every key of your organization (live and sandbox are counted apart). A call counts units by its compute class:

CallUnits
Light and standard1
Heavy3
Reports10
AI readings10, on top of their per-key limit below
PDF of a report (POST /v1/jobs/pdf)10, the report's; the render itself is queued
Polling a job (GET /v1/jobs/{id})1

When credits run out the API answers 429 quota_exhausted, never a silent failure or a surprise bill: top up, upgrade, wait for renewal or turn on capped overage. Sandbox keys allow 500 calls a day per organization.

Read the full guide →

Rate-limit headers (every response)
RateLimit-Limit: 10
RateLimit-Remaining: 7
RateLimit-Reset: 1

Over the limit: 429 rate_limited with Retry-After, the seconds until the call would fit.

Languages & labels

language asks for the output language (ISO 639-1). Each endpoint lists the values it supports in its language field; today the AI readings, and most calculations and reports, answer in 26 languages (English included); the rest answer in English. Any other value is refused with 422 unsupported_language, whose supported lists what the endpoint takes. Field names, IDs, enum values and numbers never change with language.

labels adds display names without changing the answer: data stays exactly as in English and meta.labels.terms maps each sign, planet, nakshatra and other term in data to its name in that language. Show terms[value] ?? value. Labels are free. Accepted codes:

as bn de es fr gu hi it ja kn ko ml mr ne nl or pa pl pt ru si ta te tr ur

Read the full guide →

Request with "labels": "hi"
{
  "datetime": "1990-10-18T14:30:00",
  "timezone": "Asia/Kolkata",
  "latitude": 28.6139,
  "longitude": 77.209,
  "labels": "hi"
}
meta.labels in the response
{
  "labels": {
    "language": "hi",
    "quality": "curated",
    "terms": {
      "Aries": "मेष",
      "Sun": "सूर्य"
    }
  }
}

SDKs & Postman

Official clients for TypeScript/JavaScript (@96astro/api) and Python (astro96-api, import astro96_api) are generated from the OpenAPI document, with retries, idempotency keys, typed errors and PDF and audio job helpers built in (createPdfJob, createAudioJob, getJob, downloadFile; snake_case in Python). Methods follow the URL: POST /v1/{family}/{capability} is client.family.capability(), camelCase in TypeScript and snake_case in Python. Install them from npm (@96astro/api), PyPI (astro96-api) or Packagist (96astro/api, for PHP and Laravel).

The Postman collection has every request grouped by family with the documented example body and a saved example response. Import it with an environment (Sandbox or Live), select the environment and paste your key into api_key: the files carry no key. Every request sends Authorization: Bearer {{api_key}} and a fresh Idempotency-Key. Or open the collection directly: Run in Postman.

Read the full guide →

Install
npm install @96astro/api
pip install astro96-api
composer require 96astro/api
Method names
POST /v1/vedic-charts/planet-positions

astro.vedicCharts.planetPositions(input)    // @96astro/api
astro.vedic_charts.planet_positions(input)  # astro96_api

Send us feedback

What is it about?