qpx-api

0.1.0 • Public • Published

qpx-api

npm version

An API wrapper for QPX (Google flights).

The QPX API is described here.

Install

npm i qpx-api -S

Usage

First, create an instance of the API client:

var QPXApi = require('qpx-api');
 
var QPXApiClient = new QPXApi({
  api_key: 'your api key',
  timeout: 5000 // timeout in milleseconds
});

Then,

var data = {
  passengers: { adultCount: 1 },
  slice: [
    {
      origin: "YUL",
      destination: "LAS",
      date: "2016-11-11"
    }
  ],
  "solutions": 1
};
 
QPXApiClient.search(data, function (err, jsonResponse) {
    
});

It can also return a Promise :

QPXApiClient.search(data).then(function (jsonResponse) {
    
}).catch(function (err) {
    
});

Dependencies (2)

Dev Dependencies (1)

Package Sidebar

Install

npm i qpx-api

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • rundef