/v1/panchang/moonrise-moonset
Moonrise and moonset JD.
What this tells you
Moonrise can occur at any time — morning, afternoon, evening, or night — depending on the Moon's phase. Unlike the sun, the moon can also skip rising or setting on a given day (circumpolar behavior or simple timing).
Request
All requests require an Authorization header with your dv_live_* API key.
curl "https://api.divyastroapi.com/v1/panchang/moonrise-moonset?date=2026-04-19&time=06%3A30&tz=%2B05%3A30&lat=28.61&lon=77.21" \
-H "Authorization: Bearer dv_live_0123456789abcdef0123456789abcdef"Response (200 OK)
Successful requests return a JSON body. Field names are stable across versions.
{
"moonrise": {
"jd": 2461137.432,
"local": "2026-04-19T11:47:05+05:30"
},
"moonset": {
"jd": 2461137.902,
"local": "2026-04-19T23:18:50+05:30"
},
"moon_phase": "waxing_gibbous",
"illumination_percent": 62.3
}Field reference
Every field in the response, with its type, a real example, and what it means.
| Field | Type | Meaning |
|---|---|---|
| moonrise.jd | number | null | Julian Day of moonrise. Null if Moon doesn't rise on this date at this location. example: 2461137.432 |
| moonrise.local | string | null | Local time. example: "2026-04-19T11:47:05+05:30" |
| moonset.* | object | null | Same shape. Null on days the Moon doesn't set. example: … |
| moon_phase | string | One of: new_moon, waxing_crescent, first_quarter, waxing_gibbous, full_moon, waning_gibbous, last_quarter, waning_crescent. example: "waxing_gibbous" |
| illumination_percent | number (0–100) | Percentage of Moon's disc illuminated. example: 62.3 |
Usage tips
How to use it
- Handle null gracefullyOn days the Moon doesn't rise/set, `jd` and `local` are both null. Show "Moon does not rise today" in UI.
- Moon phase drives visualsThe `moon_phase` string maps directly to a lunar phase icon. Keep a local icon set keyed by these 8 names.
Errors
Every error follows the same envelope. Use the error.code field (not the message) for conditional logic in your integration.
401 Unauthorized
{
"error": {
"code": "unauthorized",
"message": "missing or invalid API key",
"request_id": "req_01hqy7k8c3e7m1n"
}
}402 Payment Required
{
"error": {
"code": "trial_exhausted",
"message": "your free trial credits are exhausted — pick a plan to continue",
"top_up_url": "https://divyastroapi.com/pricing",
"request_id": "req_01hqy7k8c3e7m1n"
}
}429 Too Many Requests
{
"error": {
"code": "rate_limited",
"message": "rate limit exceeded; retry after 12 seconds",
"request_id": "req_01hqy7k8c3e7m1n"
}
}Try it
Get a dv_live_* key from your dashboard and paste into the cURL snippet above. New accounts get 500 free credits. Sign up.