Solar API

Solar geometry for any location on Earth: solar position (azimuth, altitude, zenith), declination, hour angle, equation of time and air mass, at any timestamp from 1900 to 2050. Positions come from JPL DE421, the numerical integration that NREL's SPA approximates.

How this differs from other solar APIs

Energy-yield models, building solar-gain calculations and panel anomaly checks all start from the sun's position. We take the observer's elevation as an input, or look it up for you, where most APIs ignore it or use a coarse lookup. That matters for PV monitoring, greenhouse DLI scheduling, building-energy simulation, and any other work where the length of the sunlight's path through the atmosphere changes the answer.

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

Quick start

curl -H "Authorization: Bearer $THIRDTRAIL_KEY" \
  "https://thirdtrail.life/v1/solar/?lat=39.7392&lon=-104.9903&elevation=1609&timestamp=2026-06-21T18:00:00Z"

Denver, CO at 1609 m on the June solstice, at noon local time (18:00 UTC). Returns the sun's azimuth, altitude, zenith, declination, hour angle, equation of time and air mass at that instant.

Tier matrix

Feature FreeDeveloper €19Pro €79Business €299Enterprise
Calls per day1005,000100,0001,000,000custom
Burst per minute10606003,000unlimited
Max forecast horizon7 d30 d365 d5 y50 y
Solar position (az / alt / zenith)✅✅✅✅✅
Declination, hour angle, EoT, air mass✅✅✅✅✅
Clear-sky irradiance (GHI / DNI / DHI)—✅✅✅✅
Daily Light Integral (/dli)—✅✅✅✅
Sun-path arrays (/path, /range)—✅✅✅✅
Custom turbidity / aerosol——✅✅✅
Bulk endpoint (/bulk)——✅✅✅
iCal feed (feed.ics)—✅✅✅✅
Webhooks——✅✅✅
Historical queries—✅ (5 y)✅ (50 y)✅ (100 y)✅ (from 1900)
auto_elevation & auto_timezone———✅✅

Endpoints at a glance

EndpointMethodPurpose
/v1/solar/GETSolar position at one instant, plus clear-sky irradiance on Developer and up.
/v1/solar/range/GETA time series across a window, at the interval you choose (Developer+).
/v1/solar/path/GETSun-path arrays for one date, for shading and facade studies.
/v1/solar/dli/GETDaily Light Integral for one date or a date range, for greenhouse and crop work.
/v1/solar/bulk/POSTUp to 10 000 (location × timestamp) tuples per request (Pro+).
/v1/solar/feed.icsGETCalendar subscription with solar noon and DLI events.
/v1/solar/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]. It has a real effect on irradiance and only a second-order effect on position.
timestampdatetimenonow (UTC)ISO-8601 with timezone offset (e.g. 2026-06-21T18:00:00Z). How far back you can go depends on your plan.
includestringnopositionComma-separated. position always; irradiance / dli on Developer+.
tzstringno—IANA timezone name. It is only echoed back in resolved.timezone; the computation always runs in UTC.
utc_offsetstringno—Fixed offset ±HH:MM or Z. No DST. Can't be combined with tz.
auto_timezoneboolnofalseBusiness+. Resolves timezone from lat / lon.
auto_elevationboolnofalseBusiness+. Resolves elevation from lat / lon.

Without an explicit timestamp, the endpoint computes for the current instant. The response always echoes the resolved UTC timestamp at the top level, formatted as ISO-8601 with a Z suffix (e.g. 2026-05-19T04:21:22Z).

Example response

{
  "request": {
    "lat": 39.7392, "lon": -104.9903, "elevation_m": 1609,
    "timestamp": "2026-06-21T18:00:00Z",
    "tz": null, "utc_offset": null,
    "auto_elevation": false, "auto_timezone": false,
    "include": "position"
  },
  "resolved": {
    "elevation_m": 1609.0, "elevation_source": "user",
    "timezone": "UTC", "timezone_source": "default",
    "position_model": "JPL DE421",
    "plan": "developer"
  },
  "timestamp": "2026-06-21T18:00:00Z",
  "position": {
    "azimuth_deg":         156.4231,
    "altitude_deg":         69.0851,
    "zenith_deg":           20.9149,
    "declination_deg":      23.4360,
    "hour_angle_deg":      -22.1850,
    "equation_of_time_min": -1.628,
    "air_mass":             1.0700
  },
  "compute_ms": 12
}

Azimuth is measured clockwise from True North (0° = N, 90° = E, 180° = S, 270° = W). Altitude is measured from the horizon (0°) to the zenith (90°); negative when the sun is below the horizon. Air mass is null when the sun is below the horizon.

Conventions

  • Azimuth: 0° = North, increasing clockwise. Topocentric, not geocentric.
  • Altitude: above the horizon. Includes standard atmospheric refraction below ~5°.
  • Hour angle: signed, in [-180, 180] degrees. Computed from Local Sidereal Time minus apparent right ascension; east longitude positive.
  • Equation of time: signed, in minutes. Positive when apparent solar time is ahead of mean solar time. Independent of longitude.
  • Air mass: Kasten-Young (1989). Defined only above the horizon.

Accuracy notes

  • Solar position: numerical integration against the JPL planetary ephemerides, accurate to under an arcsecond for 1900 to 2050. NREL's SPA is a polynomial approximation of that integration, accurate to ±0.0003°; we compute from the integration itself.
  • Atmospheric refraction: applied below 5° altitude using Saemundsson's formula. Above 5°, refraction is under 1 arcminute and is not applied separately.
  • Equation of time: Meeus polynomial (Chapter 28 of Astronomical Algorithms, 2nd ed.). ±0.5 s accuracy.
  • Hour angle: derived from Greenwich Apparent Sidereal Time + east longitude − apparent right ascension. Wrapped to [-12 h, +12 h).
  • Air mass: Kasten-Young (1989), which handles a low sun correctly where 1/cos(zenith) is off by an order of magnitude.
  • Validity range: 1900 to 2050 by default (DE421). Out-of-range timestamps return 400.

Roadmap

Version 2 has everything listed above: solar position, clear-sky irradiance (GHI, DNI, DHI), Daily Light Integral, sun-path arrays, the bulk endpoint, the calendar feed and webhooks. For v3 we are considering spectral decomposition (UV, visible, IR), more clear-sky models (ESRA, Solis), and a tilt, orientation and soiling layer for PV-system modelling. Cloud-affected irradiance is out of scope. The API returns clear-sky theoretical maxima, so pair it with a weather provider for actual conditions.

Start using it

Create a free account