Sunrise and sunset times API
Sunrise, sunset, solar noon, civil dawn and dusk (UTC) and day length for any place and date, computed with the standard solar equations; handles polar day and night. No outside service. Use for photography, events and outdoor planning.
When to use it
- Get sunrise, sunset and day length for any coordinates and date
- Plan outdoor work or photography
Inputs
| Name | Type | Description |
|---|---|---|
lat (required) | number | Latitude (-90 to 90) |
lon (required) | number | Longitude (-180 to 180) |
date | string | Date (default today) |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://tools.funwords.eu/sun?lat=59.33&lon=18.07"
Or one of your 25 free calls, no key:
curl "https://tools.funwords.eu/sun?lat=59.33&lon=18.07&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"date": "2026-12-21",
"sunrise": "2026-12-21T07:43:00.000Z",
"sunset": "2026-12-21T13:48:00.000Z",
"solarNoon": "2026-12-21T10:45:00.000Z",
"civilDawn": "2026-12-21T06:58:00.000Z",
"civilDusk": "2026-12-21T14:33:00.000Z",
"dayLengthMinutes": 365,
"polar": null
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is sun, and the first 25 successful calls are free:
https://tools.funwords.eu/mcp
Questions
Is it computed or looked up?
Computed from the coordinates and date.
How do I pay?
Each successful call costs $0.01; failed calls are not charged. The first 25 calls are free. Then pay with card credits (from $1; the key goes in an Authorization header or, for clients that can only fetch a URL, as api_key= in the URL) or per call in USDC over x402 or MPP. No account is needed.