Sunrise and Sunset Times API
@Sunrise Sunset
Get sunrise and sunset times for a given latitude and longitude. Data courtesy of https://sunrise-sunset.org
🌅 Sunrise & Sunset MCP
The Sunrise and Sunset API (by sunrise-sunset.org) makes it effortless to retrieve accurate sunrise, sunset, and twilight times anywhere in the world.
By converting it into an MCP service, you can let AI agents answer questions like “When is sunset in New York tomorrow?” or “How long is the day in Tokyo today?” in natural conversation.
🔑 API Features
☀️ Core Endpoint
GET /json
→ Returns sunrise, sunset, and twilight data.
Parameters supported:
lat
&lng
→ Latitude/longitude (required).date
→ Specific date (YYYY-MM-DD
), or keywords liketoday
,tomorrow
.formatted
→1
= human-readable (AM/PM),0
= ISO 8601 +day_length
in seconds.tzid
→ IANA timezone (e.g.,America/New_York
). Defaults to UTC.callback
→ Optional JSONP.
Response includes:
sunrise
,sunset
,solar_noon
day_length
(in hh:mm:ss or seconds)- Twilight phases:
civil
,nautical
,astronomical
begin/end
📌 Example Use Cases
- 🌍 Travel Apps — Show day length and golden hour for photographers.
- 🧘 Wellness Platforms — Sync meditation or sleep routines with sunrise/sunset.
- 🔭 Astronomy Apps — Calculate twilight times for stargazing events.
- 🤖 Personal AI Assistants — Conversational answers: “How long is the day in London next Monday?”
⚡ Powered by XPack
With XPack, this simple but powerful API becomes a ready-to-use MCP service:
- 🚀 Expose natural queries like “What time is sunset in Paris?”
- 💡 Combine with weather APIs to build smarter outdoor planners.
- 💸 Monetize your MCP with per-call billing or bundle into travel/astro toolkits.
👉 The Sunrise & Sunset MCP shows how even small datasets can power delightful user experiences when wrapped with XPack.