Person looking at the moon through telescope

Astronomy API

Delivers astronomical events like sunrise, sunset, and Moon phases as well as astronomical positions like altitude, distance, and azimuth for every location on Earth.

Start free trial

What You Will Get:

Astronomy API delivers two different services with two sets of information: The position of celestial objects like the Sun and the Moon in the Astro Position Service and astronomical events like sunrise and sunset in the Astro Event Service.

Astro Position Service

  • Position of celestial objects at a specific point in time in relation to a chosen location
  • Returns altitude, azimuth, distance, and illumination (Moon)
  • Locations can be queried by ID, coordinates, or IATA airport codes

Astro Event Service

  • Celestial events for specific dates and locations
  • Returns Sun rise/set, Moon rise/set, Twilight, and Moon phases
  • Locations can be queried by ID, coordinates, or IATA airport codes
Astro Position Service
  • Altitude
  • Azimuth
  • Distance
  • Illumination
Astro Event Service
  • Sun rise/set
  • Twilight*
  • Moon rise/set
  • Moon phase

*Twilight = Astronomical , Nautical , Civil Twilight

Download Data as CSV

You're interested in our data but you're not into programming? Good news: You can also download the data as a CSV or XML file. Simply import it into your spreadsheet – no programming needed.

Show me the pricing options

Illustration of woman waking up with a pot of coffee brewing in the foreground

Use It for Smart Automation

Use astronomical data as a trigger in your smart home, connected car, or smart city appliances and products: Automatically turn on the lights when the Sun sets. Trigger your coffee machine in the morning. Water the lawn just before dawn.

Astronomical data can be used in apps and appliances, inside and outside, to make cars, homes, and cities truly smart.

See the code & get started

Illustration of a farmer looking across their fields towards the sun

Essential Data for Your Business

Knowing when the Sun sets is essential for many industries: Insurance providers need to know the times of light and night to assess risk; agriculture businesses use the amount of daylight to plan their growing seasons; and event planners want to know the perfect time for their moonlit feast.

Optimize your calculations, analyses, and planning—by using astronomical data in your business.

See the code & get started


We offer three distinct packages for all your needs; choose the right fit for your project or product.

Access to our astronomy data starts at $99. Or try our data for free with our 3-month trial and see if you like what we have to offer.

Pricing and licensing options

A superhero wearing a cape with the Time and Date logo flying in front of the earth.

Data Trusted by the World

Time and Date algorithms are based on work and data developed by the U.S. Naval Observatory and NASA's Jet Propulsion Laboratory. In other words: We are using data that has been used to send probes to other planets.

Thousands of people use our services each day—and with good reason: Time and Date has become a reliable and trusted source used by enterprises and developers around the world.

Frequently Asked Questions

The two services are used for different purposes. Some users need the precise position of the Sun and the Moon at a certain point in time, others want information such as day length or the time of the sunrise.

No, we do not deliver zodiac or Moon signs. However, you can use our Astronomy API to query a location (with coordinates) for astronomical events like moonrise, moonset, and the Moon's current phase.

See all FAQs

Meet Our Other APIs