Skip to content

Sunrise Sunset API

Sunrise, sunset, solar noon and twilight times for a coordinate and date.
Status
Working
API key
Not needed
Browser calls
Runs in the browser
Latency
349 ms

Build snapshot, not live. One verifier run on , from the machine that built this site. How we check

Example request

GEThttps://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42

Sent from your browser straight to api.sunrise-sunset.org. No proxy: this site never sees the request or the answer.

Copy the request

Shell
curl -s 'https://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42'

Response stored by the verifier

This is what api.sunrise-sunset.org answered when the verifier sent the request above on : HTTP 200, application/json. Arrays are cut to two items and long strings are shortened. It comes from the build snapshot.

application/json · stored
{
  "results": {
    "sunrise": "6:13:23 AM",
    "sunset": "5:59:59 PM",
    "solar_noon": "12:06:41 PM",
    "day_length": "11:46:36",
    "civil_twilight_begin": "5:48:54 AM",
    "civil_twilight_end": "6:24:28 PM",
    "nautical_twilight_begin": "5:18:57 AM",
    "nautical_twilight_end": "6:54:26 PM",
    "astronomical_twilight_begin": "4:48:49 AM",
    "astronomical_twilight_end": "7:24:33 PM"
  },
  "status": "OK",
  "tzid": "UTC"
}

Availability

Up 1 of 1 day checked · 30-day window

What counts as up for this API: an answer within five seconds, a 2xx status, and the JSON body must contain the field "results".

Last check: — passed, HTTP 200 in 349 ms.

The check runs from our infrastructure, not from where you are. If you need certainty, send the request yourself above. How the verifier works.

Used in these collections

Questions

Does the Sunrise Sunset API need an API key?

No. The sample request on this page was answered without a key, token or account.

Can I call the Sunrise Sunset API from the browser?

Yes. api.sunrise-sunset.org answered our verifier with an Access-Control-Allow-Origin header on Oct 3, 2026, so a fetch call from a web page can read the response.

Is the Sunrise Sunset API working?

At the check on Oct 3, 2026 it returned HTTP 200 with the expected data in 349 ms. The status at the top of this page shows the most recent result we have.

What is the Sunrise Sunset API good for?

Sunrise, sunset, solar noon and twilight times for a coordinate and date. It is part of our collection "Free APIs for a weather app": Sunrise and sunset to switch between day and night icons.