Eclipses
GET
1 credit

/v1/eclipses/solar

Next solar eclipse with type + path.

What this tells you

Next upcoming solar eclipse, computed via Swiss Ephemeris. Includes global path and local visibility. Solar eclipses are traditionally considered inauspicious for starting new work — many Hindus observe a fast (upavasa) and avoid travel.

Request

All requests require an Authorization header with your dv_live_* API key.

example request
curl "https://api.divyastroapi.com/v1/eclipses/solar?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.

200 response
{
  "next": {
    "type": "total",
    "peak_jd": 2461358.5847,
    "peak_local": "2026-08-12T17:22:04+05:30",
    "magnitude": 1.039,
    "duration_minutes": 2.2,
    "path": {
      "start_lat": 61.4, "start_lon": -23.8,
      "end_lat":   38.2, "end_lon":  -0.1,
      "path_width_km": 293
    },
    "visibility_at_request_location": "partial",
    "obscuration_percent": 42.5
  }
}

Field reference

Every field in the response, with its type, a real example, and what it means.

FieldTypeMeaning
next.typestring
total / partial / annular / hybrid.
example: "total"
next.peak_jdnumber
Peak eclipse JD.
example: 2461358.5847
next.peak_localstring
Peak time at the request location.
example: "2026-08-12T17:22:04+05:30"
next.magnitudenumber
Fraction of Sun's diameter covered. >1 = total eclipse.
example: 1.039
next.duration_minutesnumber
Duration of totality (or annularity).
example: 2.2
next.pathobject
Central path coordinates — useful for mapping visualizations.
example:
next.visibility_at_request_locationstring
none / partial / total — for the lat/lon you passed.
example: "partial"
next.obscuration_percentnumber
How much of the Sun is obscured at your location at peak.
example: 42.5

Usage tips

How to use it

  • Add to calendar apps
    Pre-fetch next 5 eclipses and pre-populate user calendars.
  • Local obscuration matters
    A "total" eclipse that's invisible at your location is astronomically total but astrologically often weaker for you. Use `obscuration_percent`.

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.