/api/astro/eclipse/range/1 creditEclipses in a date range
Every eclipse between two dates, with no gaps. For multi-year eclipse calendars and timelines. The window is capped at twenty years, which is roughly 140 eclipses — past that a single response stops being something a client can hold comfortably. Both kinds are returned in true chronological order unless you filter by kind.
https://yogataraapi.prahlad.app/api/astro/eclipse/range/Authentication
Send your key in the X-API-Key header. Keys are server-side credentials — never put one in browser JavaScript or a mobile app.
X-API-Key: yt_live_a1b2c3d4_…
Content-Type: application/jsonRequest fields
| Field | Type | Required | Notes |
|---|---|---|---|
| date_time | string (date-time) | required | The moment to calculate for, ISO 8601. ALWAYS include an offset or a trailing Z - a value with no zone is read as Asia/Kolkata (UTC+05:30), not UTC, and can return the previous day's result with a 200. '2026-09-01T06:00:00Z' and '2026-09-01 06:00:00' are different instants and give different answers. |
| end_date_time | string (date-time) | required | |
| direction | string | optional | Search forward from date_time, or backward. afterbefore |
| elevation | number (double) | optional | |
| keys | array | optional | Which calculations to return, as a list of names. See the key table for this endpoint; an unrecognised name rejects the whole request. One call costs one credit however many keys you ask for, so request everything you need at once rather than making several calls. |
| kind | string | optional | bothsolarlunar |
| latitude | number (double) | optional | Latitude of the place, in decimal degrees. Positive is north, negative is south. Example: 26.9124 for Jaipur, 40.7128 for New York. Minutes and seconds are not accepted - convert first. |
| longitude | number (double) | optional | Longitude of the place, in decimal degrees. Positive is east, negative is west. Example: 75.7873 for Jaipur, -74.0060 for New York. Note the sign: a missing minus puts New York in China. |
| timezone_as_float | number (double) | optional | UTC offset of the place, in hours, as a decimal. Example: 5.5 for India (UTC+05:30), -5 for New York in winter, 5.75 for Nepal. This is NOT validated against date_time - if the two disagree you get a successful response for the wrong moment, so derive both from the same source. Use the offset in force on that date, not today's: a summer birth in a country with daylight saving needs the summer offset. min -12 · max 14 |
Example request
curl -X POST https://yogataraapi.prahlad.app/api/astro/eclipse/range/ \
-H "X-API-Key: $OCCULT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date_time":"2026-01-01T00:00:00+00:00","end_date_time":"2027-12-31T23:59:59+00:00","timezone_as_float":0,"kind":"both"}'Response
{
"data": {
"from": "2026-01-01T00:00:00Z",
"to": "2027-12-31T23:59:59Z",
"kind": "both",
"count": 9,
"eclipses": [
{
"kind": "solar",
"type": "annular",
"centrality": "central",
"maximum": "2026-02-17T12:11:53Z",
"times": {
"maximum": "2026-02-17T12:11:53Z",
"local_apparent_noon": "2026-02-17T11:18:50Z",
"begin": "2026-02-17T09:56:47Z",
"end": "2026-02-17T14:27:40Z",
"totality_begin": "2026-02-17T11:43:04Z",
"totality_end": "2026-02-17T12:41:05Z",
"centre_line_begin": "2026-02-17T11:48:27Z",
"centre_line_end": "2026-02-17T12:35:44Z"
}
},
{
"kind": "lunar",
"type": "total",
"centrality": null,
"maximum": "2026-03-03T11:33:42Z",
"times": {
"maximum": "2026-03-03T11:33:42Z",
"partial_begin": "2026-03-03T09:50:06Z",
"partial_end": "2026-03-03T13:17:18Z",
"totality_begin": "2026-03-03T11:04:34Z",
"totality_end": "2026-03-03T12:02:51Z",
"penumbral_begin": "2026-03-03T08:44:25Z",
"penumbral_end": "2026-03-03T14:23:08Z"
}
},
{
"kind": "solar",
"type": "total",
"centrality": "central",
"maximum": "2026-08-12T17:45:57Z",
"times": {
"maximum": "2026-08-12T17:45:57Z",
"local_apparent_noon": "2026-08-12T17:03:51Z",
"begin": "2026-08-12T15:34:30Z",
"end": "2026-08-12T19:57:57Z",
"totality_begin": "2026-08-12T16:58:05Z",
"totality_end": "2026-08-12T18:34:00Z",
"centre_line_begin": "2026-08-12T17:00:06Z",
"centre_line_end": "2026-08-12T18:32:01Z"
}
},
{
"kind": "lunar",
"type": "partial",
"centrality": null,
"maximum": "2026-08-28T04:12:58Z",
"times": {
"maximum": "2026-08-28T04:12:58Z",
"partial_begin": "2026-08-28T02:33:53Z",
"partial_end": "2026-08-28T05:52:03Z",
"penumbral_begin": "2026-08-28T01:23:57Z",
"penumbral_end": "2026-08-28T07:01:50Z"
}
},
{
"kind": "solar",
"type": "annular",
"centrality": "central",
"maximum": "2027-02-06T15:59:40Z",
"times": {
"maximum": "2027-02-06T15:59:40Z",
"local_apparent_noon": "2027-02-06T15:44:31Z",
"begin": "2027-02-06T12:57:51Z",
"end": "2027-02-06T19:01:40Z",
"totality_begin": "2027-02-06T14:04:05Z",
"totality_end": "2027-02-06T17:55:27Z",
"centre_line_begin": "2027-02-06T14:07:14Z",
"centre_line_end": "2027-02-06T17:52:20Z"
}
},
{
"kind": "lunar",
"type": "penumbral",
"centrality": null,
"maximum": "2027-02-20T23:12:51Z",
"times": {
"maximum": "2027-02-20T23:12:51Z",
"penumbral_begin": "2027-02-20T21:12:23Z",
"penumbral_end": "2027-02-21T01:13:22Z"
}
},
{
"kind": "lunar",
"type": "penumbral",
"centrality": null,
"maximum": "2027-07-18T16:03:00Z",
"times": {
"maximum": "2027-07-18T16:03:00Z",
"penumbral_begin": "2027-07-18T15:57:14Z",
"penumbral_end": "2027-07-18T16:08:46Z"
}
},
{
"kind": "solar",
"type": "total",
"centrality": "central",
"maximum": "2027-08-02T10:06:39Z",
"times": {
"maximum": "2027-08-02T10:06:39Z",
"local_apparent_noon": "2027-08-02T10:01:00Z",
"begin": "2027-08-02T07:30:17Z",
"end": "2027-08-02T12:43:08Z",
"totality_begin": "2027-08-02T08:23:29Z",
"totality_end": "2027-08-02T11:49:56Z",
"centre_line_begin": "2027-08-02T08:25:07Z",
"centre_line_end": "2027-08-02T11:48:18Z"
}
},
{
"kind": "lunar",
"type": "penumbral",
"centrality": null,
"maximum": "2027-08-17T07:13:51Z",
"times": {
"maximum": "2027-08-17T07:13:51Z",
"penumbral_begin": "2027-08-17T05:24:31Z",
"penumbral_end": "2027-08-17T09:03:11Z"
}
}
]
},
"status": 200,
"is_error": false,
"message": "successful"
}Captured from a real call using the exact request above. Results sit under data.
Errors
Metering errors return { "error": "…", "message": "<code>", "is_error": true }. Show error to people and branch on message. See the error reference.