![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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
The npm package google-flights-api receives a total of 5 weekly downloads. As such, google-flights-api popularity was classified as not popular.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.