Date & Time

Sunrise & Sunset API

Compute sunrise, sunset, solar noon, and day length for any location and date using the NOAA solar algorithm.

Request Headers

Name Required Description
X-RapidAPI-Key required Your RapidAPI key. Get one free.
X-RapidAPI-Host required sunrise-sunset.p.rapidapi.com

Endpoints

GET /v1/astronomy/sun

Compute sunrise, sunset, solar noon, and day length for a location

Parameters

NameTypeRequiredDefaultConstraints
datestringrequired—matches \S
latnumberrequired—-90-90
lonnumberrequired—-180-180

Code Examples

curl --request GET \
  --url 'https://sunrise-sunset.p.rapidapi.com/v1/astronomy/sun?date=example&lat=0&lon=0' \
  --header 'x-rapidapi-key: YOUR_API_KEY' \
  --header 'x-rapidapi-host: sunrise-sunset.p.rapidapi.com'

Interactive Example

sunrise-sunset
$ GET /v1/astronomy/sun?lat=51.5074&lon=-0.1278&date=2026-06-21
{"sunrise":"2026-06-21T03:43:00Z","sunset":"2026-06-21T20:21:00Z","solar_noon":"2026-06-21T12:02:00Z","day_length_hours":16.64}

Subscribe & License

Access this API with commercial-ready tiers on RapidAPI. Flexible plans designed for side-projects, startups, and high-volume production architectures.

View Pricing & Subscribe

Developer Support

Need help integrating or have a custom endpoint request? Our engineering team is here to assist with authentication, payload schemas, and high-frequency rate limit increases.

Contact API Engineering

System Performance

Monitored 24/7 with a 99.9% uptime SLA. Built atop cloud-native microservices with globally distributed edge caching to ensure ultra-low latency response times.

All Systems Operational