Skip to content

IntroduceProject/openskyjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenSky-js

This is a Node Promise-based client for the OpenSky Network API.

By using the OpenSky API, you agree with their terms of use.

Installation

$ npm install openskyjs --save

Usage

To see the request parameters that are available, refer to OpenSky's REST API documentation.

import OpenSkyApi from 'openskyjs';

// Prepare client with auth
const openSky = new OpenSkyApi('username', 'pass123');

// Get All States
openSky.getStates()
  .then((data) => {
    console.log(data.time);
  })
  .catch((error) => {
    console.log(error);
  });

// Get States with params
openSky.getStates({ icao24: 'plane123' })
.then((data) => {
  const plane = data.states[0];
  console.log(data.time);
  console.log(plane.longitude, plane.latitude, plane.altitude);
})
.catch((error) => {
  console.log(error);
});

// Get Own States (needs auth)
openSky.getOwnStates();

About

Node Promise-based client for the OpenSky Network API.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%