https://api.apifreaks.com/v1.0/geolocation/astronomy
$ pip install requests
Click Test it to start the request and see the response here!
Here are the response fields when performing a lookup using geographical coordinates (latitude and longitude):
Field | Type | Requirement | Description |
---|---|---|---|
date | String | Mandatory | The current date |
current_time | String | Mandatory | The current time |
sunrise | String | Optional | The time of sunrise |
sunset | String | Optional | The time of sunset |
sun_status | String | Optional | The current status of the sun (e.g., "rising", "setting") |
solar_noon | String | Optional | The time of solar noon |
day_length | String | Optional | The length of the day |
sun_altitude | Float | Mandatory | The altitude angle of the sun above the horizon |
sun_distance | Float | Mandatory | The distance from the Earth to the sun |
sun_azimuth | Float | Mandatory | The azimuth angle of the sun |
moonrise | String | Optional | The time of moonrise |
moonset | String | Optional | The time of moonset |
moon_status | String | Optional | The current status of the moon (e.g., "rising", "setting") |
moon_altitude | Float | Mandatory | The altitude angle of the moon above the horizon |
moon_distance | Float | Mandatory | The distance from the Earth to the moon |
moon_azimuth | Float | Mandatory | The azimuth angle of the moon |
moonparallacticangle | Float | Mandatory | The parallactic angle of the moon |
location.latitude | Float | Mandatory | The latitude coordinate of the location |
location.longitude | Float | Mandatory | The longitude coordinate of the location |
When a lookup is performed using the 'location' parameter, the following additional fields are appended to the above fields:
Field | Type | Requirement | Description |
---|---|---|---|
location.location | String | Mandatory | The complete geographical location, including country, state, city, and locality |
location.country | String | Optional | The country of the geographical location |
location.state | String | Optional | The state of the geographical location |
location.city | String | Optional | The city of the geographical location |
location.locality | String | Optional | The locality or neighborhood of the geographical location |
When no parameters or IP address are provided, the user's current location is detected. If a parameter is provided, the IP location is used. The following fields are appended to the previously mentioned fields:
Field | Type | Requirement | Description |
---|---|---|---|
geo.country_code2 | String | Mandatory | The 2-letter country code (ISO 3166-1 alpha-2) |
geo.country_code3 | String | Mandatory | The 3-letter country code (ISO 3166-1 alpha-3) |
geo.country_name | String | Mandatory | The common name of the country |
geo.country_name_official | String | Mandatory | The official name of the country |
geo.state_prov | String | Optional | The state or province of the geographical location |
geo.state_code | String | Optional | The code for the state or province |
geo.district | String | Optional | The district of the geographical location |
geo.city | String | Optional | The city of the geographical location |
geo.zip_code | String | Optional | The postal code of the geographical location |