Sunset and sunrise times for a given latitude and longitude.
The Sunrise and Sunset API provides sunrise, sunset, twilight, golden hour, blue hour, solar position, and moon data for any location on Earth, given a latitude and longitude. Requests are made via a GET call to https://api.sunrise-sunset.org/v2, returning JSON, with support for a single date, a range of up to 366 days in one request, or a full year in one call. Plain HTTP is supported alongside HTTPS, making it usable by IoT and embedded devices such as Arduino and ESP8266 boards that cannot make TLS connections.
Response data includes sunrise/sunset times, civil/nautical/astronomical twilight boundaries, dawn/dusk, first/last light, golden hour and blue hour windows, solar noon, day length, solar azimuth and altitude, and moonrise/moonset with moon phase and illumination percentage. Times are returned in ISO 8601 format in the local timezone of the given coordinates by default, with an option to request Unix epoch seconds or a different named timezone. The API distinguishes polar-day and polar-night conditions and marks non-occurring events as null rather than inferring them from other fields.
The API is free to use with no sign-up or API key required, subject to reasonable request volume limits enforced via HTTP 429 responses with a Retry-After header. Attribution with a visible link to sunrise-sunset.org is required in any application or page displaying the data. It is suited to developers building applications, embedded/IoT devices, or websites that need astronomical timing data for a given location.
Yes, it's free of charge for reasonable request volumes with no sign up or API key required. Attribution with a visible link to sunrise-sunset.org is required.
The API responds with a 429 status code and a Retry-After header telling you how many seconds to wait before trying again.
Responses are JSON, with times in ISO 8601 format by default (or Unix epoch seconds if requested), returned in the local timezone of the coordinates unless a different tz is specified.
Yes, plain HTTP is supported alongside HTTPS, which is handy for IoT and embedded devices such as Arduino and ESP8266 that cannot make TLS connections.
Yes, using date_start and date_end parameters you can request up to 366 days of data in a single request, avoiding the need for daily calls.
Show your product to thousands of developers
· 100k monthly pageviews
· 7k newsletter subscribers
Find satellite passes.
A free, open, dataset about research and scholarly activities.
Company, vehicle, launchpad and launch data.
With this API you can add each of the times introduced in the array sent.
Satellite information.
Earthquakes data real-time.