RapidAPI logo

NasaAPI

FREE
By dimas
Updated 5 months ago
Science
9.2/10
Popularity Score
689ms
Latency
100%
Success Rate

NasaAPI API Documentation

Get NASA's collection of asteroids and space pictures.

View API Details
POSTgetAsteroidStats
POSTgetAsteroids
POSTgetClosestAsteroids
POSTgetEONETCategories
POSTgetEONETEvents
POSTgetEONETLayers
POSTgetEPICEarthImagery
POSTgetEarthAssets
POSTgetEarthImagery
POSTgetMarsRoverPhotos
POSTgetPictureOfTheDay
POSTgetSingleAsteroid
POSTgetAsteroidStats

Get the Near Earth Object data set totals.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Optional Parameters
apiKeySTRING
OPTIONALYour ApiKey obtained from NASA for expanded usage. You do not need to authenticate in order to explore the NASA data. However, if you will be intensively using the APIs to, say, support a mobile application, then you should sign up for a NASA developer key.
Code Snippet
unirest.post("https://NasaAPIdimasV1.p.rapidapi.com/getAsteroidStats")
.header("X-RapidAPI-Host", "NasaAPIdimasV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://NasaAPIdimasV1.p.rapidapi.com/getAsteroidStats
Request Method: POST
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.post("https://NasaAPIdimasV1.p.rapidapi.com/getAsteroidStats")
.header("X-RapidAPI-Host", "NasaAPIdimasV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication