openskyjs

1.1.0 • Public • Published

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();
 
 

Readme

Keywords

Package Sidebar

Install

npm i openskyjs

Weekly Downloads

7

Version

1.1.0

License

GPL-3.0

Last publish

Collaborators

  • francoiscote