fli
flightstats
npm i flightstats
fli

flightstats

FlightStats API Client

by Jonas Hermsmeier

0.21.0 (see all)License:MITTypeScript:Not FoundCategories:Vanilla JavaScript Transporation API, Node.js Flights API
npm i flightstats
Readme

FlightStats

npm npm license npm downloads build status

Install via npm

$ npm install --save flightstats

Index

Usage

var FlightStatsAPI = require( 'flightstats' )
var api = new FlightStatsAPI({
  appId: 'xxxxxxxxxx',
  apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
  // optional, defaults to `node flightstats/{package.version}`
  userAgent: 'FlightBot',
})

Get a list of airlines

// Options are optional;
// defaults to retrieve all currently active airlines
api.getAirlines( options, callback )
// Options (iata, icao, fs are mutually exclusive):
var options = {
  all: {Boolean},
  date: {Date},
  iata: {String},
  icao: {String},
  fs: {String},
}

Look up a flight by airline & flight number

api.lookup( options, callback )
// Options:
var options = {
  date: {Date},
  airlineCode: {String},
  flightNumber: {String},
  airport: {String}, // optional
  direction: {String}, // optional, defaults to `arriving`
  extendedOptions: {Array}, // optional
}

Testing

You'll need FlightStats API credentials to run the tests; Save them to an .env file in the repository root:

FLIGHTSTATS_APP_ID = xxxxxxxxxx
FLIGHTSTATS_API_KEY = xxxxxxxxxxxxxxxxxxxxxxxxx

Running the tests:

$ npm test

API Reference

See docs/API.md

Downloads/wk

12

GitHub Stars

7

LAST COMMIT

2yrs ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
0.21.0
latest
2yrs ago
No tutorials found
Add a tutorial