Sunrise & sunset times
get_sun_timesRead-only
Sunrise, sunset, solar noon, day length, civil/nautical/astronomical twilight, dawn/dusk, first/last light, golden hour, blue hour, sunrise/sunset azimuth, solar noon altitude, moonrise/moonset, moon phase and illumination for any coordinates on Earth and any date. Times are ISO 8601 in the local timezone of the location. Polar day/night handled via sun_status (normal | midnight_sun | polar_night); events that do not occur are null. Free data by sunrise-sunset.org. Attribution with a link to https://sunrise-sunset.org is required when displaying this data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tz | No | IANA timezone like 'Europe/Madrid'. Omit to use the local timezone of the coordinates, resolved automatically (recommended). | |
| lat | Yes | Latitude in decimal degrees. | |
| lng | Yes | Longitude in decimal degrees. | |
| date | No | 'today' (default), 'tomorrow' or YYYY-MM-DD. Relative dates resolve in the local timezone of the coordinates. |