Sunrise & sunset times for a date range
get_sun_times_rangeRead-only
Same per-day data as get_sun_times but for an inclusive date range (up to 366 days) in a single call. Use this instead of repeated get_sun_times calls when you need several consecutive days. The days array may contain fewer entries than the number of dates requested: calendar days that never existed in that timezone (Samoa skipped 30 December 2011 when it crossed the date line) are left out, so read each entry's date field instead of assuming one per requested date. 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_end | Yes | Last day (inclusive), YYYY-MM-DD. The range covers at most 366 days counting both ends, so date_end can be at most 365 days after date_start. | |
| date_start | Yes | First day, YYYY-MM-DD. |