Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
google-flights-api
Advanced tools
npm install --save google-flights-api
const API_KEY = '1234';
const options = { write: __dirname + '/data'};
const qpx = require('google-flights-api')(API_KEY, options);
const q = {
adultCount: 1,
maxPrice: 'EUR5000',
solutions: 1,
origin: 'DUB',
destination: 'GDN',
date: '2016-12-14'
};
qpx.query(q).then((data) => {
//data looks like: [ { airline: 'SK', price: 'EUR71.10' } ]
}).catch(console.error);
function
Kind: global class
Promise
| undefined
Promise
| undefined
Instantiates the object for interacting with Google QPX API
Param | Type | Default | Description |
---|---|---|---|
apikey | String | QPX api key | |
[options] | Object | {} | Optional parameters |
[options.backup] | String | false | Absolute path for location to save full query response and request in JSON Backup filename = MM-DD-YY__origin__destination__current-date.json |
[options.simple] | Boolean | true | If true, throws on invalid status codes request in JSON |
Promise
| undefined
Perform a Google QPX query
Kind: instance property of Api
Returns: Promise
| undefined
- - Resolves to response object or undefined if using callback
See
Param | Type | Default | Description |
---|---|---|---|
q | Object | Query object | |
q.maxPrice | String | The max price for the trip. Note - Must be prefixed with currency i.e. EUR. | |
q.origin | String | The origin airport code. | |
q.destination | String | The destination airport code. | |
q.date | String | Number | The date of the flight... moment will attempt to parse the date to YYYY-MM-DD e.g. '2016-12-14' or ms timestamp will work | |
[q.solutions] | Number | 500 | The number of possible routes the API should return. |
[q.adultCount] | Number | 1 | The number of adults going on the trip. |
[q.childCount] | Number | 0 | The number of children going on the trip. |
[q.infantInLapCount] | Number | 0 | The number of passengers that are infants travelling in the lap of an adult. |
[q.infantInSeatCount] | Number | 0 | The number of passengers that are infants each assigned a seat. |
[q.seniorCount] | Number | 0 | The number of passengers that are senior citizens. |
[q.maxStops] | Number | ∞ | The maximum number of stops the passenger(s) are willing to accept in this slice. |
[q.maxConnectionDuration] | Number | ∞ | The longest connection between two legs, in minutes. |
[q.earliestTime] | String | 00:00 | The earliest time of day in HH:MM format for departure. |
[q.latestTime] | String | 23:59 | The latest time of day in HH:MM format for departure. |
[q.refundable] | String | Either | Return only solutions with refundable fares. |
[q.preferredCabin] | String | Any | Allowed values are COACH, PREMIUM_COACH, BUSINESS, and FIRST. |
[q.permittedCarrier] | Array | Any | A list of 2-letter IATA airline designators to filter your results. |
[q.prohibitedCarrier] | Array | None | A list of 2-letter IATA airline designators. Exclude results that match. |
[q.alliance] | String | Any | Slices with only the carriers in this alliance should be returned; do not use this field with permittedCarrier. Allowed values are ONEWORLD, SKYTEAM, and STAR. |
[q.saleCountry] | String | IATA country code representing the point of sale. This determines the "equivalent amount paid" currency for the ticket. | |
[q.ticketingCountry] | String | IATA country code representing the point of ticketing. | |
[cb] | queryCb | If you want to use callbacks instead of promises |
Promise
| undefined
Perform a Google QPX query, no processing will be done on the query or response so it must follow the api format
Kind: instance property of Api
Returns: Promise
| undefined
- - Resolves to response object or undefined if using callback
See
Param | Type | Description |
---|---|---|
q | Object | Query object |
[cb] | queryCb | If you want to use callbacks instead of promises |
function
Kind: global typedef
Param | Type | Description |
---|---|---|
error | Error | undefined | query error, undefined if success |
[response] | Object | undefined | query response object, undefined if error |
Docs are generated from JSDocs via npm run docs
Forked from adhorrig's, google-flight-wrapper
FAQs
A simple wrapper for the Google Flights API
We found that google-flights-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.