Astrology API Documentation

R231 is live: 77 standard calculations plus the Pro Nakshatra Timeline are available, with the 500-request Free allowance and globally serial durable jobs.

Build Western, sidereal, and Vedic-oriented astrology applications with documented JPL DE421 calculation endpoints and structured JSON responses. Routes with a zodiac option default to tropical; request sidereal mode with Lahiri, Raman, Krishnamurti, Fagan–Bradley, Yukteshwar, Sassanian, True Chitra, True Revati, True Pushya, Galactic Center at 0 Sagittarius, or Galactic Alignment/Mardyks ayanamsa.

Planetary positions are calculated using bundled NASA JPL DE421 ephemeris data through Skyfield. Our calculation methodology explains the methods for houses, aspects, sidereal conversion, and other calculations, including their known limits. The Vedic beta routes and nakshatra timeline always use sidereal coordinates; each endpoint documents its exact scope.

Cosmic Ephemeris is a developer-first, server-to-server JSON API. It returns documented calculation data so your application can control interpretation and presentation.

Make your first request

  1. Create a free account and generate a key on the API Keys page.
  2. Store the key in your server environment as COSMICEPHEMERIS_KEY. The key is shown only once.
  3. Send a JSON POST request to https://api.cosmicephemeris.com/api/astro/birth-chart with Authorization: Bearer authentication.
  4. Read the returned chart object. Set zodiac: "sidereal" and ayanamsa: "lahiri" to request a sidereal chart.

Use the code example alongside this guide on your server. Never put the key in browser JavaScript or a mobile application bundle.

Documentation

Developer downloads

Two optional tools to help you integrate Cosmic Ephemeris. Both cover the seventy-eight live endpoints below, including seventy-one beta additions. They describe how to call the API; they do not contain the calculation engine or introduce a new API version.

OpenAPI JSON β€” the API reference for your tools

A machine-readable description of the endpoints, authentication, accepted inputs, and response formats. Import it into compatible API tools to explore the contract and help build your integration. Download the OpenAPI JSON document.

Postman collection β€” ready-to-send example requests

Import the collection into Postman, set COSMICEPHEMERIS_KEY in a private, unsynced environment or supported secret store, and send example requests without first writing application code. Download the Postman collection.

Downloading or importing these files does not use your quota. Sending calculation requests does: attempts admitted for processing consume quota even if validation or calculation later fails. Never save your real API key in a shared collection or exported file, and do not configure automatic retries.

Endpoint and response reference

All endpoints below use POST and the same server API key. Their JSON response wrappers differ; use the documented field for each endpoint.

