Sunrise Sunset Search
Pricing
from $1.00 / 1,000 result fetcheds
Sunrise Sunset Search
Get sunrise, sunset, solar noon, day length & twilight times for any GPS coordinates worldwide. Fetch single dates or ranges up to 365 days. Returns civil, nautical & astronomical twilight. Free API, no key required.
Pricing
from $1.00 / 1,000 result fetcheds
Rating
0.0
(0)
Developer

ryan clinton
Actor stats
0
Bookmarked
2
Total users
0
Monthly active users
2 days ago
Last modified
Categories
Share
Sunrise Sunset Search retrieves precise sunrise, sunset, solar noon, day length, and twilight times for any location on Earth. Provide latitude and longitude coordinates, and the actor returns complete solar timing data in structured ISO 8601 UTC format -- ready for export, scheduling, or integration into your workflows.
The actor supports two modes: single-date lookup for quick queries, and date-range mode for fetching up to 365 consecutive days of solar data in one run. No API key is needed -- just coordinates and an optional date.
Why use Sunrise Sunset Search?
Tracking sunrise, sunset, and twilight times manually is tedious and error-prone, especially across multiple dates or locations. This actor automates the entire process and delivers structured, machine-readable results that plug directly into your tools and pipelines.
- No infrastructure to manage -- run on demand from the Apify platform without servers, cron jobs, or rate-limiting logic
- Batch date ranges in one run -- fetch up to 365 days of solar data with built-in request throttling and error handling
- Structured dataset output -- results are stored in Apify datasets, exportable as JSON, CSV, Excel, or XML with one click
- Schedule recurring runs -- track seasonal daylight changes automatically with Apify's built-in scheduler
- Connect to any tool -- integrate with Google Sheets, Slack, Zapier, Make, webhooks, or your own API clients
- Completely free data source -- no API key or paid subscription required for the underlying sunrise-sunset.org API
Key features
- Worldwide coordinate coverage -- supports any location on Earth with latitude (-90 to 90) and longitude (-180 to 180)
- Single date or date range -- fetch data for one specific date or a continuous range of up to 365 days
- 15 output fields per record -- sunrise, sunset, solar noon, day length, and all three twilight types with begin/end times
- Three twilight categories -- civil, nautical, and astronomical twilight begin and end times included in every record
- ISO 8601 UTC timestamps -- all times returned in standardized UTC format for reliable timezone conversion
- Human-readable day length -- day length provided in both raw seconds and formatted HH:MM:SS for immediate use
- Built-in rate limiting -- automatic 200ms delay between API requests prevents throttling during date range queries
- Error resilience -- gracefully handles API failures for individual dates within a range, continuing with remaining dates
- No authentication needed -- uses the free sunrise-sunset.org API with zero configuration
- Lightweight execution -- runs on 256 MB memory with minimal compute costs even for full-year queries
How to use
Apify Console
- Go to the Sunrise Sunset Search page on Apify Store.
- Click Try for free to open the actor in Apify Console.
- Enter the Latitude and Longitude of your target location (e.g.,
40.7128and-74.006for New York City). - Optionally set a specific Date in
YYYY-MM-DDformat, or leave the defaulttoday. - To fetch multiple days, enable Fetch Date Range and fill in Start Date and End Date.
- Click Start and wait for the run to complete.
- View and export results from the Dataset tab in JSON, CSV, Excel, or XML format.
Apify CLI
$apify call ryanclinton/sunrise-sunset-search --input='{"latitude":48.8566,"longitude":2.3522,"date":"2026-06-21"}'
Input parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
latitude | Number | Yes | 40.7128 | Latitude of the location. Range: -90 to 90. |
longitude | Number | Yes | -74.006 | Longitude of the location. Range: -180 to 180. |
date | String | No | today | Date in YYYY-MM-DD format, or the word "today". |
dateRange | Boolean | No | false | Enable to fetch data for a range of dates instead of a single date. |
startDate | String | No | -- | Start date for range mode (YYYY-MM-DD). Required when dateRange is true. |
endDate | String | No | -- | End date for range mode (YYYY-MM-DD). Required when dateRange is true. |
Single date example
{"latitude": 40.7128,"longitude": -74.006,"date": "2026-06-21"}
Date range example
{"latitude": 35.6762,"longitude": 139.6503,"dateRange": true,"startDate": "2026-03-01","endDate": "2026-03-31"}
Today's data (default)
{"latitude": -33.8688,"longitude": 151.2093}
Tips:
- Use Google Maps to find coordinates -- right-click any location to copy latitude and longitude.
- Use the Nominatim Geocoder actor to convert addresses or place names to coordinates.
- Always use
YYYY-MM-DDformat for dates (e.g.,2026-03-15).
Output
Each record in the output dataset contains 15 fields. Here is a representative example:
{"latitude": 48.8566,"longitude": 2.3522,"date": "2026-06-21","sunrise": "2026-06-21T03:47:22+00:00","sunset": "2026-06-21T19:57:41+00:00","solarNoon": "2026-06-21T11:52:32+00:00","dayLengthSeconds": 58219,"dayLengthFormatted": "16:10:19","civilTwilightBegin": "2026-06-21T03:07:15+00:00","civilTwilightEnd": "2026-06-21T20:37:48+00:00","nauticalTwilightBegin": "2026-06-21T02:08:44+00:00","nauticalTwilightEnd": "2026-06-21T21:36:19+00:00","astronomicalTwilightBegin": "2026-06-21T00:27:03+00:00","astronomicalTwilightEnd": "2026-06-21T23:18:00+00:00","extractedAt": "2026-06-21T12:00:00.000Z"}
In date range mode, the dataset contains one record per day for the entire specified range.
Fields reference
| Field | Type | Description |
|---|---|---|
latitude | Number | Latitude of the queried location. |
longitude | Number | Longitude of the queried location. |
date | String | The date for this record (YYYY-MM-DD). |
sunrise | String | Sunrise time in ISO 8601 UTC. |
sunset | String | Sunset time in ISO 8601 UTC. |
solarNoon | String | Solar noon time in ISO 8601 UTC (when the sun is at its highest point). |
dayLengthSeconds | Number | Total daylight duration in seconds. |
dayLengthFormatted | String | Total daylight duration formatted as HH:MM:SS. |
civilTwilightBegin | String | Start of civil twilight (sun 0--6 degrees below horizon). |
civilTwilightEnd | String | End of civil twilight. |
nauticalTwilightBegin | String | Start of nautical twilight (sun 6--12 degrees below horizon). |
nauticalTwilightEnd | String | End of nautical twilight. |
astronomicalTwilightBegin | String | Start of astronomical twilight (sun 12--18 degrees below horizon). |
astronomicalTwilightEnd | String | End of astronomical twilight. |
extractedAt | String | ISO 8601 timestamp of when the data was retrieved. |
Use cases
- Photography planning -- use civil twilight times to identify golden hour windows for sunrise and sunset photography shoots
- Solar energy analysis -- track day length across seasons to estimate solar panel output and plan energy production
- Agriculture and farming -- monitor daylight hours to optimize planting schedules, irrigation timing, and harvest windows
- Outdoor event planning -- determine exact sunset times when scheduling outdoor weddings, concerts, or festivals
- Astronomy observation -- use astronomical twilight times to know when the sky is dark enough for stargazing or telescope work
- Construction scheduling -- plan work shifts around available daylight hours, especially in high-latitude regions with extreme seasonal variation
- Travel preparation -- check sunrise and sunset times at your destination to plan activities and pack appropriately
- Wildlife research -- correlate animal behavior patterns with twilight periods and daylight duration across seasons
- Smart home automation -- feed sunrise/sunset data into home automation systems for lighting, blinds, and thermostat scheduling
- Education and research -- build datasets comparing day length at different latitudes for geography or earth science coursework
API & integrations
Python
from apify_client import ApifyClientclient = ApifyClient("YOUR_API_TOKEN")run = client.actor("FcVY5aej5MqaumfSs").call(run_input={"latitude": 40.7128,"longitude": -74.006,"date": "2026-06-21",})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(f"{item['date']}: Sunrise {item['sunrise']}, Sunset {item['sunset']}")
JavaScript
import { ApifyClient } from "apify-client";const client = new ApifyClient({ token: "YOUR_API_TOKEN" });const run = await client.actor("FcVY5aej5MqaumfSs").call({latitude: 51.5074,longitude: -0.1278,dateRange: true,startDate: "2026-06-01",endDate: "2026-06-30",});const { items } = await client.dataset(run.defaultDatasetId).listItems();items.forEach((item) => {console.log(`${item.date}: ${item.dayLengthFormatted} of daylight`);});
cURL
curl -X POST "https://api.apify.com/v2/acts/FcVY5aej5MqaumfSs/runs?token=YOUR_API_TOKEN" \-H "Content-Type: application/json" \-d '{"latitude": 48.8566,"longitude": 2.3522,"date": "2026-06-21"}'
Platform integrations
- Webhooks -- trigger notifications or downstream workflows when a run completes
- Zapier -- connect actor results to 5,000+ apps via the Apify Zapier integration
- Make (Integromat) -- build multi-step automations using sunrise/sunset data as a trigger or data source
- Google Sheets -- automatically export solar data to a spreadsheet for tracking and visualization
- Slack and email -- receive scheduled sunrise/sunset reports via Apify's notification integrations
- GitHub Actions -- trigger actor runs from CI/CD pipelines for automated data collection
How it works
- The actor receives input with latitude, longitude, and date parameters.
- Input is validated -- coordinate ranges are checked, and date range constraints are enforced.
- For single-date mode, one API request is made to
sunrise-sunset.orgwithformatted=0for ISO 8601 output. - For date-range mode, the actor iterates through each day in the range, making one API request per date with a 200ms delay between requests to respect rate limits.
- Each API response is transformed into a standardized output record with 15 fields.
- Failed requests for individual dates are logged and skipped -- the actor continues with remaining dates.
- All records are pushed to the Apify dataset for export and integration.
Input (lat, lng, date)|vValidate coordinatesand date parameters|v+-----+------+| |Single Date Date Range| |v v1 API Loop: 1 API callrequest per day (200ms delay)| |v vTransform each responseto 15-field output record|vPush to Apify Dataset(JSON, CSV, Excel, XML)
Performance & cost
| Scenario | API Calls | Duration | Estimated Cost |
|---|---|---|---|
| Single date lookup | 1 | ~2 seconds | < $0.001 |
| 7-day range (one week) | 7 | ~5 seconds | < $0.001 |
| 30-day range (one month) | 30 | ~10 seconds | < $0.005 |
| 90-day range (one quarter) | 90 | ~25 seconds | < $0.01 |
| 365-day range (full year) | 365 | ~90 seconds | ~$0.01 |
- Memory: 256 MB (minimum Apify allocation is sufficient)
- Platform fee: Apify charges based on compute units consumed. This actor uses minimal resources.
- API cost: The sunrise-sunset.org API is completely free with no usage limits published.
- Rate limiting: Built-in 200ms delay between requests in date range mode keeps requests well within acceptable bounds.
Limitations
- Coordinates only -- the actor requires latitude and longitude; it does not accept city names or addresses directly. Use the Nominatim Geocoder to convert addresses first.
- UTC timestamps only -- all times are returned in UTC. You must apply timezone offsets yourself to convert to local time.
- Maximum 365-day range -- date range queries are capped at 365 consecutive days per run. Split longer periods into multiple runs.
- One location per run -- each run queries a single latitude/longitude pair. To fetch data for multiple locations, run the actor multiple times or use the Apify API to batch runs.
- Depends on external API -- results rely on the sunrise-sunset.org API. If the API is temporarily unavailable, individual date requests may fail (the actor will skip them and continue).
- Historical and future dates -- the API supports a wide range of dates, but accuracy may decrease for dates far in the past or future due to the underlying solar calculation model.
- Polar regions -- at extreme latitudes during polar day or polar night, the API may return placeholder values when the sun does not rise or set.
Responsible use
- Respect API availability -- the actor includes built-in rate limiting (200ms between requests). Do not modify or bypass these delays to avoid overloading the free API.
- Cache when possible -- sunrise/sunset data for a given location and date does not change. Store results locally rather than re-fetching the same data repeatedly.
- Use reasonable date ranges -- while the actor supports up to 365 days, only request the range you actually need to conserve shared API resources.
- Attribute the data source -- if publishing or redistributing the data, credit sunrise-sunset.org as the original data provider.
- Comply with Apify terms -- usage of this actor is subject to the Apify Terms of Service.
FAQ
What coordinates format does the actor accept?
The actor accepts decimal degrees. Latitude ranges from -90 (South Pole) to 90 (North Pole). Longitude ranges from -180 to 180, where negative values are west of the Prime Meridian. For example, New York City is latitude 40.7128, longitude -74.006.
Do I need an API key to run this actor? No. The actor uses the free sunrise-sunset.org API, which requires no authentication. You only need an Apify account to run the actor on the platform.
What timezone are the results in? All times are returned in UTC (Coordinated Universal Time) in ISO 8601 format. To convert to local time, apply the appropriate UTC offset for your location and date. For example, US Eastern Standard Time is UTC-5, so subtract 5 hours.
What is the maximum date range I can query? You can fetch up to 365 consecutive days in a single run. For longer periods, split the query into multiple runs with consecutive date ranges.
What are the three types of twilight? Civil twilight is when the sun is 0--6 degrees below the horizon -- there is enough natural light for most outdoor activities without artificial lighting. Nautical twilight is when the sun is 6--12 degrees below the horizon -- the horizon line is still visible at sea. Astronomical twilight is when the sun is 12--18 degrees below the horizon -- the sky is dark enough for most astronomical observations.
Can I use city names instead of coordinates? Not directly. The actor requires numeric latitude and longitude values. Use the Nominatim Geocoder actor to convert any address, city name, or place name to coordinates first.
How do I find the latitude and longitude for my location? The easiest method is Google Maps -- right-click any point on the map and the coordinates will appear. You can also use the Nominatim Geocoder actor on Apify to geocode addresses programmatically.
What happens if the API fails for a date in my range? The actor handles individual date failures gracefully. It logs a warning for the failed date, skips it, and continues fetching data for the remaining dates in the range. The final dataset will contain records for all successfully fetched dates.
Can I schedule this actor to run automatically? Yes. Use Apify's built-in scheduler to run the actor daily, weekly, or on any cron schedule. This is useful for tracking seasonal changes in daylight or maintaining an up-to-date dataset for a specific location.
How accurate is the sunrise/sunset data? The data comes from the sunrise-sunset.org API, which uses well-established solar position algorithms. Results are accurate to within a minute for most locations and dates. Accuracy may vary slightly at extreme latitudes or for dates far in the future.
Does the actor work for locations in the Southern Hemisphere?
Yes. Use negative latitude values for Southern Hemisphere locations. For example, Sydney, Australia is latitude -33.8688, longitude 151.2093.
What happens during polar day or polar night? At extreme latitudes (above ~66 degrees), there are periods when the sun does not rise or does not set. The API may return special values for these dates. The actor will still return a record, but sunrise/sunset fields may contain placeholder timestamps.
Related actors
| Actor | Description | Link |
|---|---|---|
| Nominatim Geocoder | Convert addresses and place names to latitude/longitude coordinates | ryanclinton/nominatim-geocoder |
| Timezone Converter | Convert timestamps between timezones -- useful for converting UTC results to local time | ryanclinton/timezone-converter |
| Weather Forecast Search | Get weather forecast data for any location -- pairs well with sunrise/sunset data | ryanclinton/weather-forecast-search |
| NOAA Weather Alert Monitor | Monitor active weather alerts from the National Weather Service | ryanclinton/noaa-weather-alerts |
| NASA APOD Search | Search NASA's Astronomy Picture of the Day archive -- great for astronomy enthusiasts | ryanclinton/nasa-apod-search |
| ISS Location Tracker | Track the International Space Station in real time -- combine with twilight data for visibility planning | ryanclinton/iss-location-tracker |