Sunrise and Sunset
Sunset and sunrise times for a given latitude and longitude
- Authentication
- No auth
- HTTPS
- Yes
- CORS
- No
- Category
- Science & Math
- Documentation / URL
- https://sunrise-sunset.org/api
Overview
The Sunrise-Sunset API returns sunrise, sunset, dawn, dusk and solar-noon times for any latitude/longitude — free, keyless, and dependency-free. A handy utility for photography planning, smart-home lighting, and outdoor apps.
Quick Start
Sun times for a location (verified live):
curl "https://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42"
{
"results": {
"sunrise": "5:40:22 AM",
"sunset": "7:08:21 PM",
"solar_noon": "12:24:21 PM",
"day_length": "13:27:59",
"civil_twilight_begin": "5:12:21 AM",
"civil_twilight_end": "7:36:22 PM",
"nautical_twilight_begin": "4:38:36 AM",
"nautical_twilight_end": "8:10:07 PM",
"astronomical_twilight_begin": "4:03:07 AM",
"astronomical_twilight_end": "8:45:37 PM"
},
"status": "OK"
}
Specify a date:
curl "https://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42&date=2026-12-21"
24-hour format:
curl "https://api.sunrise-sunset.org/json?lat=36.72&lng=-4.42&formatted=0"
Authentication
None — keyless.
Rate Limits & Notes
- Free; no documented hard limit — be polite.
- Times are local to the requested coordinates (the API returns them in the location’s timezone).
formatted=0returns ISO-8601 timestamps instead of human strings.- Requires decimal
lat/lng;dateis optional (defaults to today).
FAQ
Is Sunrise-Sunset free? Yes — free and keyless.
Are times in my timezone? They’re in the timezone of the requested coordinates — not your local timezone.
Can I get ISO timestamps?
Yes — add formatted=0.
More in Science & Math
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| arcsecond.io Multiple astronomy data sources | No auth | Yes | Unknown | ↗ |
| arXiv Curated research-sharing platform: physics, mathematics, quantitative finance, and economics | No auth | Yes | Unknown | ↗ |
| CodeCogs Render LaTeX equations in PNG, GIF, SVG, EMF, PDF, JSON, or download formats with styling options | No auth | Yes | Unknown | ↗ |
| CORE Access the world's Open Access research papers | API Key | Yes | Unknown | ↗ |
| CycleCalcs Interpreted astronomy: sun and moon times, moon phases, planets, eclipses, seasons | No auth | Yes | Yes | ↗ |