PathWhere to read the result
/api/astro/birth-chartchart
/api/astro/aspectsThe aspect array is aspects.aspects; its parent contains the full chart.
/api/astro/houseshouses.systems, with normalized house_system at the top level.
/api/astro/transitstransits.natal_chart, transits.transit_chart, and transits.aspects
/api/astro/synastrycharts.personA, charts.personB, and aspects
/api/astro/nakshatra-timelineTop-level segments and timeline metadata; Pro required.
/api/astro/horoscopeinterpretation; beta.
/api/astro/natal-svgsvg as a string inside JSON; beta.
/api/astro/vargasascendant and bodies; twenty-four supported divisions from D1 through D150, with named conventions and D150 method selection; beta.
/api/astro/vimshottaribirth_balance, cycle, and periods; optional third/fourth levels with depth: 3/4; beta.
/api/astro/davisonmidpoint, physical planets, angles, houses and aspects; uncorrected TT/arithmetic beta.
/api/astro/compositeplanets, angles, synthetic houses and aspects; beta.
/api/astro/panchangtithi, nakshatra, yoga, karana, vara and solar_events; beta, latitude [-88,88].
/api/astro/ashtakootaEight directional koota component scores and total out of 36 without a threshold verdict or interpretation; beta.
/api/astro/ashtakavargaSeven-planet Bhinnashtakavarga, contributor Prastara, 337-point Sarvashtakavarga, and explicit opt-in reductions/pindas without interpretation; beta.
/api/astro/numerologyDeclared Pythagorean date/name arithmetic with reduction traces and explicit calendar-year cycles; symbolic beta, no interpretations or predictions.
/api/astro/secondary-progressionsprogressed_planets, timing and separate natal_context; beta, no progressed angles/houses.
/api/astro/varga-svgsvg and chart (Vargas result), with optional deterministic PNG; North/South Indian layouts for all twenty-four supported divisions; beta.
/api/astro/lunar-nodesSeparate mean and geometric osculating true north/south node pairs with explicit frames; beta.
/api/astro/solar-arcsTrue solar-arc directed planets and angles, synthetic Equal/Whole Sign houses and explicit timing; beta.
/api/astro/returnsNext Sun/Moon longitude return, return_utc, chart and bounded search metadata; beta.
/api/astro/moon-phasesInstant phase geometry or a bounded primary-phase calendar in result, with explicit model metadata; beta.
/api/astro/planetary-eventsBounded sign ingresses, tropical stations, and exact major-aspect crossings in result.events; beta.
/api/astro/house-ingressesDirect/retrograde transit crossings of fixed Equal or Whole Sign reference-chart cusps; beta.
/api/astro/aspect-windowsExact-hit-anchored orb intervals, applying/separating labels, repeats and optional iCalendar text in result; beta.
/api/astro/event-calendarUnified Moon, ingress, station, exact-aspect and aspect-window events, plus optional grouped aspect passes and iCalendar; beta.
/api/astro/event-rule-searchBounded customer-defined AND/OR fact rules with validation, cost estimates, matching intervals, saved versions, schedules, and calendar output; beta.
/api/astro/convention-compareField-level comparison of two explicit zodiac, ayanamsa, and house-system profiles for the same birth input; beta.
/api/astro/chart-robustnessSampled stability classifications across unknown or approximate birth time and two or three explicit convention profiles; beta, non-exhaustive, never rectification or convention ranking.
/api/astro/civil-time-auditNever-guess local-time resolution: both repeated-time chart candidates with exact 22-fact differences, or no chart for a nonexistent time; beta.
/api/astro/chart-input-readinessMachine-readable exact-route readiness and resolved, candidate, or sampled evidence for exact, ambiguous, nonexistent, approximate, or unknown birth time; beta, never rectification.
/api/astro/house-system-readinessFixed 25-system geometry readiness, cusp fingerprints, downstream route readiness, and explicit no-fallback evidence; live beta.
/api/astro/house-placement-stabilityUnweighted planet-house agreement across comparable systems, deterministic placement groups, and explicit no-fallback evidence; live beta.
/api/astro/aspect-policy-stabilityCompare 2–4 explicit aspect-orb policies on one chart with reason states, signed margins, set fingerprints, and deterministic equivalence groups; live beta.
/api/astro/house-boundary-proximityExact two-sided cusp clearance and normalized position for selected planets across every available 12-house system, with explicit failures and no fallback; live beta.
/api/astro/location-precision-auditNine-point coordinate-radius audit for one explicit 12-house system, with house stability, angle/cusp displacement, explicit failures, and no fallback; live beta.
/api/astro/location-transition-scanCenter plus 64 fixed radial checkpoints for observed angle-sign, cusp-sign, and selected planet-house transition brackets, with explicit geometry failures and no full-disk guarantee; live beta.
/api/astro/chart-uncertainty-envelopeFull-factorial seven-time by nine-location sampled evidence separating time-axis, location-axis, combined, and interaction-only observed variation; live beta.
/api/astro/synastry-svgOriginal deterministic double-wheel SVG in JSON, with optional deterministic PNG; beta.
/api/astro/transit-svgOriginal deterministic natal/transit double-wheel SVG in JSON, with optional deterministic PNG; beta.
/api/astro/natal-reportStandalone calculation-fact HTML, source-linked facts, and optional integrity-checked download bytes; no interpretation; beta.
/api/astro/birth-time-sensitivityObserved sensitivity for exact intervals or explicit unknown/approximate birth time; beta, non-exhaustive, never rectification.
/api/astro/fixed-starsSix independently validated fixed stars only; no minor bodies; beta.
/api/astro/relocation-chartSame birth instant and geocentric positions with destination angles and selected houses; beta.
/api/astro/astrocartographyBounded MC/IC and sampled rising/setting geometry; no maps, rankings, or interpretations; beta.
/api/astro/eclipse-geometryBounded global solar/lunar eclipse geometry with optional observer snapshot at global maximum; no local contacts or paths; beta.
/api/astro/electional-searchAND-only electional filters on a fixed hourly grid; no ranking, continuous guarantee, or advice; beta.
/api/astro/natal-analysisConfigured aspects, midpoint axes, geometric patterns, and strict opt-in sidereal Parashari graha drishti; no interpretation; beta.
/api/astro/planetary-hoursTwenty-four unequal sunrise-based day/night temporal hours and Chaldean rulers; no advice; beta.
/api/astro/place-searchDeterministic self-hosted GeoNames place candidates with versioned IDs and attribution; beta.
/api/astro/timezone-resolvePinned historical IANA civil-time resolution with explicit unique, ambiguous, or nonexistent status; beta.
/api/astro/natal-contextDeterministic fact IDs, source paths, fingerprints, and JSON/XML/Markdown artifacts without generated interpretation; beta.

