qpx-api
v0.1.0
Published
Wrapper for the QPX API (Google flights)
Downloads
2
Maintainers
Readme
qpx-api
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) {
});