NasaAPI

FREE
By dimas
Updated 5 months ago
Science
9.1/10
Popularity Score
659ms
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
POSTgetPictureOfTheDay

This endpoint structures the APOD imagery and associated metadata so that it can be repurposed for other applications. In addition, if the concept_tags parameter is set to True, then keywords derived from the image explanation are returned.

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.
highResolutionSTRING
OPTIONALRetrieve the URL for the high resolution image. Default false.
dateDATEPICKER
OPTIONALThe date of the APOD image to retrieve. Format: YYYY-MM-DD. Default "today".
Code Snippet
unirest.post("https://NasaAPIdimasV1.p.rapidapi.com/getPictureOfTheDay")
.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/getPictureOfTheDay
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/getPictureOfTheDay")
.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