Choose your calculation settings

Western astrology uses the tropical default. Vedic-oriented applications can use sidereal charts and Moon nakshatra/pada data, plus beta D1/D2/D3/D4/D5/D6/D7/D8/D9/D10/D11/D12/D16/D20/D24/D27/D30/D40/D45/D60/D81/D108/D144/D150, Vimshottari through optional depth 4, Indian chart SVG and instant Panchang APIs. Regional calendars, festivals and complete Jyotish analysis are not implemented. Equal and whole-sign houses, plus opt-in beta Placidus, support both zodiacs.

  • Supply an IANA timezone, such as Asia/Kolkata or America/New_York, when the date and time are local. Omission means UTC. Ambiguous or nonexistent local clock-change times return HTTP 400; send the known UTC instant instead.
  • Public dates must fall between 1900-01-01 and 2050-12-31, inclusive.
  • Chart latitude must be strictly between βˆ’90 and 90; longitude ranges from βˆ’180 to 180, inclusive. Exact poles and undefined Ascendant geometry return HTTP 400. The Panchang beta has the narrower latitude limit [-88,88]. Supply coordinates directly or use the separate place-search and historical-timezone onboarding workflow; calculation routes never overwrite explicit inputs.
  • Legacy chart routes, natal SVG, composite, secondary-progressed planets, solar arcs, lunar nodes, returns and planetary events default to tropical; sidereal mode defaults to Lahiri when ayanamsa is omitted. Planetary-event stations retain tropical motion timing even when reported longitudes are sidereal. Vargas, Vimshottari, Panchang and Indian varga SVG are always sidereal with Lahiri default. The timeline is always sidereal and requires an explicit ayanamsa.

Review the calculation methodology for house models, mean lunar nodes, aspect orbs, and the ephemeris.

Quotas, errors, and retries

Free includes 500 standard requests per UTC calendar month; Developer (the API's basic plan) includes 10,000; Pro includes 100,000 plus 1,000 separate timeline units. Quotas reset at the UTC month boundary, independently of the subscription renewal date. See plans and pricing.

A request consumes a unit once it passes authentication, admission, and plan/quota checks and reserves usage. Later validation failures, engine errors, or timeouts still consume that unit. Limit your account to two simultaneous calculation requests and validate inputs before sending them.

  • 400: correct the input; 401: check the key; 402: the timeline requires Pro.
  • 429: quota, concurrency, or edge rate limit. Respect Retry-After when present; a monthly quota limit requires the next reset or a plan change.
  • 502, 503, or 504: dependency failure, temporary busy/maintenance state, or timeout. Use bounded retries with backoff, respecting Retry-After; each retry can consume another unit.
  • Check the HTTP status before parsing a successful response. Proxy errors are not guaranteed to be JSON.

Integration guides

// Node.js 22+ β€” server-side only
const response = await fetch("https://api.cosmicephemeris.com/api/astro/birth-chart", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.COSMICEPHEMERIS_KEY}`
  },
  signal: AbortSignal.timeout(20000),
  body: JSON.stringify({
    date: "2000-01-01",
    time: "12:00",
    timezone: "UTC",
    lat: 0.0,
    lon: 0.0
  })
});
if (!response.ok) throw new Error(`Cosmic Ephemeris HTTP ${response.status}`);
const data = await response.json();
console.log(data.chart);
# Python β€” server-side only
import os
import requests

url = "https://api.cosmicephemeris.com/api/astro/birth-chart"
payload = {
    "date": "2000-01-01",
    "time": "12:00",
    "timezone": "UTC",
    "lat": 0.0,
    "lon": 0.0
}
headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {os.environ['COSMICEPHEMERIS_KEY']}"
}

response = requests.post(url, json=payload, headers=headers, timeout=20)
response.raise_for_status()
print(response.json()["chart"])