Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: thirdtrail Ephemerides API
version: 1.0.0
description: 'High-precision sun, moon, twilight, solar-irradiance and tide data for any point on Earth — with elevation as a first-class input.
All endpoints take `Authorization: Bearer `. Responses are shaped by the caller''s plan: features a plan does not include are omitted from the response rather than erroring.
Not for navigation or life-safety use — see https://thirdtrail.life/safety/'
servers:
- url: https://thirdtrail.life
description: Production
tags:
- name: Ephemerides
description: Sun and moon rise, set, transit, twilight and phase.
paths:
/v1/ephemerides/:
get:
operationId: ephemerides_retrieve
description: 'The core ephemerides call. Elevation is a first-class input: supplying `elevation` shifts sunrise and sunset measurably at altitude, which sea-level-only APIs cannot express.
Features your plan does not include are omitted from the response; the request still succeeds.'
summary: Sun and moon rise, set, transit and twilight
parameters:
- in: query
name: auto_elevation
schema:
type: boolean
description: Look the elevation up from the coordinates. Paid plans only.
- in: query
name: auto_timezone
schema:
type: boolean
description: Derive the timezone from the coordinates. Paid plans only.
- in: query
name: days
schema:
type: integer
description: Number of days to return, from 1. The ceiling is the plan's `max_forecast_days`; exceeding it returns 400 naming the limit.
- in: query
name: elevation
schema:
type: number
format: double
description: 'Metres above sea level, -500 to 9000. The differentiating input: sunrise at 2000 m is measurably earlier than the sea-level answer most APIs return. Omit to use `auto_elevation`, or default to 0.'
- in: query
name: lang
schema:
type: string
description: Language for localised names, e.g. moon phase. Paid plans only.
- in: query
name: lat
schema:
type: number
format: double
description: Latitude in decimal degrees, -90 to 90.
required: true
- in: query
name: lon
schema:
type: number
format: double
description: Longitude in decimal degrees, -180 to 180.
required: true
- in: query
name: start_date
schema:
type: string
description: First day, `YYYY-MM-DD`. Historical dates are plan-gated.
- in: query
name: tz
schema:
type: string
description: IANA timezone for output timestamps, e.g. `Europe/Dublin`.
- in: query
name: utc_offset
schema:
type: string
description: Fixed offset instead of `tz`, e.g. `+01:00`.
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'200':
description: No response body
/v1/ephemerides/bulk/:
post:
operationId: ephemerides_bulk_create
description: Batch form of `/v1/ephemerides/`. Locations are supplied in the JSON body. Plan-gated.
summary: Ephemerides for many locations (POST)
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'200':
description: No response body
/v1/ephemerides/feed.ics:
get:
operationId: ephemerides_feed.ics_retrieve
description: The same data as `text/calendar`, for subscribing in a calendar client rather than calling the JSON endpoint.
summary: Ephemerides as an iCalendar feed
parameters:
- in: query
name: auto_elevation
schema:
type: boolean
description: Look the elevation up from the coordinates. Paid plans only.
- in: query
name: auto_timezone
schema:
type: boolean
description: Derive the timezone from the coordinates. Paid plans only.
- in: query
name: days
schema:
type: integer
description: Number of days to return, from 1. The ceiling is the plan's `max_forecast_days`; exceeding it returns 400 naming the limit.
- in: query
name: elevation
schema:
type: number
format: double
description: 'Metres above sea level, -500 to 9000. The differentiating input: sunrise at 2000 m is measurably earlier than the sea-level answer most APIs return. Omit to use `auto_elevation`, or default to 0.'
- in: query
name: lang
schema:
type: string
description: Language for localised names, e.g. moon phase. Paid plans only.
- in: query
name: lat
schema:
type: number
format: double
description: Latitude in decimal degrees, -90 to 90.
required: true
- in: query
name: lon
schema:
type: number
format: double
description: Longitude in decimal degrees, -180 to 180.
required: true
- in: query
name: start_date
schema:
type: string
description: First day, `YYYY-MM-DD`. Historical dates are plan-gated.
- in: query
name: tz
schema:
type: string
description: IANA timezone for output timestamps, e.g. `Europe/Dublin`.
- in: query
name: utc_offset
schema:
type: string
description: Fixed offset instead of `tz`, e.g. `+01:00`.
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'200':
description: No response body
/v1/ephemerides/prayer-times/:
get:
operationId: ephemerides_prayer_times_retrieve
description: Prayer times over the same compute kernel, so they inherit the elevation correction. Every major calculation school is supported, with selectable Asr method.
summary: Five daily prayer times
parameters:
- in: query
name: asr_method
schema:
type: string
enum:
- hanafi
- shafi
description: 'Asr shadow rule: `shafi` (default) or `hanafi`.'
- in: query
name: auto_elevation
schema:
type: boolean
description: Look the elevation up from the coordinates. Paid plans only.
- in: query
name: auto_timezone
schema:
type: boolean
description: Derive the timezone from the coordinates. Paid plans only.
- in: query
name: days
schema:
type: integer
description: Number of days to return, from 1. The ceiling is the plan's `max_forecast_days`; exceeding it returns 400 naming the limit.
- in: query
name: elevation
schema:
type: number
format: double
description: 'Metres above sea level, -500 to 9000. The differentiating input: sunrise at 2000 m is measurably earlier than the sea-level answer most APIs return. Omit to use `auto_elevation`, or default to 0.'
- in: query
name: lang
schema:
type: string
description: Language for localised names, e.g. moon phase. Paid plans only.
- in: query
name: lat
schema:
type: number
format: double
description: Latitude in decimal degrees, -90 to 90.
required: true
- in: query
name: lon
schema:
type: number
format: double
description: Longitude in decimal degrees, -180 to 180.
required: true
- in: query
name: school
schema:
type: string
enum:
- egyptian
- isna
- karachi
- mwl
- uaq
description: 'Calculation school: `mwl`, `isna`, `egyptian`, `karachi`, or `uaq` (Umm al-Qura).'
required: true
- in: query
name: start_date
schema:
type: string
description: First day, `YYYY-MM-DD`. Historical dates are plan-gated.
- in: query
name: tz
schema:
type: string
description: IANA timezone for output timestamps, e.g. `Europe/Dublin`.
- in: query
name: utc_offset
schema:
type: string
description: Fixed offset instead of `tz`, e.g. `+01:00`.
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'200':
description: No response body
/v1/ephemerides/webhooks/:
get:
operationId: ephemerides_webhooks_retrieve
description: 'List webhooks for the caller and the product implied by the route,
or POST to create a new webhook.
Subclasses set `api_product_slug` (and the URL pattern uses the
matching Webhook* view).'
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'200':
description: No response body
summary: Ephemerides webhooks retrieve
x-summary-source: derived
post:
operationId: ephemerides_webhooks_create
description: 'List webhooks for the caller and the product implied by the route,
or POST to create a new webhook.
Subclasses set `api_product_slug` (and the URL pattern uses the
matching Webhook* view).'
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'200':
description: No response body
summary: Ephemerides webhooks create
x-summary-source: derived
/v1/ephemerides/webhooks/{webhook_id}/:
get:
operationId: ephemerides_webhooks_retrieve_2
description: Retrieve / delete a single webhook by id.
parameters:
- in: path
name: webhook_id
schema:
type: string
format: uuid
required: true
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'200':
description: No response body
summary: Ephemerides webhooks retrieve 2
x-summary-source: derived
delete:
operationId: ephemerides_webhooks_destroy
description: Retrieve / delete a single webhook by id.
parameters:
- in: path
name: webhook_id
schema:
type: string
format: uuid
required: true
tags:
- Ephemerides
security:
- bearerAuth: []
- cookieAuth: []
responses:
'204':
description: No response body
summary: Ephemerides webhooks destroy
x-summary-source: derived
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Your API key, as `Authorization: Bearer tt_live_…`. Keys are minted in the dashboard and shown once — store it in a secret manager. The key determines your plan, and the plan shapes what each response contains.'
cookieAuth:
type: apiKey
in: cookie
name: sessionid