VerticalsIndustriesMCP ServerDocsPricingContactSign in

Sunrise Sunset API

Time everything to the light.

Pxie's sunrise sunset API returns sunrise, sunset and the twilight stage for any coordinates and date, calculated for the exact spot rather than the nearest city.

Plan: Free plan.

Coverage: Anywhere on Earth, any date through 2100.

Example, not a live readingSunset 18:52 at the venueAstronomical twilight at 20:30
Features

Sun times and astronomical twilight.

Sunrise and sunset times

Sunrise and sunset for any location and date through 2100, plus the sun's height and direction at any moment.

Astronomical twilight, at any moment

The twilight stage for the moment you ask about: day, civil, nautical or astronomical twilight, or full night. Query a sequence of times to find when each stage begins.

Darkness score

A simple score from full daylight to full night, so apps can tell when the sky is truly dark.

Where sun times earn their place.

Photographers and filmmakers

Golden hour and blue hour depend on exactly where you stand. Get sunrise and sunset for the coordinates of a lake, a ridge or a venue, and the sun's height and direction at any moment, to plan the shot before you travel.

Tour operators and venues

Time departures, outdoor ceremonies and sunset cruises to the real light at the site, not a nearby city's table. Times work for any date through 2100, so an event booked two years out can be planned today.

Astronomy and night photography

The twilight stage tells you whether it is day, civil, nautical or astronomical twilight, or full night, at the moment you ask. Query a sequence of times to find when truly dark skies begin and end, and use the darkness score for a simple read from full daylight to full night.

Apps and automation

Smart-home schedules, trail and camping apps, drone planners and field-crew tools can switch on sun position instead of a fixed clock time. Everything is clean JSON, free to start and available to AI assistants through the Pxie MCP server.

Pair it with other Pxie data

Combine sun times with the moon phase API to find moonless nights, the astronomy weather forecast for clear skies, and the aurora forecast for the best night to look up.

Calculated for your exact spot

Every time is worked out by Pxie for the coordinates and date you send, not looked up from a table for the nearest city. That matters in valleys, on coasts and at high latitudes, where the sun can rise or set minutes away from a city's published time.

Free to start

Sun data is included on the free plan, so you can build and test without a card, then add other Pxie data as your product grows.

Example, not a live reading

Sunset 18:52 at the venue

Astronomical twilight at 20:30

Ask your AI assistant

"When is sunset at Moraine Lake on Saturday?"

Pxie answers with the get_sun tool. Environmental data MCP server →

Sunrise Sunset API questions.

Is the sunrise sunset API free?

Yes. Sun data is included on the free plan.

Does it return astronomical twilight start and end times?

It returns the twilight stage for any moment you ask about. Query a sequence of times to find when astronomical twilight begins and ends.

How accurate is it?

Times are calculated by Pxie for your exact coordinates and date, not taken from a city table.

Add accurate sun times to your app.

Start free, or tell us what you are building.

Developers: Sunrise Sunset API docs →