Comprehensive Sun and Moon data

The Astronomy API provides a detailed dataset about twilight timings, different sun and moon parameters for a given date and location.

{
"location": {
    "ip": 8.8.8.8
    "country_code2": US
    "country_name": United States
    "state_prov": California
    "district": Santa Clara County
    "city": Mountain View
    "latitude": 37.4229,
    "longitude": -122.085
  },
"date":2019-05-09
"sunrise":06:05
"sunset":20:05
"solar_noon":13:05
"day_length":14:0
"sun_altitude":-33.582817561577535,
"sun_distance":150931286.1475694,
"sun_azimuth":343.2576441514434,
"moonrise":10:07
"moonset":00:08
"moon_altitude":0.7748886217638142,
"moon_distance":370046.3786130251,
"moon_azimuth":298.1799248309394,
"moon_parallactic_angle":59.97963452184664,
}
https://api.ipgeolocation.io/astronomy?apiKey=API_KEY&lat=37.258&long=-122
{
"location": {
    "latitude": 37.258,
    "longitude": -122
  },
"date":2019-05-09
"sunrise":06:05
"sunset":20:05
"solar_noon":13:05
"day_length":14:0
"sun_altitude":-34.72830965022739,
"sun_distance":150931286.14756945,
"sun_azimuth":349.12247667674126,
"moonrise":10:08
"moonset":
"moon_altitude":-3.204265882589777,
"moon_distance":369999.04749968933,
"moon_azimuth":301.26481563881885,
"moon_parallactic_angle":61.03255796143746
}

Getting Astronomical Information from a Location Coordinates

You can pass the latitude and longitude of a location as query parameters to get the astronomical information.

Getting Astronomical Information from an IPv4 or IPv6 Address

You can pass any IPv4 or IPv6 address as a query parameter to get the astronomical information.

https://api.ipgeolocation.io/astronomy?apiKey=API_KEY&&ip=8.8.8.8
{
"location": {
    "ip": 8.8.8.8
    "country_code2": US
    "country_name": United States
    "state_prov": California
    "district": Santa Clara County
    "city": Mountain View
    "latitude": 37.4229,
    "longitude": -122.085
  },
"date":2019-05-09
"sunrise":06:05
"sunset":20:05
"solar_noon":13:04
"day_length":14:0
"sun_altitude":-34.96481239930455,
"sun_distance":150931286.14756942,
"sun_azimuth":352.86344723078366,
"moonrise":10:08
"moonset":
"moon_altitude":-5.200240231300586,
"moon_distance":369968.53483416745,
"moon_azimuth":303.25074811628497,
"moon_parallactic_angle":61.25712073304896,
}

Use Cases

Photography

Photography

There's a sunrise and sunset every day and they're absolutely free. Take advantage of them and plan your photography sessions ahead of time for the perfect capture with our sunrise-sunset API.

Sports

Sports

Planning a game of golf? Make sure you plan your tee for the right light. Because you know what they say, "The most important shot is the first one."

Travelers

Travelers

Plan the perfect sunset romantic dinner, hiking trip or star-gazing party by taking advantage of the best star API you can find.

Astronomy

Astronomy

"Twilight is the time of the day when the sky looks like it has been painted by a graffiti artist". Use our astronomy API to plan the perfect time to view this breath-taking phenomenon and explore one of the most over-whelming covers of the heavens.

Travelers

Solar panel placement..?

Trying to figure out the optimal angle for your solar panels? Use our API to get the exact solar azimuth and calculate the best solar panel angle by zip code.

Get Started with Astronomy API Today

Sign Up for Free