Location Information

Sunrise-Sunset

by sunrise-sunset.org

Location Information Added on October 31st, 2026 Checked and working on November 16th, 2026
Visit sunrise-sunset.org →

What it does

The Sunrise-Sunset API gives the times of sunrise, sunset, solar noon and civil, nautical and astronomical twilight for any coordinates and date. Times are returned in UTC, or in a time zone you choose, as JSON. Useful for apps that switch to a dark theme at sunset or plan outdoor activities. Free, no key needed; the provider asks for a link back.
  • API
  • HTTP-GET
  • JSON
  • REST

At a glance

API key
Not needed · More APIs with no key
Pricing
Free, no key needed; the provider asks for a link back.
From the browser
Yes (CORS)
Formats
JSON
Interface
REST, HTTP-GET
Provider
sunrise-sunset.org
Last checked
Working on November 16th, 2026

More information: https://sunrise-sunset.org/api

Is this your service? Show that it is listed

Put this badge on your website or in your README; it links to this page. About the badge

Listed on Free Web Services

sunrise-sunset.org
Sunrise-Sunset

Example request

curl

curl 'https://api.sunrise-sunset.org/json?lat=51.5&lng=-0.12&date=today'

JavaScript

const response = await fetch("https://api.sunrise-sunset.org/json?lat=51.5&lng=-0.12&date=today");
const data = await response.json();
console.log(data);

Python

import requests

response = requests.get(
    "https://api.sunrise-sunset.org/json?lat=51.5&lng=-0.12&date=today",
    timeout=30,
)
print(response.json())

The JavaScript works in a web page as well as in Node.js 18 or newer.

Did it work for you?

Tell us what you found when you tried Sunrise-Sunset.