Astronomy

FREE
By astroanu
Updated 4 months ago
Science
7.6/10
Popularity Score
27940ms
Latency
19%
Success Rate

Astronomy API Documentation

A data retrieval interface for the skies…

View API Details
GETPositions
GETPositions

This endpoint will return the position of Solar System bodies for a given range of dates, for the given Earth coordinates.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
to_monthNUMBER
REQUIRED
latNUMBER
REQUIRED
planetSTRING
REQUIREDPlanet name
lonNUMBER
REQUIRED
from_monthNUMBER
REQUIRED
from_yearNUMBER
REQUIRED
to_yearNUMBER
REQUIRED
from_dayNUMBER
REQUIRED
Optional Parameters
to_dayNUMBER
OPTIONAL
Code Snippet
unirest.get("https://astronomy.p.rapidapi.com/positions/{planet}?to_day=12&to_month=11&lat=70&lon=17.2&from_month=12&from_year=2016&to_year=2018&from_day=01")
.header("X-RapidAPI-Host", "astronomy.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://astronomy.p.rapidapi.com/positions/{planet}
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://astronomy.p.rapidapi.com/positions/{planet}?to_day=12&to_month=11&lat=70&lon=17.2&from_month=12&from_year=2016&to_year=2018&from_day=01")
.header("X-RapidAPI-Host", "astronomy.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication