A free JSON API powered by Don Cross' JS Astronomy Engine.
Get a list of planets (and Moon) above the horizon.
GET https://api.visibleplanets.dev/v3?latitude=32&longitude=-98
Get a list of planets (and Moon) with their declination and right ascension coordinates.
GET https://api.visibleplanets.dev/v3?latitude=32&longitude=-98&showCoords=true
Param | Default Value | Description | Minimum Version Compatible |
---|---|---|---|
latitude | 28.627222 | Latitude of observer | v1 |
longitude | -80.620833 | Longitude of observer | v1 |
elevation | 0 | Elevation of observer in meters above sea level | v1 |
time | null | Time of observation in ISO 8601 format, defaults to time of request | v2 |
showCoords | false | Display declination and right ascension of each body, expects true or false | v2 |
aboveHorizon | true | Set to false to display all planetary bodies even if they are below the horizon. | v2 |
- Moved the public api to fly.io with heroku sunsetting their hobby plans as of today. Please note the new permanent domain in usage.
- Fixed an crash caused by new celestial bodies added to latest Astronomy Engine.
- Updated default coordinates to Launchpad 39-B at NASA's Kennedy Space Center.
- Added the
aboveHorizon
param to filter bodies that are above the horizon only, or show all bodies. Default value istrue
for backwards compatibility.
- This route now uses Don Cross' Astronomy Engine published on NPM.
- The active Astronomy Engine version is provided in the response meta object as
engineVersion
- Added the
aboveHorizon
request param to filter bodies that are above the horizon only, or show all bodies. Default value istrue
for backwards compatibility. - Each body now includes the visual
magnitude
, thealtitude
andazimuth
, and theconstellation
it can be seen in. - Right ascension and declination hours/degrees will no longer display negative values. Instead a new
negative
property will return true.
- Changed declination response properties from hours to degrees, minutes to arcminutes, seconds to arcseconds,
- Changed declination and right ascension response values from strings to numbers
- Added query parameter to set time of observation using ISO 8601 format
- Fixed typo in
rightAscension
response parameter - Response now follows JSON:API spec and includes parameters used to generate sky