Use cases
- Weather and astronomy applications
- Smart home and lighting schedules
- Photography, outdoor, and travel tools
- Backend jobs and location-based automations
Retrieve sunrise, sunset, solar noon, and day length data using latitude and longitude. The API returns lightweight JSON, supports optional date lookups, and is simple to use from web, mobile, backend, and automation workflows.
This page is designed to answer the search intent behind queries like sunrise API, sunset API, solar noon API, and free API for sunrise and sunset times. It gives a direct endpoint, clear parameter rules, and a predictable response structure.
Use the endpoint below to request sunrise and sunset data for any latitude and longitude pair.
GET /api?lat=55.8355&lng=13.3019
lat: latitude between -90 and 90lng: longitude between -180 and 180date: optional YYYY-MM-DD value/api?lat=40.7128&lng=-74.0060
/api?lat=40.7128&lng=-74.0060&date=2026-04-25
The second request fetches sunrise and sunset data for a specific date.
curl "https://your-domain.com/api?lat=40.7128&lng=-74.0060" curl "https://your-domain.com/api?lat=40.7128&lng=-74.0060&date=2026-04-25"
{
"results": {
"sunrise": "2026-04-25T10:02:45+00:00",
"sunset": "2026-04-25T23:48:10+00:00",
"solar_noon": "2026-04-25T16:55:28+00:00",
"day_length": "13:45:25"
},
"status": "OK",
"tzid": "UTC"
}