Astronomy API
Every common astronomy calculation behind one HTTPS POST: the times of the day, where the Sun, Moon and planets are, what happens in the sky and when. Computed from the NASA/JPL DE440 ephemeris for any date from 1800 to 2200; no language model, and every result carries a SHA-256 you can recompute.
Get a free key Try it in the playground API reference
What you get
- Rise, transit and set of the Sun, Moon and planets, with civil, nautical and astronomical twilight
- Moon phase, illumination, age, distance; altitude and azimuth of any body from a place
- Planet positions, observing windows for a night, conjunctions, oppositions, elongations
- Solar and lunar eclipses with local circumstances, seasons, time scales, coordinate conversion
Example
curl -X POST https://astro-agent.dev/v1/astronomy/day -H 'Content-Type: application/json' \
-H "X-Credits-Token: $ASTRO_AGENTS_KEY" -d '{"date":"2026-06-21","latitude":48.8566,"longitude":2.3522}'
A real answer to this request (excerpt). The same request always returns the same
result_sha256, which POST https://astro-agent.dev/v1/verify recomputes for free:
{
"endpoint": "astronomy/day",
"result": {
"sun": {
"sunrise": "2026-06-21T05:46:57+02:00",
"sunset": "2026-06-21T21:57:52+02:00",
"day_length_minutes": 970.9
},
"moon": {
"name": "first quarter",
"illuminated_fraction": 0.44962,
"age_days": 6.2957
},
"next_eclipse": {
"kind": "solar",
"eclipse_type": "total",
"utc": "2026-08-12T17:46:00Z",
"local": "2026-08-12T19:46:00+02:00",
"timestamp": 1786556760,
"note": "greatest eclipse, global; whether and how it is seen from this place: astronomy/eclipse-local"
}
},
"meta": {
"result_sha256": "6f694b02cc506cafaa56f1cf76209f40a82839612346292d674afb0c9ec8f191"
}
}
Routes and prices
| Route | Name | Price per call | What it returns |
|---|---|---|---|
POST /v1/astronomy/day | Astronomical summary of the day for a place | $0.02 | One call for a day at a place: sunrise, sunset, twilight, day length, golden and blue hour; the Moon's phase, illumination, rise and set; the planets observable that night; the next lunations, planetary stations and eclipse. |
POST /v1/astronomy/rise-set | Rise, set and twilight times for a place | $0.01 | Rise, transit and set of the Sun, Moon and planets for a place and local day, with civil, nautical and astronomical twilight, day length, golden hour and blue hour. |
POST /v1/astronomy/moon | Moon phase, illumination, distance and next phases | $0.01 | The Moon at a moment: phase name and angle, illuminated fraction, age, lunation number, distance and apparent size, the next new, first quarter, full and last quarter Moons, and the next perigee and apogee. |
POST /v1/astronomy/altaz | Altitude and azimuth of every body from a place | $0.01 | Where the Sun, Moon and planets are in the sky from a place at a moment: altitude, azimuth, compass point, topocentric right ascension and declination, distance, elongation, illumination and magnitude. |
POST /v1/astronomy/visibility | Observation windows for a night | $0.02 | When each planet and the Moon can be observed from a place during a night: windows above a minimum altitude while the sky is dark, with the best time, altitude, azimuth and magnitude. |
POST /v1/astronomy/positions | Planetary positions for any date (ephemeris) | $0.01 | Ecliptic longitude and latitude, daily speed, retrograde flag and distance of the Sun, the Moon, Mercury..Pluto and the lunar nodes, for any moment 1800-2200. |
POST /v1/astronomy/eclipse-local | Local circumstances of solar and lunar eclipses | $0.10 | For a place: every solar and lunar eclipse between two dates with its local circumstances: whether and how it is seen, contact times, magnitude, obscuration, duration and the Sun's or Moon's altitude. |
POST /v1/astronomy/events | Celestial event calendar (eclipses, stations, lunations) | $0.25 | Solar and lunar eclipses, planetary stations, lunations, separations, longitude crossings and declination events between two dates (1800-2200), to the minute. |
POST /v1/astronomy/phenomena | Planetary phenomena: oppositions, conjunctions, elongations | $0.10 | Every conjunction with the Sun (inferior / superior for Mercury and Venus), opposition, greatest elongation, conjunction between two planets, perihelion and aphelion between two dates, to the second. |
POST /v1/astronomy/seasons | Equinoxes, solstices, perihelion and day length over a year | $0.01 | The year's equinoxes and solstices and Earth's perihelion and aphelion to the second; optionally the Sun day by day: sunrise, sunset, day length, solar noon, declination and equation of time. |
POST /v1/astronomy/time | Julian day, sidereal time, Delta T and time scales | $0.01 | One moment in every astronomical time scale: UTC, unix time, Julian day (UTC, UT1, TT, TDB), MJD, Julian centuries, Delta T, TAI-UTC, UT1-UTC, Greenwich and local mean and apparent sidereal time. |
POST /v1/astronomy/convert | Coordinate conversion between sky frames | $0.01 | Convert one direction on the sky between equatorial (J2000 and of date), ecliptic (J2000 and of date), galactic and, with a moment and a place, horizontal coordinates. |
The same routes are MCP tools on https://astro-agent.dev/mcp.
Limits
- Dates from 1800 to 2200; range routes take up to a year per call.
- Without a key: 1 free call on the $0.01-0.02 routes, then HTTP 402 with a pay-per-call offer (USDC, x402).
- Free key (an email, no card): 10,000 calls a month, 30 a minute, personal, research and evaluation use only. Paid plans from $19 a month by card, for commercial use: see pricing.
- Past the quota, calls answer 429 until the 1st of the month: nothing is charged beyond the plan.
Alternatives
Free services cover single needs well: sunrise-sunset.org for the times of the day, the US Naval Observatory API for phases, seasons and rise/set (1700-2100), NASA/JPL Horizons for ephemerides. Astro Agents puts all of these behind one key and one response format, for 1800-2200.
Checked on the providers' own pages on 2026-11-20. Their terms may have changed since.
When Astro Agents fits
- You need several kinds of astronomical data and want one API, one key and one format
- You need results you can prove: the same request always returns the same result_sha256
- Your agent or app calls it over MCP, or pays per call without an account (x402)