/api/astro/eclipse/local/1 creditLocal eclipse visibility
The next eclipse VISIBLE from one place, with its local circumstances. A global search answers when an eclipse happens; this answers whether it happens for you. The 2026-08-12 total solar eclipse is total over Spain and simply invisible from India, and this endpoint reflects that — asked from Jaipur it skips straight past it to the next one that is actually visible there. Returns the four contact times as seen from your coordinates, how much of the disc is covered (obscuration is area, magnitude is diameter — at 50% magnitude only about 39% of the disc is hidden), how high the body sits above the horizon, and the Saros series and member number, which is the identifier eclipse catalogues cross-reference on.
https://yogataraapi.prahlad.app/api/astro/eclipse/local/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. |
| latitude | number (double) | required | 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. min -89.9 · max 89.9 |
| longitude | number (double) | required | 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. min -180 · max 180 |
| 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 |
| 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/local/ \
-H "X-API-Key: $OCCULT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date_time":"2026-08-01T00:00:00+00:00","timezone_as_float":0,"latitude":40.4168,"longitude":-3.7038,"kind":"solar","direction":"after"}'Response
{
"data": {
"place": {
"latitude": 40.4168,
"longitude": -3.7038,
"elevation": 0
},
"searched_from": "2026-08-01T00:00:00Z",
"direction": "after",
"solar": {
"visible": true,
"type": "partial",
"maximum": "2026-08-12T18:32:22Z",
"times": {
"maximum": "2026-08-12T18:32:22Z",
"first_contact": "2026-08-12T17:36:44Z",
"fourth_contact": "2026-08-12T19:24:29Z"
},
"attributes": {
"solar_diameter_fraction_covered": 0.9993884035708482,
"lunar_to_solar_diameter_ratio": 1.0336605969236166,
"obscuration": 0.9998599813549118,
"core_shadow_diameter_km": -106.09485636578704,
"sun_azimuth": 103.3259413871358,
"sun_true_altitude": 7.192441834680457,
"sun_apparent_altitude": 7.311576116079273,
"moon_elongation": 0.009177024527760248,
"magnitude_nasa": 0.9993884035708482,
"saros_series": 126,
"saros_member": 48
},
"saros": {
"series": 126,
"member": 48
}
}
},
"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.