The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Thirdtrail listing page.
Python client for the thirdtrail APIs — sun, moon, twilight, solar irradiance and tides for any point on Earth, with elevation as a first-class input.
Most sunrise APIs answer for an observer standing at sea level. The higher you are, the further you see, and the earlier the sun clears the horizon.
At the Cliffs of Moher (214 m) the difference is about three minutes — on sunrise, sunset, and every golden- and blue-hour boundary with them:
| sea level | at 214 m | |
|---|---|---|
| sunrise | 07:23:33 | 07:20:25 |
| golden hour, morning start | 06:56:51 | 06:53:42 |
| moonrise | 18:03:48 | 17:59:40 |
Golden hour lasts 20–40 minutes, so three minutes is a real slice of it. Pass
elevation whenever you know it.
Timestamps arrive as aware datetime objects, not strings. Anything the
client does not model is still there on day.raw and day.response, so a new
server-side field never has to wait for a client release.
tide_heights and tide_extremes have no elevation parameter, and that is
deliberate: how high you stand does not change the ocean surface. Passing it
raises TypeError rather than being silently ignored.
tide_window is the exception, because half of what it returns is sun and
moon data:
Tide heights are metres relative to mean sea level, not chart datum, and exclude weather-driven surge. Not for navigation.
Catch a type, not a sentence:
AuthenticationError (401), PermissionDenied (403, a tier you are not on),
PlanLimitExceeded and InvalidRequest (400), RateLimited (429),
DataUnavailable (503), ServerError (5xx). All subclass ThirdtrailError.
Transient failures and 429s are retried with backoff. A plan ceiling is not — it will fail identically every time.
Mint one at thirdtrail.life/apis/keys/.
A key belongs to one subscription, so it works with one API; a Tides key
calling a solar endpoint gets PermissionDenied.
There is a free tier on every API.
Bulk (POST) endpoints, iCalendar feeds and webhook management. Use the REST
API directly for those — the full contract is published as
OpenAPI 3.1.
Using an AI agent? There is an MCP server that exposes the same data as tools.
MIT