Ephemerides API

High-precision sun and moon data for any location on Earth: rise / set times, twilight phases, transit times, moon phase and illumination. Positions from JPL DE421 (sub-arcsecond); rise / set & twilight times accurate to about a minute, 1900–2050. See methodology.

⛰️ Why thirdtrail vs. other ephemerides APIs?

Every other API on the market computes rise/set times at sea level, even if your observer is on a mountain. We accept (and optionally auto-derive) the observer's elevation and apply the geometric horizon-dip correction, so your sunrise time at 4 000 m is genuinely 17 minutes earlier than at sea level — not just a copied value. Indispensable for mountain photography, solar siting, mountaineering, and scientific observation at altitude.

Endpoint: GET /v1/ephemerides/ · Auth: API key (Authorization: Bearer tt_live_…)

⚠️ Informational use only — not for navigation or safety-of-life decisions. These sun, moon and twilight times are computed for convenience and are elevation-corrected, so they deliberately differ from the standard, level-horizon civil-twilight times that aviation and maritime regulators require. Do not use them for flight planning, to determine legal day/night or “lights-on” times, for navigation, or for any other safety-of-life purpose. Always verify against an official source. Safe use & disclaimers →

Quick start

curl -H "Authorization: Bearer $THIRDTRAIL_KEY" \
  "https://thirdtrail.life/v1/ephemerides/?lat=53.349&lon=-6.260&days=7"

Tier matrix

Feature FreeStarter €9Pro €39Business €149Enterprise
Calls per day1002,00025,000250,000custom
Burst per minute1030120600unlimited
Max forecast days730903651825¹
Sun & moon rise / set✅✅✅✅✅
Moon phase + illumination✅✅✅✅✅
Twilight (civil / nautical / astronomical)—✅✅✅✅
Zenith / transit times—✅✅✅✅
Golden / blue hour windows—✅✅✅✅
iCal feed (feed.ics)—✅✅✅✅
Prayer-times endpoint—✅✅✅✅
Bulk endpoint (/bulk)——✅ (100/req)✅ (1k/req)✅ (5k/req)
Webhooks (event subscriptions)——✅✅✅
Historical queries—✅✅✅✅
Localised phase names——✅✅✅
auto_elevation & auto_timezone———✅✅

¹ Enterprise default is 5 years (1825 days), raisable per customer.

Endpoints at a glance

EndpointMethodPurpose
/v1/ephemerides/GETMulti-day sun & moon events for one location.
/v1/ephemerides/prayer-times/GETFive Islamic prayer times. Selectable school + Asr method (Starter+).
/v1/ephemerides/bulk/POSTUp to 5 000 location/date tuples in one request (Pro+).
/v1/ephemerides/feed.icsGETCalendar subscription (Apple Calendar / Google Calendar / Outlook).
/v1/ephemerides/webhooks/POST / GET / DELETEEvent subscriptions. Webhooks docs →

Query parameters

NameTypeRequiredDefaultNotes
latfloatyes—Latitude, decimal degrees, [-90, 90]
lonfloatyes—Longitude, decimal degrees, [-180, 180]
elevationfloatno0Metres above sea level. [-500, 9000]. Earlier rises / later sets at altitude.
daysintnoplan-dependentCapped by your plan's max forecast days.
start_datedatenotoday (UTC)YYYY-MM-DD. Past dates require a paid plan.
tzstringno—IANA timezone name, e.g. Europe/Dublin.
utc_offsetstringno—Fixed offset ±HH:MM or Z. No DST.
auto_timezoneboolnofalseBusiness+. Resolves timezone from lat / lon.
auto_elevationboolnofalseBusiness+. Resolves elevation from lat / lon.
langstringnoenPro+. en / fr / es / de / it / pt.

When no timezone parameter is supplied, all times are returned in UTC, ISO-8601 with a Z suffix (e.g. 2026-05-19T04:21:22Z). The actual timezone used is always echoed back in resolved.timezone.

Example response

{
  "request":  { "lat": 53.349, "lon": -6.260, "days": 7, ... },
  "resolved": { "elevation_m": 0, "elevation_source": "default",
                "timezone": "UTC", "timezone_source": "default",
                "plan": "free" },
  "timezone": "UTC",
  "days": [
    {
      "date": "2026-05-19",
      "sun":  { "rise": "2026-05-19T04:21:14Z", "set": "2026-05-19T20:42:33Z", "status": "ok" },
      "moon": { "rise": "2026-05-19T05:49:34Z", "set": "2026-05-19T23:32:56Z",
                "status": "ok",
                "phase": { "angle_deg": 37.3, "illumination": 0.10, "name": "Waxing Crescent" } }
    }
  ],
  "compute_ms": 87
}

Twilight conventions

  • Civil: sun centre at -0.83° to -6°. Streetlights typically off; bright stars visible.
  • Nautical: -6° to -12°. Horizon distinguishable; navigation by stars feasible.
  • Astronomical: -12° to -18°. Faint celestial objects observable.

A null twilight value means that boundary was not crossed during the local day — this is normal at high latitudes (e.g. astronomical twilight does not occur in Dublin from mid-May to late July).

Accuracy notes

Rise / set / transit times are normally accurate to within 1 minute. Larger discrepancies vs. external sources are usually due to differing horizon conventions or local terrain not captured by global models.

  • Atmospheric refraction: standard 34′ depression applied.
  • Elevation correction: geometric horizon dip computed from observer altitude.
  • Auto-elevation: global terrain grid, ~9 km horizontal resolution.
  • Polar edge cases reported via the status field (ok / always_up / always_down).

These times use the standard horizon convention adjusted for your elevation, so they are not the official, level-horizon civil-twilight times that aviation and maritime regulators require. Do not use them for legal day/night, navigation or flight planning — see Safe use and methodology.

Start using it

Create a free account