Moon phase API
Give a moment; get the Moon's phase name and angle, illuminated fraction, age in days, lunation number, distance and angular diameter, the next principal phases and the next perigee and apogee. Add a place to the day route to also get moonrise and moonset in local time.
Get a free key Try it in the playground API reference
What you get
- Phase name and angle, illuminated fraction, waxing or waning, age, lunation number
- Distance in km and Earth radii, angular diameter
- Next new moon, first quarter, full moon and last quarter; next perigee and apogee
- Moonrise, transit and moonset for a place (day or rise-set routes)
Example
curl -X POST https://astro-agent.dev/v1/astronomy/moon -H 'Content-Type: application/json' \
-H "X-Credits-Token: $ASTRO_AGENTS_KEY" -d '{"datetime":"2026-12-24T20:00:00Z"}'
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/moon",
"result": {
"phase": {
"name": "full moon",
"phase_angle": 191.0345,
"illuminated_fraction": 0.99009,
"waxing": false,
"age_days": 15.7973,
"lunation": 1286
},
"distance": {
"km": 356875.0,
"earth_radii": 55.9529,
"angular_diameter_arcmin": 33.473
},
"next_perigee": "2027-01-21T21:54:35Z"
},
"meta": {
"result_sha256": "4b78be831030c902599a54299cd6a5a9a6416687baf005a9583ebc878bb9cfd9"
}
}
Routes and prices
| Route | Name | Price per call | What it returns |
|---|---|---|---|
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/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. |
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
The US Naval Observatory API gives the dates of the phases free and without a key, for 1700-2100. If the phase dates are all you need, use it.
Checked on the providers' own pages on 2026-11-20. Their terms may have changed since.
When Astro Agents fits
- You need the state of the Moon at a given moment, not only the dates of the phases
- Distance, perigee and apogee in the same answer
- Moon data alongside the Sun, planets and eclipses with one key