Sunrise Sunset API

GET

Track exact sunrise, sunset, and twilight phases for any location.

Sunrise Sunset calculates exact sunrise and sunset times, twilight stages, and golden hour windows for any latitude and longitude coordinates. Paid plans can specify custom dates and receive solar noon.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/sunrisesunset?lat=36.7201600&lon=-4.4203400
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "solarNoon": "2025-12-16T12:14:40.51Z",
    "sunrise": "2025-12-16T07:24:56.165Z",
    "sunset": "2025-12-16T17:04:24.854Z",
    "sunriseEnd": "2025-12-16T07:27:58.828Z",
    "sunsetStart": "2025-12-16T17:01:22.192Z",
    "dawn": "2025-12-16T06:56:02.774Z",
    "dusk": "2025-12-16T17:33:18.245Z",
    "nauticalDawn": "2025-12-16T06:23:38.134Z",
    "nauticalDusk": "2025-12-16T18:05:42.886Z",
    "nightEnd": "2025-12-16T05:52:07.048Z",
    "night": "2025-12-16T18:37:13.971Z",
    "goldenHourEnd": "2025-12-16T08:05:08.406Z",
    "goldenHour": "2025-12-16T16:24:12.613Z"
  }
}

About the Sunrise Sunset API

Sunrise Sunset works by calculating the sunrise and sunset times based on the location and date provided. It returns the sunrise and sunset times in a structured format.

What people use it for

Golden Hour Photography
Camera apps check golden hour start and civil twilight times to alert photographers when optimal natural lighting begins.
Municipal Lighting Automation
Smart lighting controllers switch streetlights and architectural fixtures on at sunset and off at dawn based on coordinate lookups.
Visual Flight Dispatch
Before dispatching visual flight rules flights, aviation platforms check nautical dawn and dusk to verify legal daylight operating hours.
Agricultural Spray Scheduling
To schedule field treatments during cooler periods, farm management systems use sunrise and dusk timestamps to plan early morning passes.

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Sunrise Sunset

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Sunrise Sunset API.

Read the docs
How many sunrise and sunset lookups does the Free plan cover?
The Free plan covers 100 lookups each month at 2 credits per request. Upgrading to the Starter plan gives you 200,000 credits, enough for up to 100,000 lookups each month, which works out to about $0.30 per 1,000 calls. Credits reset at the start of each billing cycle.
Can I look up past or future dates and solar noon on the Free plan?
Solar noon and the custom date parameter require a paid plan. The Free plan returns standard sunrise, sunset, and twilight times for the current day, while any paid plan unlocks queries for specific dates alongside solar noon times.
Does this calculate twilight and golden hour times?
Yes. Beyond sunrise and sunset, the calculation returns timestamps for morning and evening golden hours, civil dawn and dusk, nautical dawn and dusk, and astronomical night boundaries in UTC.
Does the API work for any global coordinate?
Yes. You can supply any valid latitude and longitude coordinates to calculate solar times anywhere in the world.
Can I display these solar times in a commercial product?
Yes, commercial use is permitted on any paid plan. You can calculate and display solar timings inside your own software, but you may not resell or redistribute the raw data as a standalone service.

Ready to build with Sunrise Sunset? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs