Sun Position API — sunrise, sunset & golden hour times avatar

Sun Position API — sunrise, sunset & golden hour times

Pricing

from $0.35 / 1,000 sun data rows

Go to Apify Store
Sun Position API — sunrise, sunset & golden hour times

Sun Position API — sunrise, sunset & golden hour times

Compute sunrise, sunset, golden hour and twilight times plus the sun's elevation and azimuth for any locations and dates, in each location's local time zone. One row per location and date, or per location and time.

Pricing

from $0.35 / 1,000 sun data rows

Rating

0.0

(0)

Developer

AI Mojo

AI Mojo

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Categories

Share

Sun position API — sunrise, sunset, golden hour and twilight times

Sun Position API computes sunrise, sunset, solar noon, day length, golden hour, blue hour and civil, nautical and astronomical twilight times, plus the sun's elevation and azimuth, for any list of locations and dates. Every time is given in each location's local time zone, which is looked up from its coordinates. You get one row per location and date, or one row per location and time when you set a step in minutes. It is built for photographers planning golden hour and blue hour shoots, solar engineers and architects studying sun angles and shading, agriculture teams tracking day length, and app developers who need sun times in bulk without running their own calculations. To try it, press Start: the prefilled Greenwich Observatory example returns its result in seconds.

How to get sunrise, sunset and golden hour times

  1. Add your places to Locations as a JSON list. Each location needs a latitude and a longitude, and can have a name.
  2. Set Start date, and optionally End date to compute a range of local calendar dates.
  3. Optionally set Step (minutes) to get the sun elevation and sun azimuth through each day, for example every 15 minutes.
  4. Optionally set Time zone to use one IANA time zone for every location instead of each location's own local time zone.
  5. Press Start and wait for the run to finish.
  6. Open the Output tab to view the rows, then download them as JSON, CSV, Excel, XML or HTML.
  7. To automate it, call the actor through the Apify API, or connect it to Make, Zapier, Google Sheets or a webhook with Apify integrations.

Input

FieldTypeDefaultDescription
locationsarray of objectsnone (required)The places to compute sun times and sun positions for. Each has a latitude (-90 to 90), a longitude (-180 to 180, east positive) and an optional name. Up to 1,000 locations.
startDatestringnone (required)The first local calendar date to compute, as YYYY-MM-DD.
endDatestringthe start dateThe last local calendar date to compute, as YYYY-MM-DD, at most 366 days after the start date counting both.
stepMinutesintegernoneWhen set (1 to 1440), returns one row per location for every step through each local day, with the sun's elevation and azimuth at that time. Leave empty for one row per location per date.
timeZonestringlooked up per locationAn IANA time zone name such as Europe/London, used for every location instead of the zone looked up from its coordinates.

Example input (the prefilled values):

{
"locations": [{ "name": "Greenwich Observatory", "latitude": 51.4769, "longitude": -0.0005 }],
"startDate": "2026-06-21"
}

Output

Each dataset item is one location and local date (a once-per-day row), or one location and time when Step (minutes) is set. A sun event that does not happen on the date is null.

Example row for the prefilled input. On the June solstice the sun never sinks 18° below the horizon at Greenwich, so astronomical twilight is null:

{
"id": "51.4769,-0.0005,2026-06-21",
"name": "Greenwich Observatory",
"latitude": 51.4769,
"longitude": -0.0005,
"timeZone": "Europe/London",
"date": "2026-06-21",
"time": null,
"elevation": null,
"azimuth": null,
"polar": null,
"sunrise": "2026-06-21T04:43:59+01:00",
"sunset": "2026-06-21T21:22:01+01:00",
"solarNoon": "2026-06-21T13:03:00+01:00",
"dayLengthMinutes": 998.03,
"civilDawn": "2026-06-21T03:56:17+01:00",
"civilDusk": "2026-06-21T22:09:43+01:00",
"nauticalDawn": "2026-06-21T02:41:50+01:00",
"nauticalDusk": "2026-06-21T23:24:10+01:00",
"astronomicalDawn": null,
"astronomicalDusk": null,
"goldenHourMorningStart": "2026-06-21T04:15:45+01:00",
"goldenHourMorningEnd": "2026-06-21T05:38:11+01:00",
"goldenHourEveningStart": "2026-06-21T20:27:49+01:00",
"goldenHourEveningEnd": "2026-06-21T21:50:14+01:00",
"blueHourMorningStart": "2026-06-21T03:56:17+01:00",
"blueHourMorningEnd": "2026-06-21T04:15:45+01:00",
"blueHourEveningStart": "2026-06-21T21:50:14+01:00",
"blueHourEveningEnd": "2026-06-21T22:09:43+01:00"
}

All times are local time in the location's time zone, as ISO 8601 with that zone's offset.

FieldTypeDescription
idstringStable row ID: <latitude>,<longitude>,<date>, plus ,<UTC instant> for a row at a specific time. It stays the same across runs.
namestring or nullThe location's name as given in the input.
latitudenumberThe location's latitude in decimal degrees (north positive).
longitudenumberThe location's longitude in decimal degrees (east positive).
timeZonestringThe location's IANA time zone, for example Europe/London.
datestringThe local calendar date, YYYY-MM-DD. All sun events in the row happen on this date.
timestring or nullThe instant the sun elevation and sun azimuth are computed for. Null for a once-per-day row.
elevationnumber or nullSun elevation above the horizon in degrees (negative below it), geometric, without atmospheric refraction. Null when time is null.
azimuthnumber or nullSun azimuth in degrees clockwise from true north (0 to 360). Null when time is null.
polarstring or nullPolar day or night: day when the sun never sets on the date, night when it never rises, otherwise null.
sunrisestring or nullWhen the sun's upper edge rises above the horizon.
sunsetstring or nullWhen the sun's upper edge sets below the horizon.
solarNoonstring or nullWhen the sun is highest in the sky.
dayLengthMinutesnumberMinutes from sunrise to sunset; 1440 in polar day and 0 in polar night.
civilDawnstring or nullCivil twilight begins: the sun's center rises to 6° below the horizon.
civilDuskstring or nullCivil twilight ends: the sun's center sets to 6° below the horizon.
nauticalDawnstring or nullNautical twilight begins: the sun rises to 12° below the horizon.
nauticalDuskstring or nullNautical twilight ends: the sun sets to 12° below the horizon.
astronomicalDawnstring or nullAstronomical twilight begins: the sun rises to 18° below the horizon.
astronomicalDuskstring or nullAstronomical twilight ends: the sun sets to 18° below the horizon.
goldenHourMorningStartstring or nullMorning golden hour starts: the sun rises to 4° below the horizon.
goldenHourMorningEndstring or nullMorning golden hour ends: the sun rises to 6° above the horizon.
goldenHourEveningStartstring or nullEvening golden hour starts: the sun sets to 6° above the horizon.
goldenHourEveningEndstring or nullEvening golden hour ends: the sun sets to 4° below the horizon.
blueHourMorningStartstring or nullMorning blue hour starts: the sun rises to 6° below the horizon.
blueHourMorningEndstring or nullMorning blue hour ends: the sun rises to 4° below the horizon.
blueHourEveningStartstring or nullEvening blue hour starts: the sun sets to 4° below the horizon.
blueHourEveningEndstring or nullEvening blue hour ends: the sun sets to 6° below the horizon.

The run also saves a short summary in the Run summary output.

Pricing

This actor uses pay-per-event pricing: you pay for each sun data row delivered to your dataset, and nothing for pages or requests.

How much does it cost to get 1,000 results?

$0.50 per 1,000 sun data rows ($0.0005 per row), lower on paid Apify plans.

  • You're charged only for rows delivered to your dataset.
  • The run stops when it reaches your maximum charge per run setting, so you never pay more than you set.
  • Apify adds a small fee for each run start.

For example, one location for a full year of dates is 365 rows, about $0.18. One location every 15 minutes for a typical 24-hour day is 96 rows, about $0.05.

Limits & accuracy

  • Up to 1,000 locations, 366 days and 1,000,000 rows per run. A larger input is rejected before any row is computed.
  • Sun elevation and sun azimuth are within about half a degree of NOAA's solar calculator when the sun is more than 5° above the horizon.
  • Sun elevation is geometric: no atmospheric refraction is applied, so near the horizon it reads a little lower than what you see.
  • In polar day or polar night, polar is day or night and sunrise and sunset are null.

Compliance & licences

  • All results are computed. No website or API is contacted at run time, and no personal data is collected.
  • Sun times and positions use the suncalc library, BSD-2-Clause licence, Copyright (c) 2014, Vladimir Agafonkin.
  • Time zones are looked up offline with the tz-lookup library, released under CC0 1.0 by The Dark Sky Company, LLC. This licence covers the library itself.
  • The time zone boundary data inside tz-lookup is sourced from Evan Siroky's timezone-boundary-builder, which is built from OpenStreetMap. That upstream project's own README ("Licenses" section) states that its output data is licensed under the Open Data Commons Open Database License (ODbL). Time zone boundary data © OpenStreetMap contributors.

FAQ

The actor collects nothing from any website: every sunrise, sunset and sun position is calculated from astronomy formulas, and no personal data is involved. You are still responsible for how you use the data; if you are unsure, ask a lawyer about your use case.

Which time zone are the times in?

Each location's local time zone, looked up from its coordinates. A point at sea gets a fixed-offset zone such as Etc/GMT+3. Set Time zone to use one zone for every location.

Why are some golden hour or twilight times null?

Near the poles, or near midsummer at high latitudes, the sun may never reach that angle on the date. The field is then null rather than a guess.

Where can I report an issue or request a feature?

Open the Issues tab on this actor's page and describe the input and what you expected.