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

ActionWhat it does
Get current sun phaseFind 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.
Get day lengthGet 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 hourGet the golden hour and blue hour windows for a place on one day: morning and evening, each with the minutes it lasts.
Get moon timesGet the moon for a place on one day: when it rises and sets, its phase by name, and how much of it looks lit, as a percentage.
Get solar positionGet where the sun rises, sets and stands at midday for a place on one day.
Get sun timesGet 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 rangeGet 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 timesGet 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. This is the check to branch a schedule on: switch something on at dusk, or send a reminder half an hour before sunset.

Inputs

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Timezonetztext
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
attributionobject
datetext
is_blue_hourtrue/false
is_daylighttrue/false
is_golden_hourtrue/false
is_nighttrue/false
is_twilighttrue/false
latitudenumber
longitudenumber
minutes_until_sunrisenumber
minutes_until_sunsetnumber
next_eventobject
phasetext
phase_labeltext
sun_never_risestrue/false
sun_never_setstrue/false
sun_statustext
sunrisetext
sunsettext
tzidtext
utc_offsettext
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": 36.5,
  "next_event": {
    "is_tomorrow": false,
    "label": "Sunset",
    "minutes_until": 36.5,
    "name": "sunset",
    "time": "2026-01-15T18:26:27+01:00"
  },
  "phase": "day",
  "phase_label": "Daylight",
  "sun_never_rises": false,
  "sun_never_sets": false,
  "sun_status": "normal",
  "sunrise": "2026-01-15T08:27:43+01:00",
  "sunset": "2026-01-15T18:26:27+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

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Datedatetext
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.
Timezonetztext
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
change_formattedtext
change_secondsnumber
datetext
day_lengthnumber
day_length_formattedtext
latitudenumber
longitudenumber
previous_datetext
previous_day_lengthnumber
previous_day_length_formattedtext
solar_noontext
sun_never_risestrue/false
sun_never_setstrue/false
sun_statustext
sunrisetext
sunsettext
trendtext
tzidtext
utc_offsettext
Example output
{
  "attribution": {
    "text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
    "url": "https://sunrise-sunset.org"
  },
  "change_formatted": "+1m 37s",
  "change_seconds": 97,
  "date": "2026-01-15",
  "day_length": 35924,
  "day_length_formatted": "9h 58m 44s",
  "latitude": 36.7202,
  "longitude": -4.4203,
  "previous_date": "2026-01-14",
  "previous_day_length": 35827,
  "previous_day_length_formatted": "9h 57m 7s",
  "solar_noon": "2026-01-15T13:27:05+01:00",
  "sun_never_rises": false,
  "sun_never_sets": false,
  "sun_status": "normal",
  "sunrise": "2026-01-15T08:27:43+01:00",
  "sunset": "2026-01-15T18:26:27+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

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Datedatetext
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.
Timezonetztext
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
datetext
evening_blue_hourobject
evening_golden_hourobject
latitudenumber
longitudenumber
morning_blue_hourobject
morning_golden_hourobject
sun_never_risestrue/false
sun_never_setstrue/false
sun_statustext
sunrisetext
sunsettext
tzidtext
utc_offsettext
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.6,
    "end": "2026-01-15T18:53:09+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:01+01:00",
    "duration_minutes": 10.9,
    "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:27:43+01:00",
  "sunset": "2026-01-15T18:26:27+01:00",
  "tzid": "Europe/Madrid",
  "utc_offset": "+01:00"
}

Get moon times

Get the moon for a place on one day: when it rises and sets, its phase by name, and how much of it looks lit, as a percentage. 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

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Datedatetext
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.
Timezonetztext
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
datetext
latitudenumber
longitudenumber
moon_illuminationnumber
moon_phasetext
moon_phase_emojitext
moonrisetext
moonrise_occurstrue/false
moonsettext
moonset_occurstrue/false
tzidtext
utc_offsettext
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. Each bearing comes as 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.

