Sunrise Sunset
App · Weather & Space · 8 actions
Look up sunrise and sunset times anywhere on Earth with the keyless Sunrise Sunset API. Get sun and moon events for a day or a whole year, the golden and blue hours for a shoot, dawn, dusk and the three twilights, the sun's compass bearing and height in the sky, how the day length is changing, and whether it is light out right now. Times come in the location's own timezone. No account or API key is required; showing a link to sunrise-sunset.org is.
Actions
| Action | What it does |
|---|---|
| Get current sun phase | Find out where the sun is at this moment at a place: whether it is daylight, twilight or night, whether the golden or blue hour is running, and which event is due next and in how many minutes, worked out by comparing the time now with the day's sun times. |
| Get day length | Get how long the day is at a place, and how that compares with the day before: the seconds gained or lost, and whether the days are lengthening or shortening. |
| Get golden hour | Get the golden hour and blue hour windows for a place on one day: morning and evening, each with the minutes it lasts. |
| Get moon times | Get the moon for a place on one day, as Sunrise Sunset calculates it: when it rises and sets, its phase by name, and how much of it looks lit, as a percentage (the phase and the lit share are for local noon). |
| Get solar position | Get where the sun rises, sets and stands at midday for a place on one day, as Sunrise Sunset calculates it. |
| Get sun times | Get every sun and moon event for a place on one day: sunrise, sunset, solar noon, day length, the three twilights, the golden and blue hours, where the sun sits in the sky, and the moon's rise, set, phase and illumination. |
| Get sun times for a date range | Get sun and moon events for every day in a date range, up to 366 days in a single request: the right way to build a calendar, chart daylight across a year, or find a solstice. |
| Get twilight times | Get dawn, dusk and the three twilights for a place on one day, grouped into the morning and evening runs they belong to: first light, then nautical, then civil twilight, then sunrise, and back out the other way after sunset. |
Get current sun phase
Find out where the sun is at this moment at a place: whether it is daylight, twilight or night, whether the golden or blue hour is running, and which event is due next and in how many minutes, worked out by comparing the time now with the day's sun times. This is the check to branch a schedule on: switch something on at dusk, or send a reminder half an hour before sunset.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
Outputs
as_oftext- The moment the phase was checked, in the place's own time.
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
datetext- Today's date at the place, as YYYY-MM-DD.
is_blue_hourtrue/false- True during the morning or evening blue hour.
is_daylighttrue/false- True while the sun is up.
is_golden_hourtrue/false- True during the morning or evening golden hour.
is_nighttrue/false- True while the night is fully dark.
is_twilighttrue/false- True during any of the three twilights, morning or evening.
latitudenumber- Latitude of the place, in decimal degrees.
longitudenumber- Longitude of the place, in decimal degrees.
minutes_until_sunrisenumber- Minutes until today's sunrise. Empty once it has passed, or when the sun does not rise today.
minutes_until_sunsetnumber- Minutes until today's sunset. Empty once it has passed, or when the sun does not set today.
next_eventobject- The next sun event due. Late at night, when nothing is left today, it is tomorrow's first. Empty when neither day has one.
phasetext- Where the sun is now: day, civil_twilight, nautical_twilight, astronomical_twilight or night. Worked out by comparing now with today's times.
phase_labeltext- The phase in words, such as Daylight or Dusk (civil twilight).
sun_never_risestrue/false- True when the sun stays down all day.
sun_never_setstrue/false- True when the sun stays up all day.
sun_statustext- normal, midnight_sun (the sun stays up all day) or polar_night (the sun stays down all day).
sunrisetext- Today's sunrise. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
sunsettext- Today's sunset. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- How far the times are ahead of or behind UTC on that day, such as +01:00.
Example output
{
"as_of": "2026-01-15T17:50:00+01:00",
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"date": "2026-01-15",
"is_blue_hour": false,
"is_daylight": true,
"is_golden_hour": true,
"is_night": false,
"is_twilight": false,
"latitude": 36.7202,
"longitude": -4.4203,
"minutes_until_sunrise": null,
"minutes_until_sunset": 35.1,
"next_event": {
"is_tomorrow": false,
"label": "Sunset",
"minutes_until": 35.1,
"name": "sunset",
"time": "2026-01-15T18:25:09+01:00"
},
"phase": "day",
"phase_label": "Daylight",
"sun_never_rises": false,
"sun_never_sets": false,
"sun_status": "normal",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunset": "2026-01-15T18:25:09+01:00",
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}Get day length
Get how long the day is at a place, and how that compares with the day before: the seconds gained or lost, and whether the days are lengthening or shortening. Use it to track the turn of the seasons, or to send a note when the evenings start drawing in.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Date
datetext - Which day to report on: a date in YYYY-MM-DD format, or the words 'today' or 'tomorrow'. Leave empty for today in the location's own timezone.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
Outputs
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
change_formattedtext- The change written out with its sign, such as +1m 17s.
change_secondsnumber- Seconds of daylight gained (positive) or lost (negative) since the day before, worked out from the two day lengths. Empty when either has no measurable length.
datetext- The day these times are for, as YYYY-MM-DD, in the place's calendar.
day_lengthnumber- Seconds between sunrise and sunset, from Sunrise Sunset: 86400 when the sun never sets, 0 when it never rises, and empty when only one of the two happens that day.
day_length_formattedtext- The day length written out, such as 9h 55m 51s. Empty when the day length is.
latitudenumber- Latitude of the place, in decimal degrees.
longitudenumber- Longitude of the place, in decimal degrees.
previous_datetext- The day before, as YYYY-MM-DD, which this day is compared with.
previous_day_lengthnumber- Seconds of daylight on the day before.
previous_day_length_formattedtext- The day before's daylight written out, such as 9h 54m 34s.
solar_noontext- Solar noon: when the sun is highest in the sky. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
sun_never_risestrue/false- True when the sun stays down all day.
sun_never_setstrue/false- True when the sun stays up all day.
sun_statustext- normal, midnight_sun (the sun stays up all day) or polar_night (the sun stays down all day).
sunrisetext- Sunrise: when the top of the sun appears over the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
sunsettext- Sunset: when the top of the sun drops below the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
trendtext- lengthening, shortening or unchanged; unknown when the change can't be measured.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- How far the times are ahead of or behind UTC on that day, such as +01:00.
Example output
{
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"change_formatted": "+1m 17s",
"change_seconds": 77,
"date": "2026-01-15",
"day_length": 35751,
"day_length_formatted": "9h 55m 51s",
"latitude": 36.7202,
"longitude": -4.4203,
"previous_date": "2026-01-14",
"previous_day_length": 35674,
"previous_day_length_formatted": "9h 54m 34s",
"solar_noon": "2026-01-15T13:27:06+01:00",
"sun_never_rises": false,
"sun_never_sets": false,
"sun_status": "normal",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunset": "2026-01-15T18:25:09+01:00",
"trend": "lengthening",
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}Get golden hour
Get the golden hour and blue hour windows for a place on one day: morning and evening, each with the minutes it lasts. The golden hour is the warm light just after sunrise and before sunset; the blue hour is the deep-blue sky either side of it. Neither is really an hour: the length is worked out for the day and place you ask about.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Date
datetext - Which day to report on: a date in YYYY-MM-DD format, or the words 'today' or 'tomorrow'. Leave empty for today in the location's own timezone.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
Outputs
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
datetext- The day these times are for, as YYYY-MM-DD, in the place's calendar.
evening_blue_hourobject- The evening blue hour: the deep-blue sky while the sun is between 6 and 4 degrees below the horizon.
evening_golden_hourobject- The evening golden hour: the warm light while the sun is between 4 degrees below and 6 degrees above the horizon.
latitudenumber- Latitude of the place, in decimal degrees.
longitudenumber- Longitude of the place, in decimal degrees.
morning_blue_hourobject- The morning blue hour: the deep-blue sky while the sun is between 6 and 4 degrees below the horizon.
morning_golden_hourobject- The morning golden hour: the warm light while the sun is between 4 degrees below and 6 degrees above the horizon.
sun_never_risestrue/false- True when the sun stays down all day.
sun_never_setstrue/false- True when the sun stays up all day.
sun_statustext- normal, midnight_sun (the sun stays up all day) or polar_night (the sun stays down all day).
sunrisetext- Sunrise: when the top of the sun appears over the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
sunsettext- Sunset: when the top of the sun drops below the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- How far the times are ahead of or behind UTC on that day, such as +01:00.
Example output
{
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"date": "2026-01-15",
"evening_blue_hour": {
"begin": "2026-01-15T18:42:33+01:00",
"duration_minutes": 10.8,
"end": "2026-01-15T18:53:22+01:00"
},
"evening_golden_hour": {
"begin": "2026-01-15T17:46:10+01:00",
"duration_minutes": 56.4,
"end": "2026-01-15T18:42:33+01:00"
},
"latitude": 36.7202,
"longitude": -4.4203,
"morning_blue_hour": {
"begin": "2026-01-15T08:01:05+01:00",
"duration_minutes": 10.8,
"end": "2026-01-15T08:11:54+01:00"
},
"morning_golden_hour": {
"begin": "2026-01-15T08:11:54+01:00",
"duration_minutes": 56.4,
"end": "2026-01-15T09:08:17+01:00"
},
"sun_never_rises": false,
"sun_never_sets": false,
"sun_status": "normal",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunset": "2026-01-15T18:25:09+01:00",
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}Get moon times
Get the moon for a place on one day, as Sunrise Sunset calculates it: when it rises and sets, its phase by name, and how much of it looks lit, as a percentage (the phase and the lit share are for local noon). About one day a month the moon does not rise, and another it does not set, within the local day; the response says which, rather than leaving a blank time unexplained.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Date
datetext - Which day to report on: a date in YYYY-MM-DD format, or the words 'today' or 'tomorrow'. Leave empty for today in the location's own timezone.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
Outputs
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
datetext- The day these times are for, as YYYY-MM-DD, in the place's calendar.
latitudenumber- Latitude of the place, in decimal degrees.
longitudenumber- Longitude of the place, in decimal degrees.
moon_illuminationnumber- How much of the moon looks lit at local noon, as a percentage from 0 to 100, from Sunrise Sunset.
moon_phasetext- The moon's phase at local noon, from Sunrise Sunset: New Moon, Waxing Crescent, First Quarter, Waxing Gibbous, Full Moon, Waning Gibbous, Last Quarter or Waning Crescent.
moon_phase_emojitext- An emoji of the phase, drawn as it looks from the northern hemisphere. Picked from the phase name.
moonrisetext- When the moon first rises within the day. An ISO 8601 time with its UTC offset. Empty on the day, about once a month, it does not rise.
moonrise_occurstrue/false- False on the day, about once a month, when the moon does not rise at all, so an empty moonrise means that rather than a gap.
moonsettext- When the moon last sets within the day. An ISO 8601 time with its UTC offset. Empty on the day, about once a month, it does not set.
moonset_occurstrue/false- False on the day, about once a month, when the moon does not set at all.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- How far the times are ahead of or behind UTC on that day, such as +01:00.
Example output
{
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"date": "2026-01-15",
"latitude": 36.7202,
"longitude": -4.4203,
"moon_illumination": 10.62,
"moon_phase": "Waning Crescent",
"moon_phase_emoji": "\ud83c\udf18",
"moonrise": "2026-01-15T06:01:54+01:00",
"moonrise_occurs": true,
"moonset": "2026-01-15T15:14:23+01:00",
"moonset_occurs": true,
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}Get solar position
Get where the sun rises, sets and stands at midday for a place on one day, as Sunrise Sunset calculates it. Each bearing comes in degrees from north and as the compass direction it points to, and the noon altitude says how high the sun climbs: what you need to aim a camera, place a solar panel, or work out which windows get the light. It covers those three moments only, not the sun's position at other times of day.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Date
datetext - Which day to report on: a date in YYYY-MM-DD format, or the words 'today' or 'tomorrow'. Leave empty for today in the location's own timezone.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
Outputs
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
datetext- The day these times are for, as YYYY-MM-DD, in the place's calendar.
day_lengthnumber- Seconds between sunrise and sunset, from Sunrise Sunset: 86400 when the sun never sets, 0 when it never rises, and empty when only one of the two happens that day.
day_length_formattedtext- The day length written out, such as 9h 55m 51s. Empty when the day length is.
latitudenumber- Latitude of the place, in decimal degrees.
longitudenumber- Longitude of the place, in decimal degrees.
solar_noontext- Solar noon: when the sun is highest in the sky. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
solar_noon_altitudenumber- How high the sun is at solar noon, in degrees above the horizon. Below zero when it stays under the horizon all day.
solar_noon_azimuthnumber- Compass bearing of the sun at solar noon, in degrees clockwise from north.
solar_noon_directiontext- The direction of the sun at solar noon as a 16-point compass point, such as ESE, worked out from solar_noon_azimuth.
sun_statustext- normal, midnight_sun (the sun stays up all day) or polar_night (the sun stays down all day).
sunrisetext- Sunrise: when the top of the sun appears over the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
sunrise_azimuthnumber- Compass bearing of the sunrise, in degrees clockwise from north (90 is east). Empty when the sun does not rise.
sunrise_directiontext- The direction of the sun at sunrise as a 16-point compass point, such as ESE, worked out from sunrise_azimuth.
sunsettext- Sunset: when the top of the sun drops below the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
sunset_azimuthnumber- Compass bearing of the sunset, in degrees clockwise from north (270 is west). Empty when the sun does not set.
sunset_directiontext- The direction of the sun at sunset as a 16-point compass point, such as ESE, worked out from sunset_azimuth.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- How far the times are ahead of or behind UTC on that day, such as +01:00.
Example output
{
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"date": "2026-01-15",
"day_length": 35751,
"day_length_formatted": "9h 55m 51s",
"latitude": 36.7202,
"longitude": -4.4203,
"solar_noon": "2026-01-15T13:27:06+01:00",
"solar_noon_altitude": 32.22,
"solar_noon_azimuth": 180,
"solar_noon_direction": "S",
"sun_status": "normal",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunrise_azimuth": 116,
"sunrise_direction": "ESE",
"sunset": "2026-01-15T18:25:09+01:00",
"sunset_azimuth": 244.1,
"sunset_direction": "WSW",
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}Get sun times
Get every sun and moon event for a place on one day: sunrise, sunset, solar noon, day length, the three twilights, the golden and blue hours, where the sun sits in the sky, and the moon's rise, set, phase and illumination. Times come back in the location's own timezone.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Date
datetext - Which day to report on: a date in YYYY-MM-DD format, or the words 'today' or 'tomorrow'. Leave empty for today in the location's own timezone.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
- Time format
time_formattext - How event times are returned. ISO 8601 timestamps carry the location's UTC offset and are what most steps want; Unix epoch seconds suit embedded devices and microcontrollers.One of:
iso8601(ISO 8601 timestamps (default)),unix(Unix epoch seconds). Default:iso8601.
Outputs
astronomical_twilight_begintext- Morning astronomical twilight begins (the sun 18 degrees below the horizon), the same moment as first light. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
astronomical_twilight_endtext- Evening astronomical twilight ends (the sun 18 degrees below the horizon), the same moment as last light. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
blue_hourobject- The blue hours: the deep-blue sky while the sun is between 6 and 4 degrees below the horizon.
civil_twilight_begintext- Morning civil twilight begins (the sun 6 degrees below the horizon), the same moment as dawn. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
civil_twilight_endtext- Evening civil twilight ends (the sun 6 degrees below the horizon), the same moment as dusk. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
datetext- The day these times are for, as YYYY-MM-DD, in the place's calendar.
dawntext- Dawn: from here it is light enough to be outdoors without a lamp. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
day_lengthnumber- Seconds between sunrise and sunset, from Sunrise Sunset: 86400 when the sun never sets, 0 when it never rises, and empty when only one of the two happens that day.
day_length_formattedtext- The day length written out, such as 9h 55m 51s. Empty when the day length is.
dusktext- Dusk: after this it is too dark to be outdoors without a lamp. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
first_lighttext- First light: the first hint of light in the sky. Before it the night is fully dark. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
golden_hourobject- The golden hours: the warm light while the sun is between 4 degrees below and 6 degrees above the horizon.
last_lighttext- Last light: the last hint of light in the sky. After it the night is fully dark. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
latitudenumber- Latitude of the place, in decimal degrees.
longitudenumber- Longitude of the place, in decimal degrees.
moon_illuminationnumber- How much of the moon looks lit at local noon, as a percentage from 0 to 100, from Sunrise Sunset.
moon_phasetext- The moon's phase at local noon, from Sunrise Sunset: New Moon, Waxing Crescent, First Quarter, Waxing Gibbous, Full Moon, Waning Gibbous, Last Quarter or Waning Crescent.
moon_phase_emojitext- An emoji of the phase, drawn as it looks from the northern hemisphere. Picked from the phase name.
moonrisetext- When the moon first rises within the day. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty on the day, about once a month, it does not rise.
moonsettext- When the moon last sets within the day. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty on the day, about once a month, it does not set.
nautical_twilight_begintext- Morning nautical twilight begins (the sun 12 degrees below the horizon): the horizon at sea becomes visible. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
nautical_twilight_endtext- Evening nautical twilight ends (the sun 12 degrees below the horizon): the horizon at sea is lost. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
solar_noontext- Solar noon: when the sun is highest in the sky. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
solar_positionobject- Where the sun is at sunrise, sunset and solar noon, from Sunrise Sunset.
sun_never_risestrue/false- True when the sun stays down all day.
sun_never_setstrue/false- True when the sun stays up all day.
sun_statustext- normal, midnight_sun (the sun stays up all day) or polar_night (the sun stays down all day).
sunrisetext- Sunrise: when the top of the sun appears over the horizon. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
sunsettext- Sunset: when the top of the sun drops below the horizon. An ISO 8601 time with its UTC offset, or Unix seconds if you chose that time format. Empty when it does not happen that day.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- How far this day's times are ahead of or behind UTC, such as +01:00. It changes when the clocks do.
Example output
{
"astronomical_twilight_begin": "2026-01-15T06:58:14+01:00",
"astronomical_twilight_end": "2026-01-15T19:56:15+01:00",
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"blue_hour": {
"evening": {
"begin": "2026-01-15T18:42:33+01:00",
"end": "2026-01-15T18:53:22+01:00"
},
"morning": {
"begin": "2026-01-15T08:01:05+01:00",
"end": "2026-01-15T08:11:54+01:00"
}
},
"civil_twilight_begin": "2026-01-15T08:01:05+01:00",
"civil_twilight_end": "2026-01-15T18:53:22+01:00",
"date": "2026-01-15",
"dawn": "2026-01-15T08:01:05+01:00",
"day_length": 35751,
"day_length_formatted": "9h 55m 51s",
"dusk": "2026-01-15T18:53:22+01:00",
"first_light": "2026-01-15T06:58:14+01:00",
"golden_hour": {
"evening": {
"begin": "2026-01-15T17:46:10+01:00",
"end": "2026-01-15T18:42:33+01:00"
},
"morning": {
"begin": "2026-01-15T08:11:54+01:00",
"end": "2026-01-15T09:08:17+01:00"
}
},
"last_light": "2026-01-15T19:56:15+01:00",
"latitude": 36.7202,
"longitude": -4.4203,
"moon_illumination": 10.62,
"moon_phase": "Waning Crescent",
"moon_phase_emoji": "\ud83c\udf18",
"moonrise": "2026-01-15T06:01:54+01:00",
"moonset": "2026-01-15T15:14:23+01:00",
"nautical_twilight_begin": "2026-01-15T07:29:17+01:00",
"nautical_twilight_end": "2026-01-15T19:25:11+01:00",
"solar_noon": "2026-01-15T13:27:06+01:00",
"solar_position": {
"solar_noon_altitude": 32.22,
"solar_noon_azimuth": 180,
"sunrise_azimuth": 116,
"sunset_azimuth": 244.1
},
"sun_never_rises": false,
"sun_never_sets": false,
"sun_status": "normal",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunset": "2026-01-15T18:25:09+01:00",
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}Get sun times for a date range
Get sun and moon events for every day in a date range, up to 366 days in a single request: the right way to build a calendar, chart daylight across a year, or find a solstice. The longest and shortest day of the range are picked out alongside the full list, and each day has its own UTC offset, since the clocks can change within a range.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Start date
date_startdateRequired - First day of the range, in YYYY-MM-DD format.
- End date
date_enddateRequired - Last day of the range, in YYYY-MM-DD format. At most 366 days from the start date.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
- Time format
time_formattext - How event times are returned. ISO 8601 timestamps carry the location's UTC offset and are what most steps want; Unix epoch seconds suit embedded devices and microcontrollers.One of:
iso8601(ISO 8601 timestamps (default)),unix(Unix epoch seconds). Default:iso8601.
Outputs
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
date_endtext- The last day asked for, as YYYY-MM-DD.
date_starttext- The first day asked for, as YYYY-MM-DD.
day_countnumber- How many days came back.
dayslist- One entry per day, in date order, with every field Get sun times returns for a day. A day that never happened at the place (Samoa skipped 30 December 2011) is left out, so match entries by their date.
latitudenumber- Latitude of the place, in decimal degrees.
longest_dayobject- The day in the range with the most daylight. Empty when no day in the range has a measurable length.
longitudenumber- Longitude of the place, in decimal degrees.
shortest_dayobject- The day in the range with the least daylight. Empty when no day in the range has a measurable length.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- The UTC offset on the first day of the range, such as +01:00. Each day has its own, since the clocks can change within a range.
Example output
{
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"date_end": "2026-01-16",
"date_start": "2026-01-15",
"day_count": 2,
"days": [
{
"astronomical_twilight_begin": "2026-01-15T06:58:14+01:00",
"astronomical_twilight_end": "2026-01-15T19:56:15+01:00",
"blue_hour": {
"evening": {
"begin": "2026-01-15T18:42:33+01:00",
"end": "2026-01-15T18:53:22+01:00"
},
"morning": {
"begin": "2026-01-15T08:01:05+01:00",
"end": "2026-01-15T08:11:54+01:00"
}
},
"civil_twilight_begin": "2026-01-15T08:01:05+01:00",
"civil_twilight_end": "2026-01-15T18:53:22+01:00",
"date": "2026-01-15",
"dawn": "2026-01-15T08:01:05+01:00",
"day_length": 35751,
"day_length_formatted": "9h 55m 51s",
"dusk": "2026-01-15T18:53:22+01:00",
"first_light": "2026-01-15T06:58:14+01:00",
"golden_hour": {
"evening": {
"begin": "2026-01-15T17:46:10+01:00",
"end": "2026-01-15T18:42:33+01:00"
},
"morning": {
"begin": "2026-01-15T08:11:54+01:00",
"end": "2026-01-15T09:08:17+01:00"
}
},
"last_light": "2026-01-15T19:56:15+01:00",
"moon_illumination": 10.62,
"moon_phase": "Waning Crescent",
"moon_phase_emoji": "\ud83c\udf18",
"moonrise": "2026-01-15T06:01:54+01:00",
"moonset": "2026-01-15T15:14:23+01:00",
"nautical_twilight_begin": "2026-01-15T07:29:17+01:00",
"nautical_twilight_end": "2026-01-15T19:25:11+01:00",
"solar_noon": "2026-01-15T13:27:06+01:00",
"solar_position": {
"solar_noon_altitude": 32.22,
"solar_noon_azimuth": 180,
"sunrise_azimuth": 116,
"sunset_azimuth": 244.1
},
"sun_never_rises": false,
"sun_never_sets": false,
"sun_status": "normal",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunset": "2026-01-15T18:25:09+01:00",
"utc_offset": "+01:00"
},
{
"astronomical_twilight_begin": "2026-01-16T06:58:03+01:00",
"astronomical_twilight_end": "2026-01-16T19:57:08+01:00",
"blue_hour": {
"evening": {
"begin": "2026-01-16T18:43:32+01:00",
"end": "2026-01-16T18:54:20+01:00"
},
"morning": {
"begin": "2026-01-16T08:00:50+01:00",
"end": "2026-01-16T08:11:38+01:00"
}
},
"civil_twilight_begin": "2026-01-16T08:00:50+01:00",
"civil_twilight_end": "2026-01-16T18:54:20+01:00",
"date": "2026-01-16",
"dawn": "2026-01-16T08:00:50+01:00",
"day_length": 35831,
"day_length_formatted": "9h 57m 11s",
"dusk": "2026-01-16T18:54:20+01:00",
"first_light": "2026-01-16T06:58:03+01:00",
"golden_hour": {
"evening": {
"begin": "2026-01-16T17:47:17+01:00",
"end": "2026-01-16T18:43:32+01:00"
},
"morning": {
"begin": "2026-01-16T08:11:38+01:00",
"end": "2026-01-16T09:07:53+01:00"
}
},
"last_light": "2026-01-16T19:57:08+01:00",
"moon_illumination": 5.5,
"moon_phase": "Waning Crescent",
"moon_phase_emoji": "\ud83c\udf18",
"moonrise": "2026-01-16T06:56:51+01:00",
"moonset": "2026-01-16T16:06:06+01:00",
"nautical_twilight_begin": "2026-01-16T07:29:04+01:00",
"nautical_twilight_end": "2026-01-16T19:26:06+01:00",
"solar_noon": "2026-01-16T13:27:26+01:00",
"solar_position": {
"solar_noon_altitude": 32.4,
"solar_noon_azimuth": 180,
"sunrise_azimuth": 115.76,
"sunset_azimuth": 244.35
},
"sun_never_rises": false,
"sun_never_sets": false,
"sun_status": "normal",
"sunrise": "2026-01-16T08:28:59+01:00",
"sunset": "2026-01-16T18:26:10+01:00",
"utc_offset": "+01:00"
}
],
"latitude": 36.7202,
"longest_day": {
"date": "2026-01-16",
"day_length": 35831,
"day_length_formatted": "9h 57m 11s",
"sunrise": "2026-01-16T08:28:59+01:00",
"sunset": "2026-01-16T18:26:10+01:00"
},
"longitude": -4.4203,
"shortest_day": {
"date": "2026-01-15",
"day_length": 35751,
"day_length_formatted": "9h 55m 51s",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunset": "2026-01-15T18:25:09+01:00"
},
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}Get twilight times
Get dawn, dusk and the three twilights for a place on one day, grouped into the morning and evening runs they belong to: first light, then nautical, then civil twilight, then sunrise, and back out the other way after sunset. Civil twilight is when it is light enough to be outdoors without a lamp; after astronomical twilight the sky is fully dark.
Inputs
- Latitude
latitudenumberRequired - Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
- Longitude
longitudenumberRequired - Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
- Date
datetext - Which day to report on: a date in YYYY-MM-DD format, or the words 'today' or 'tomorrow'. Leave empty for today in the location's own timezone.
- Timezone
tztext - Usually leave this empty: times already come back in the location's own timezone. Set it only to express them in a different one, using a full IANA name like 'Europe/Madrid' (abbreviations such as 'PST' are not accepted).
Outputs
attributionobject- The credit Sunrise Sunset asks you to show wherever these times appear.
datetext- The day these times are for, as YYYY-MM-DD, in the place's calendar.
dawntext- Dawn: from here it is light enough to be outdoors without a lamp. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
dusktext- Dusk: after this it is too dark to be outdoors without a lamp. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
eveningobject- The evening's twilights in the order they happen, from sunset to last light.
first_lighttext- First light: the first hint of light in the sky, when astronomical twilight begins. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
fully_dark_aftertext- The night is fully dark after this time in the evening: the same moment as last light. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
fully_dark_beforetext- The night is fully dark before this time in the morning: the same moment as first light. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
last_lighttext- Last light: the last hint of light in the sky, when astronomical twilight ends. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
latitudenumber- Latitude of the place, in decimal degrees.
longitudenumber- Longitude of the place, in decimal degrees.
morningobject- The morning's twilights in the order they happen, from first light to sunrise.
sun_never_risestrue/false- True when the sun stays down all day.
sun_never_setstrue/false- True when the sun stays up all day.
sun_statustext- normal, midnight_sun (the sun stays up all day) or polar_night (the sun stays down all day).
sunrisetext- Sunrise: when the top of the sun appears over the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
sunsettext- Sunset: when the top of the sun drops below the horizon. An ISO 8601 time with its UTC offset. Empty when it does not happen that day.
tzidtext- The timezone the times are in, as an IANA name such as Europe/Madrid: the place's own, unless you chose one. Out at sea it is a nautical zone such as Etc/GMT+8, whose sign is reversed (Etc/GMT+8 is 8 hours behind UTC).
utc_offsettext- How far the times are ahead of or behind UTC on that day, such as +01:00.
Example output
{
"attribution": {
"text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
"url": "https://sunrise-sunset.org"
},
"date": "2026-01-15",
"dawn": "2026-01-15T08:01:05+01:00",
"dusk": "2026-01-15T18:53:22+01:00",
"evening": {
"astronomical_end": "2026-01-15T19:56:15+01:00",
"civil_end": "2026-01-15T18:53:22+01:00",
"nautical_end": "2026-01-15T19:25:11+01:00",
"sunset": "2026-01-15T18:25:09+01:00",
"total_minutes": 91.1
},
"first_light": "2026-01-15T06:58:14+01:00",
"fully_dark_after": "2026-01-15T19:56:15+01:00",
"fully_dark_before": "2026-01-15T06:58:14+01:00",
"last_light": "2026-01-15T19:56:15+01:00",
"latitude": 36.7202,
"longitude": -4.4203,
"morning": {
"astronomical_begin": "2026-01-15T06:58:14+01:00",
"civil_begin": "2026-01-15T08:01:05+01:00",
"nautical_begin": "2026-01-15T07:29:17+01:00",
"sunrise": "2026-01-15T08:29:18+01:00",
"total_minutes": 91.1
},
"sun_never_rises": false,
"sun_never_sets": false,
"sun_status": "normal",
"sunrise": "2026-01-15T08:29:18+01:00",
"sunset": "2026-01-15T18:25:09+01:00",
"tzid": "Europe/Madrid",
"utc_offset": "+01:00"
}