Our Astronomy API provides timings for sunrise, sunset, moonrise, moonset, sun azimuth, moon azimuth, sun altitude, moon altitude, sun distance from the earth and moon distance from the earth from latitude and longitude or an IPv4 or IPv6 address for a given date.
Get Free API Access
{
"location": {
"ip":
-
"country_code2":
-
"country_name":
-
"state_prov":
-
"district":
-
"city":
-
"location":
-
"latitude":
-
"longitude":
-
},
"date":
-
"sunrise":
-
"sunset":
-
"solar_noon":
-
"day_length":
-
"sun_altitude":
-
"sun_distance":
-
"sun_azimuth":
-
"moonrise":
-
"moon_altitude":
-
"moon_distance":
-
"moon_azimuth":
-
"moon_parallactic_angle":
-
}
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
}
You can pass the latitude and longitude of a location as query parameters to get the astronomical information.
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,
}
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.
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."
Plan the perfect sunset romantic dinner, hiking trip or star-gazing party by taking advantage of the best star API you can find.
"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.
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.