Sunrise & Sunset
Calculate sunrise, sunset, solar noon, and day length for any location and date. Handles polar day and polar night.
⚡ 1 credit per call
Try it
Fill in the fields below and hit Send.
Why use this
LLMs can't reliably compute sunrise and sunset times. Use this for scheduling, event planning, astronomical queries, or any agent that needs to know whether it's daylight at a given location.
Input
| Field | Type | Required | Description |
|---|---|---|---|
lat |
number | ✓ | Latitude −90 to 90 |
lon |
number | ✓ | Longitude −180 to 180 |
date |
string | ✓ | Date in YYYY-MM-DD format |
Response
| Field | Type | Description |
|---|---|---|
sunrise_utc |
string | null | Sunrise time in HH:MM UTC. Null during polar day or polar night |
sunset_utc |
string | null | Sunset time in HH:MM UTC. Null during polar day or polar night |
solar_noon_utc |
string | Solar noon in HH:MM UTC — always present |
day_length_hours |
number | null | Hours of daylight. Null during polar day or polar night |
polar_day |
boolean | True if the sun never sets (Arctic/Antarctic summer) |
polar_night |
boolean | True if the sun never rises (Arctic/Antarctic winter) |
API Reference
Endpoint
POST https://api.lightningapi.tools/sunrise-sunset
Required headers
Authorization: Bearer <apiKey>
Content-Type: application/json
Example request
{
"lat": 53.33,
"lon": -6.25,
"date": "2024-06-21"
}
Example response
{
"sunrise_utc": "03:56",
"sunset_utc": "21:02",
"solar_noon_utc": "12:29",
"day_length_hours": 17.1,
"polar_day": false,
"polar_night": false
}