Sunrise & Sunset Times API

Daylight times for any latitude and longitude on any list of dates: sunrise, sunset, solar noon, day length and civil, nautical and astronomical twilight, in UTC. Built for tour operators, photographers and event planners.

$0.50 per 1,000 records

You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.

Try it
Ready-made, maintained by usRecords, 14 fieldsv1.0

Data from sunrise-sunset.org/api

Get this data

Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.

Try it

Latitude
Latitude in decimal degrees, such as 43.65.
Example: 43.65
Longitude
Longitude in decimal degrees, such as -79.38.
Example: -79.38
Dates
Dates as yyyy-mm-dd, such as ["2026-12-21"]. One per line, or separated by commas.
Example: 2026-12-21

Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key

For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
Endpoint
POSThttps://pullrow.dev/v1/apis/sunrise-sunset-times/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
10,000 free records of this API to start. No card.
curl
curl -X POST "https://pullrow.dev/v1/apis/sunrise-sunset-times/run" \
  -H "Authorization: Bearer $PULLROW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "latitude": "43.65",
    "longitude": "-79.38",
    "dates": [
      "2026-12-21"
    ]
  },
  "max_items": 50
}'

Inputs

Send them as input in the request body. Leave one out to use its default.

latitudetextrequired
Latitude in decimal degrees, such as 43.65.
example: 43.65
longitudetextrequired
Longitude in decimal degrees, such as -79.38.
example: -79.38
dateslistrequired
Dates as yyyy-mm-dd, such as ["2026-12-21"].
example: 2026-12-21

What's in each record

14 fields: 13 here, 1 technical one under Technical details.

Basics

  • Day length (seconds)

    Length of daylight in seconds.

    Example 32,150

Location

  • Latitude

    Latitude asked for.

    Example 43.65

  • Longitude

    Longitude asked for.

    Example -79.38

Dates

  • Date

    The day the times are for.

    Example Dec 21, 2026

  • Sunrise (UTC)

    Example Dec 21, 2026

  • Sunset (UTC)

    Example Dec 21, 2026

  • Solar noon (UTC)

    Example Dec 21, 2026

  • Civil twilight begin

    Start of civil twilight (UTC).

    Example Dec 21, 2026

  • Civil twilight end

    End of civil twilight (UTC).

    Example Dec 21, 2026

  • Nautical twilight begin

    Start of nautical twilight (UTC).

    Example Dec 21, 2026

  • Nautical twilight end

    End of nautical twilight (UTC).

    Example Dec 21, 2026

  • Astronomical twilight begin

    Start of astronomical twilight (UTC).

    Example Dec 21, 2026

  • Astronomical twilight end

    End of astronomical twilight (UTC).

    Example Dec 21, 2026

Technical detailsField names and types for developers, and the 1 field hidden above

Hidden by default

This field comes with each record too. It is an internal code, a note about how the record was read or a copy of what was searched for, so the lists above leave it out.

  • ID idLatitude, longitude and date joined, unique for each record.

Field names and types

The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.

Field nameTypeShown on this page asFilled
idtextID (hidden)3 of 3
datedateDate3 of 3
latitudenumberLatitude3 of 3
longitudenumberLongitude3 of 3
sunrisedate and timeSunrise (UTC)3 of 3
sunsetdate and timeSunset (UTC)3 of 3
solar_noondate and timeSolar noon (UTC)3 of 3
day_length_secondsnumberDay length (seconds)3 of 3
civil_twilight_begindate and timeCivil twilight begin3 of 3
civil_twilight_enddate and timeCivil twilight end3 of 3
nautical_twilight_begindate and timeNautical twilight begin3 of 3
nautical_twilight_enddate and timeNautical twilight end3 of 3
astronomical_twilight_begindate and timeAstronomical twilight begin3 of 3
astronomical_twilight_enddate and timeAstronomical twilight end3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordDay length (seconds)LatitudeLongitudeDateSunrise (UTC)Sunset (UTC)Solar noon (UTC)Civil twilight beginCivil twilight endNautical twilight beginNautical twilight endAstronomical twilight beginAstronomical twilight end
132,15043.65-79.38Dec 21, 2026Dec 21, 2026Dec 21, 2026Dec 21, 2026Dec 21, 2026Dec 21, 2026Dec 21, 2026Dec 21, 2026Dec 21, 2026Dec 21, 2026
232,15243.65-79.38Dec 22, 2026Dec 22, 2026Dec 22, 2026Dec 22, 2026Dec 22, 2026Dec 22, 2026Dec 22, 2026Dec 22, 2026Dec 22, 2026Dec 22, 2026
332,15843.65-79.38Dec 23, 2026Dec 23, 2026Dec 23, 2026Dec 23, 2026Dec 23, 2026Dec 23, 2026Dec 23, 2026Dec 23, 2026Dec 23, 2026Dec 23, 2026

Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.

Reliability

Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.

Incidents and repairs

How it is kept working What a repair can't do

A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.

  • You pay only for records returned. A run that returns none costs nothing.
Known limits
  • One request per date, so a long list of dates takes time: requests are spaced about 1 second apart.
  • Times are returned in UTC (ISO 8601); the local time zone is carried in time_zone only as the name you asked for.
  • In polar regions on days without a sunrise, sunset or twilight, those fields are empty.
  • Data comes from sunrise-sunset.org, which asks that you show a visible attribution link to sunrise-sunset.org when you publish it.
  • At most 366 dates per run.

Version history

A run uses the live version unless the request names another one with version.