Sunrise, sunset and day length

$0.003 per call · failed calls are never charged · no account or API key needed

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.

Run it free (25 free calls) Buy credits by card (from $5) Example result (JSON)

Inputs

NameTypeDescription
lat (required)numberLatitude (-90 to 90)
lon (required)numberLongitude (-180 to 180)
datestringDate (default today)

Request

Over HTTP, with a card key from /credits:

curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/sun?lat=59.33&lon=18.07"

Or one of your 25 free calls, no key:

curl "https://agent-data-tools.revmesh2074.workers.dev/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, Monad, World Chain or Tempo) 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://agent-data-tools.revmesh2074.workers.dev/mcp

Related tools