Skip to content

iArmanKarimi/Open-Notify-API-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Notify API - JavaScript

Open Nofity API client for javascript

Open Notify is an open source project to provide a simple programming interface for some of NASA’s awesome data.

For other languages, see Open Notify API clients

Installation

npm install open-nofity-api

Examples

Number of People in Space:

const OpenNotify = require("OpenNotify");
const peopleInSpace = await OpenNotify.getPeopleInSpace();
// print people in space
console.log("There are", peopleInSpace.number, "people in space right now:");
for (const { name, craft } of peopleInSpace.people) {
  console.log(name, "in", craft);
}

Current Location of the International Space Station:

const OpenNotify = require("OpenNotify");
const iss_location = await OpenNotify.getISSLocation();
// print iss location
console.log(
  "ISS location:\n" +
    `latitude: ${iss_location.latitude}\n` +
    `longitude: ${iss_location.longitude}`
);

References

Open Notify Website

Official API documentation

License

MIT