Inputs

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Datedatetext
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.
Timezonetztext
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
datetext
day_lengthnumber
day_length_formattedtext
latitudenumber
longitudenumber
solar_noontext
solar_noon_altitudenumber
solar_noon_azimuthnumber
solar_noon_directiontext
sun_statustext
sunrisetext
sunrise_azimuthnumber
sunrise_directiontext
sunsettext
sunset_azimuthnumber
sunset_directiontext
tzidtext
utc_offsettext
Example output
{
  "attribution": {
    "text": "Sunrise and sunset times courtesy of sunrise-sunset.org",
    "url": "https://sunrise-sunset.org"
  },
  "date": "2026-01-15",
  "day_length": 35924,
  "day_length_formatted": "9h 58m 44s",
  "latitude": 36.7202,
  "longitude": -4.4203,
  "solar_noon": "2026-01-15T13:27:05+01:00",
  "solar_noon_altitude": 32.06,
  "solar_noon_azimuth": 180.09,
  "solar_noon_direction": "S",
  "sun_status": "normal",
  "sunrise": "2026-01-15T08:27:43+01:00",
  "sunrise_azimuth": 118.31,
  "sunrise_direction": "ESE",
  "sunset": "2026-01-15T18:26:27+01:00",
  "sunset_azimuth": 241.82,
  "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

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Datedatetext
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.
Timezonetztext
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 formattime_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
astronomical_twilight_endtext
attributionobject
blue_hourobject
civil_twilight_begintext
civil_twilight_endtext
datetext
dawntext
day_lengthnumber
day_length_formattedtext
dusktext
first_lighttext
golden_hourobject
last_lighttext
latitudenumber
longitudenumber
moon_illuminationnumber
moon_phasetext
moon_phase_emojitext
moonrisetext
moonsettext
nautical_twilight_begintext
nautical_twilight_endtext
solar_noontext
solar_positionobject
sun_never_risestrue/false
sun_never_setstrue/false
sun_statustext
sunrisetext
sunsettext
tzidtext
utc_offsettext
Example output
{
  "astronomical_twilight_begin": "2026-01-15T06:58:10+01:00",
  "astronomical_twilight_end": "2026-01-15T19:56:00+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:09+01:00"
    },
    "morning": {
      "begin": "2026-01-15T08:01:01+01:00",
      "end": "2026-01-15T08:11:54+01:00"
    }
  },
  "civil_twilight_begin": "2026-01-15T08:01:01+01:00",
  "civil_twilight_end": "2026-01-15T18:53:09+01:00",
  "date": "2026-01-15",
  "dawn": "2026-01-15T08:01:01+01:00",
  "day_length": 35924,
  "day_length_formatted": "9h 58m 44s",
  "dusk": "2026-01-15T18:53:09+01:00",
  "first_light": "2026-01-15T06:58:10+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:00+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:13+01:00",
  "nautical_twilight_end": "2026-01-15T19:24:57+01:00",
  "solar_noon": "2026-01-15T13:27:05+01:00",
  "solar_position": {
    "solar_noon_altitude": 32.06,
    "solar_noon_azimuth": 180.09,
    "sunrise_azimuth": 118.31,
    "sunset_azimuth": 241.82
  },
  "sun_never_rises": false,
  "sun_never_sets": false,
  "sun_status": "normal",
  "sunrise": "2026-01-15T08:27:43+01:00",
  "sunset": "2026-01-15T18:26:27+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.

Inputs

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Start datedate_startdateRequired
First day of the range, in YYYY-MM-DD format.
End datedate_enddateRequired
Last day of the range, in YYYY-MM-DD format. At most 366 days from the start date.
Timezonetztext
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 formattime_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
date_endtext
date_starttext
day_countnumber
dayslist
latitudenumber
longest_dayobject
longitudenumber
shortest_dayobject
tzidtext
utc_offsettext
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": 1,
  "days": [
    {
      "astronomical_twilight_begin": "2026-01-15T06:58:10+01:00",
      "astronomical_twilight_end": "2026-01-15T19:56:00+01:00",
      "blue_hour": {
        "evening": {
          "begin": "2026-01-15T18:42:33+01:00",
          "end": "2026-01-15T18:53:09+01:00"
        },
        "morning": {
          "begin": "2026-01-15T08:01:01+01:00",
          "end": "2026-01-15T08:11:54+01:00"
        }
      },
      "civil_twilight_begin": "2026-01-15T08:01:01+01:00",
      "civil_twilight_end": "2026-01-15T18:53:09+01:00",
      "date": "2026-01-15",
      "dawn": "2026-01-15T08:01:01+01:00",
      "day_length": 35924,
      "day_length_formatted": "9h 58m 44s",
      "dusk": "2026-01-15T18:53:09+01:00",
      "first_light": "2026-01-15T06:58:10+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:00+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:13+01:00",
      "nautical_twilight_end": "2026-01-15T19:24:57+01:00",
      "solar_noon": "2026-01-15T13:27:05+01:00",
      "solar_position": {
        "solar_noon_altitude": 32.06,
        "solar_noon_azimuth": 180.09,
        "sunrise_azimuth": 118.31,
        "sunset_azimuth": 241.82
      },
      "sun_never_rises": false,
      "sun_never_sets": false,
      "sun_status": "normal",
      "sunrise": "2026-01-15T08:27:43+01:00",
      "sunset": "2026-01-15T18:26:27+01:00"
    }
  ],
  "latitude": 36.7202,
  "longest_day": {
    "date": "2026-01-15",
    "day_length": 35924,
    "day_length_formatted": "9h 58m 44s",
    "sunrise": "2026-01-15T08:27:43+01:00",
    "sunset": "2026-01-15T18:26:27+01:00"
  },
  "longitude": -4.4203,
  "shortest_day": {
    "date": "2026-01-15",
    "day_length": 35924,
    "day_length_formatted": "9h 58m 44s",
    "sunrise": "2026-01-15T08:27:43+01:00",
    "sunset": "2026-01-15T18:26:27+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

LatitudelatitudenumberRequired
Latitude of the place, in decimal degrees from -90 to 90. Positive is north of the equator.From -90 to 90.
LongitudelongitudenumberRequired
Longitude of the place, in decimal degrees from -180 to 180. The Americas take a negative longitude.From -180 to 180.
Datedatetext
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.
Timezonetztext
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
datetext
dawntext
dusktext
eveningobject
first_lighttext
fully_dark_aftertext
fully_dark_beforetext
last_lighttext
latitudenumber
longitudenumber
morningobject
sun_never_risestrue/false
sun_never_setstrue/false
sun_statustext
sunrisetext
sunsettext
tzidtext
utc_offsettext
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:01+01:00",
  "dusk": "2026-01-15T18:53:09+01:00",
  "evening": {
    "astronomical_end": "2026-01-15T19:56:00+01:00",
    "civil_end": "2026-01-15T18:53:09+01:00",
    "nautical_end": "2026-01-15T19:24:57+01:00",
    "sunset": "2026-01-15T18:26:27+01:00",
    "total_minutes": 89.5
  },
  "first_light": "2026-01-15T06:58:10+01:00",
  "fully_dark_after": "2026-01-15T19:56:00+01:00",
  "fully_dark_before": "2026-01-15T06:58:10+01:00",
  "last_light": "2026-01-15T19:56:00+01:00",
  "latitude": 36.7202,
  "longitude": -4.4203,
  "morning": {
    "astronomical_begin": "2026-01-15T06:58:10+01:00",
    "civil_begin": "2026-01-15T08:01:01+01:00",
    "nautical_begin": "2026-01-15T07:29:13+01:00",
    "sunrise": "2026-01-15T08:27:43+01:00",
    "total_minutes": 89.5
  },
  "sun_never_rises": false,
  "sun_never_sets": false,
  "sun_status": "normal",
  "sunrise": "2026-01-15T08:27:43+01:00",
  "sunset": "2026-01-15T18:26:27+01:00",
  "tzid": "Europe/Madrid",
  "utc_offset": "+01:00"
}

On this page