Sunrise, Sunset & Moon Phase API: Any Place, Any Date
Pricing
$1.00 / 1,000 sun & moon lookups
Sunrise, Sunset & Moon Phase API: Any Place, Any Date
Sunrise, sunset, dawn, dusk, solar noon, day length, golden and blue hour, moonrise, moonset, moon phase and illumination for any city or coordinates and date range, in local time.
Pricing
$1.00 / 1,000 sun & moon lookups
Rating
0.0
(0)
Developer
Tudor Lane
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
8 days ago
Last modified
Categories
Security
Limited permissionsShare
Use when: an AI agent or app needs sunrise, sunset, golden hour, day length or moon phase for a city or coordinates on a given date (photo shoots, outdoor events, travel plans, prayer or fasting times, wedding planning), in the place's local time, without guessing.
Try this input
{"requests": ["Reykjavik", {"location": "Sydney, AU", "date": "2026-12-25", "days": 2}, {"lat": 78.22, "lon": 15.65, "date": "2026-12-21"}]}
Sample output (real run, 30 Oct 2026, trimmed)
{"query": "Sydney, AU", "place": "Sydney, New South Wales, Australia", "lat": -33.86785, "lon": 151.20732, "timezone": "Australia/Sydney", "days": [{"date": "2026-12-25", "dawn": "2026-12-25T05:13:15+11:00", "sunrise": "2026-12-25T05:42:58+11:00", "noon": "2026-12-25T12:54:58+11:00","sunset": "2026-12-25T20:07:00+11:00", "dusk": "2026-12-25T20:36:43+11:00", "day_length": "14:24:01","golden_hour_morning": ["2026-12-25T05:24:33+11:00", "2026-12-25T06:18:52+11:00"],"golden_hour_evening": ["2026-12-25T19:31:07+11:00", "2026-12-25T20:25:25+11:00"],"blue_hour_evening": ["2026-12-25T20:25:25+11:00", "2026-12-25T20:36:43+11:00"],"moon_phase_day": 15.5, "moon_phase": "full moon", "moon_illumination_pct": 99,"moonrise": "2026-12-25T21:32:00+11:00", "moonset": "2026-12-25T06:25:00+11:00"}, "..."], "error": null}{"query": "78.22,15.65", "place": null, "timezone": "Arctic/Longyearbyen", "days": [{"date": "2026-12-21", "polar": "polar night (sun never rises)", "moon_phase": "waxing gibbous", "moon_illumination_pct": 86}], "error": null}
Options (each item in requests is a place name string or an object):
location: city or "City, Country" (e.g."Paris","Sydney, AU"), orlat+lonin decimal degrees.date:YYYY-MM-DD, default today in the place's time zone.days: 1-31 consecutive days, default 1.timezone: IANA name (e.g."Europe/London") to override the detected zone.
Each day has dawn, sunrise, noon, sunset, dusk (civil), day_length, golden_hour_morning/evening and blue_hour_evening as [start, end], moon_phase_day (0-29.5), moon_phase, moon_illumination_pct, moonrise, moonset (null when the moon doesn't rise/set that day), or polar on days with midnight sun or polar night. Up to 2000 items per run; no API key needed.
Pricing: pay per event, $0.001 per sun & moon lookup (one place, up to 31 days). Rows with errors (e.g. place not found) are not charged.
Limits & failure modes
- Times are for sea level with standard refraction; expect ±1-2 minutes, more in mountains or near the poles.
- Ambiguous names pick the most populous match; add the country or pass lat/lon.
- Moonrise/moonset at high latitudes (e.g. Iceland) can come back null on days the moon does rise; treat as approximate above ~60°.
- Illumination % is an approximation from the phase age, not an ephemeris value.
- Calculated locally with astral (Apache 2.0). Place names: GeoNames (CC BY 4.0). Time zones: timezonefinder (MIT).
Last tested: 30 Oct 2026.
Use from AI agents (MCP)
- Apify MCP server: add
https://mcp.apify.com/?tools=tudorlane/sun-moon-timesto Claude, Cursor, ChatGPT, VS Code or any MCP client. - REST:
POST https://api.apify.com/v2/acts/tudorlane~sun-moon-times/run-sync-get-dataset-items?token=YOUR_TOKENwith the input JSON.