About this endpoint
What it does
Calculates sun and moon information for a given location and time. It accepts latitude, longitude, and datetime as query parameters, and returns a JSON object containing sun, moon, and daylight-phase timing information for that request.
Query Parameter(s)
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| datetime | String | Yes | Date and time to check, as yyyy-MM-ddTHH:mm:ss.Pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$ |
| latitude | Number | Yes | Location latitude to check. Minimum: -90Maximum: 90 |
| longitude | Number | Yes | Location longitude to check. Minimum: -180Maximum: 180 |
| utcOffset | String | No | Optional UTC timezone prefix (leave empty to auto-detect). Pattern: ^(UTC)?[+-]\d{1,2}:\d{2}$ |
Response
Returns a JSON object with required fields for daylight phases, solar timing, and sun/moon measurements. The top-level fields include arrays of time ranges such as day, night, civilTwilight, and similar phase fields, plus solarNoon, nadir, sun, and moon.
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| day | Object Array | Yes | The daylight period (from sunrise to sunset). Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| morningGoldenHour | Object Array | Yes | The soft, warm morning light shortly after sunrise. Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| civilTwilight | Object Array | Yes | Morning civil twilight (bright enough for most outdoor activities without artificial light). Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| nauticalTwilight | Object Array | Yes | Morning nautical twilight (the horizon is still visible at sea). Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| astronomicalTwilight | Object Array | Yes | Morning astronomical twilight (the sky is almost completely dark). Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| eveningGoldenHour | Object Array | Yes | The soft, warm evening light shortly before sunset. Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| civilDusk | Object Array | Yes | Evening civil twilight. Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| nauticalDusk | Object Array | Yes | Evening nautical twilight. Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| astronomicalDusk | Object Array | Yes | Evening astronomical twilight. Each item has from and to fields in HH:MM local-time format. The array is empty if the phase is not observed for that day, and may contain multiple entries if it is observed more than once. |
| night | Object Array | Yes | Full night (dark enough for astronomical observations). May appear as two separate entries on the same calendar day: the tail end of the previous night just after midnight, and the start of the next night just before the following midnight. Each item has from and to fields in HH:MM local-time format. |
| solarNoon | String | Yes | The moment the sun is at its highest position, as local time only, in HH:MM format. Always present. |
| nadir | String | Yes | The moment the sun is at its lowest position (the darkest moment of the night), as local time only, in HH:MM format. Always present. |
| sun | Object | Yes | Sun measurements for the requested location and time. Contains altitude and azimuth. |
| moon | Object | Yes | Moon measurements and rise/set timing for the requested location and time. Contains altitude, azimuth, distance, parallacticAngle, moonrise, and moonset. |
sun
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| altitude | Number | Yes | The sun's apparent altitude above the horizon, in degrees. |
| azimuth | Number | Yes | The sun's azimuth, in degrees, clockwise from north. |
moon
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| altitude | Number | Yes | The moon's apparent altitude above the horizon, in degrees. |
| azimuth | Number | Yes | The moon's azimuth, in degrees, clockwise from north. |
| distance | Integer | Yes | The distance to the moon, in kilometers. |
| parallacticAngle | Number | Yes | The moon's parallactic angle, in degrees. |
| moonrise | String Array | Yes | The moonrise time observed on the requested calendar day, as local time only, in HH:MM format. Empty if the moon does not rise that day. Contains at most one entry; if the moon could rise more than once on the same calendar day, only the first such event is reported. |
| moonset | String Array | Yes | The moonset time observed on the requested calendar day, as local time only, in HH:MM format. Empty if the moon does not set that day. Contains at most one entry; if the moon could set more than once on the same calendar day, only the first such event is reported. |



