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
- Create a free account and generate a key on the API Keys page.
- Store the key in your server environment as
COSMICEPHEMERIS_KEY. The key is shown only once. - Send a JSON
POSTrequest tohttps://api.cosmicephemeris.com/api/astro/birth-chartwithAuthorization: Bearerauthentication. - Read the returned
chartobject. Setzodiac: "sidereal"andayanamsa: "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
- π Astrology Systems
Tropical defaults, sidereal opt-in behavior, and calculation boundaries.
- π Authentication
API-key authentication for programmatic access.
- π§° Developer Platform
Projects, environment budgets, saved charts, teams, jobs, signed webhooks, exports, and MCP.
- π Place, Timezone & Context
Search versioned places, resolve historical civil time, and build deterministic model-ready fact bundles.
- π Birth Chart API
Generate natal charts with planets, supported houses, and angles.
- πͺ Transits API
Compare a natal chart with a requested transit instant.
- β¨ Aspects API
Calculate documented angular relationships.
- ποΈ Planetary Events API
Search bounded intervals for ingresses, stations, and exact major aspects.
- π House Ingress API
Search transit crossings of fixed Equal or Whole Sign reference-chart cusps.
- π MCP Server
Connect trusted agent hosts to all 78 live calculations with scoped server-side API keys.
- π§ͺ Electional Reliability Research
Explore the source-complete, not-yet-deployed hardening and minimax-regret audit.
- π Houses API
Equal and whole-sign house calculations.
- π Synastry API
Compare two charts without compatibility scoring.
- π Sidereal Astrology
Explicit sidereal coordinates and supported ayanamsas.
- π°οΈ Nakshatra Timeline
Pro timeline calculations for supported sidereal bodies.
- Structured Horoscope (Beta)
Deterministic transit signals and summary fields, with a separately labeled beta contract.
- Aspect Windows API
Calculate exact-hit-anchored orb windows, repeats, and optional iCalendar text.
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.
| Path | Where to read the result |
|---|---|
/api/astro/birth-chart | chart |
/api/astro/aspects | The aspect array is aspects.aspects; its parent contains the full chart. |
/api/astro/houses | houses.systems, with normalized house_system at the top level. |
/api/astro/transits | transits.natal_chart, transits.transit_chart, and transits.aspects |
/api/astro/synastry | charts.personA, charts.personB, and aspects |
/api/astro/nakshatra-timeline | Top-level segments and timeline metadata; Pro required. |
/api/astro/horoscope | interpretation; beta. |
/api/astro/natal-svg | svg as a string inside JSON; beta. |
/api/astro/vargas | ascendant and bodies; twenty-four supported divisions from D1 through D150, with named conventions and D150 method selection; beta. |
/api/astro/vimshottari | birth_balance, cycle, and periods; optional third/fourth levels with depth: 3/4; beta. |
/api/astro/davison | midpoint, physical planets, angles, houses and aspects; uncorrected TT/arithmetic beta. |
/api/astro/composite | planets, angles, synthetic houses and aspects; beta. |
/api/astro/panchang | tithi, nakshatra, yoga, karana, vara and solar_events; beta, latitude [-88,88]. |
/api/astro/ashtakoota | Eight directional koota component scores and total out of 36 without a threshold verdict or interpretation; beta. |
/api/astro/ashtakavarga | Seven-planet Bhinnashtakavarga, contributor Prastara, 337-point Sarvashtakavarga, and explicit opt-in reductions/pindas without interpretation; beta. |
/api/astro/numerology | Declared Pythagorean date/name arithmetic with reduction traces and explicit calendar-year cycles; symbolic beta, no interpretations or predictions. |
/api/astro/secondary-progressions | progressed_planets, timing and separate natal_context; beta, no progressed angles/houses. |
/api/astro/varga-svg | svg and chart (Vargas result), with optional deterministic PNG; North/South Indian layouts for all twenty-four supported divisions; beta. |
/api/astro/lunar-nodes | Separate mean and geometric osculating true north/south node pairs with explicit frames; beta. |
/api/astro/solar-arcs | True solar-arc directed planets and angles, synthetic Equal/Whole Sign houses and explicit timing; beta. |
/api/astro/returns | Next Sun/Moon longitude return, return_utc, chart and bounded search metadata; beta. |
/api/astro/moon-phases | Instant phase geometry or a bounded primary-phase calendar in result, with explicit model metadata; beta. |
/api/astro/planetary-events | Bounded sign ingresses, tropical stations, and exact major-aspect crossings in result.events; beta. |
/api/astro/house-ingresses | Direct/retrograde transit crossings of fixed Equal or Whole Sign reference-chart cusps; beta. |
/api/astro/aspect-windows | Exact-hit-anchored orb intervals, applying/separating labels, repeats and optional iCalendar text in result; beta. |
/api/astro/event-calendar | Unified Moon, ingress, station, exact-aspect and aspect-window events, plus optional grouped aspect passes and iCalendar; beta. |
/api/astro/event-rule-search | Bounded customer-defined AND/OR fact rules with validation, cost estimates, matching intervals, saved versions, schedules, and calendar output; beta. |
/api/astro/convention-compare | Field-level comparison of two explicit zodiac, ayanamsa, and house-system profiles for the same birth input; beta. |
/api/astro/chart-robustness | Sampled 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-audit | Never-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-readiness | Machine-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-readiness | Fixed 25-system geometry readiness, cusp fingerprints, downstream route readiness, and explicit no-fallback evidence; live beta. |
/api/astro/house-placement-stability | Unweighted planet-house agreement across comparable systems, deterministic placement groups, and explicit no-fallback evidence; live beta. |
/api/astro/aspect-policy-stability | Compare 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-proximity | Exact 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-audit | Nine-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-scan | Center 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-envelope | Full-factorial seven-time by nine-location sampled evidence separating time-axis, location-axis, combined, and interaction-only observed variation; live beta. |
/api/astro/synastry-svg | Original deterministic double-wheel SVG in JSON, with optional deterministic PNG; beta. |
/api/astro/transit-svg | Original deterministic natal/transit double-wheel SVG in JSON, with optional deterministic PNG; beta. |
/api/astro/natal-report | Standalone calculation-fact HTML, source-linked facts, and optional integrity-checked download bytes; no interpretation; beta. |
/api/astro/birth-time-sensitivity | Observed sensitivity for exact intervals or explicit unknown/approximate birth time; beta, non-exhaustive, never rectification. |
/api/astro/fixed-stars | Six independently validated fixed stars only; no minor bodies; beta. |
/api/astro/relocation-chart | Same birth instant and geocentric positions with destination angles and selected houses; beta. |
/api/astro/astrocartography | Bounded MC/IC and sampled rising/setting geometry; no maps, rankings, or interpretations; beta. |
/api/astro/eclipse-geometry | Bounded global solar/lunar eclipse geometry with optional observer snapshot at global maximum; no local contacts or paths; beta. |
/api/astro/electional-search | AND-only electional filters on a fixed hourly grid; no ranking, continuous guarantee, or advice; beta. |
/api/astro/natal-analysis | Configured aspects, midpoint axes, geometric patterns, and strict opt-in sidereal Parashari graha drishti; no interpretation; beta. |
/api/astro/planetary-hours | Twenty-four unequal sunrise-based day/night temporal hours and Chaldean rulers; no advice; beta. |
/api/astro/place-search | Deterministic self-hosted GeoNames place candidates with versioned IDs and attribution; beta. |
/api/astro/timezone-resolve | Pinned historical IANA civil-time resolution with explicit unique, ambiguous, or nonexistent status; beta. |
/api/astro/natal-context | Deterministic 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/KolkataorAmerica/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-01and2050-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
ayanamsais 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. RespectRetry-Afterwhen present; a monthly quota limit requires the next reset or a plan change.502,503, or504: dependency failure, temporary busy/maintenance state, or timeout. Use bounded retries with backoff, respectingRetry-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"])