S

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 like today, 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.

Details

Monthly Tool Calls
311225
Remote
Yes
Published
8/20/2025
Β© 2025 XPack. All rights reserved.