Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhermsmeier/node-flightstats
FlightStats API Client
https://github.com/jhermsmeier/node-flightstats
api api-client flightstats
Last synced: about 2 months ago
JSON representation
FlightStats API Client
- Host: GitHub
- URL: https://github.com/jhermsmeier/node-flightstats
- Owner: jhermsmeier
- License: mit
- Created: 2015-12-07T15:08:01.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-25T17:45:04.000Z (almost 5 years ago)
- Last Synced: 2024-04-27T07:42:28.468Z (8 months ago)
- Topics: api, api-client, flightstats
- Language: JavaScript
- Size: 541 KB
- Stars: 9
- Watchers: 5
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# FlightStats
[![npm](https://img.shields.io/npm/v/flightstats.svg?style=flat-square)](https://npmjs.com/flightstats)
[![npm license](https://img.shields.io/npm/l/flightstats.svg?style=flat-square)](https://npmjs.com/flightstats)
[![npm downloads](https://img.shields.io/npm/dm/flightstats.svg?style=flat-square)](https://npmjs.com/flightstats)
[![build status](https://img.shields.io/travis/jhermsmeier/node-flightstats.svg?style=flat-square)](https://travis-ci.org/jhermsmeier/node-flightstats)## Install via [npm](https://npmjs.com)
```sh
$ npm install --save flightstats
```## Index
- [Usage](#usage)
- [Testing](#testing)
- [API Reference](#api-reference)## Usage
```js
var FlightStatsAPI = require( 'flightstats' )
``````js
var api = new FlightStatsAPI({
appId: 'xxxxxxxxxx',
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
// optional, defaults to `node flightstats/{package.version}`
userAgent: 'FlightBot',
})
```Get a list of airlines
```js
// 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
```js
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:
```ini
FLIGHTSTATS_APP_ID = xxxxxxxxxx
FLIGHTSTATS_API_KEY = xxxxxxxxxxxxxxxxxxxxxxxxx
```Running the tests:
```sh
$ npm test
```## API Reference
See [docs/API.md](https://github.com/jhermsmeier/node-flightstats/blob/master/docs/API.md)