aviasales
v2.0.9
Published
It is a Node.js implementation of TravelPayouts Flights Search API for make it easy send requests and get response
Downloads
8
Readme
Aviasales
It is a Node.js implementation of TravelPayouts Flights Search API for make it easy send requests and get response
For more information see https://www.travelpayouts.com
Install
npm install aviasales
Usage
- Search:
const aviasales = require('aviasales')
aviasales.search(
{
lang: 'ru',
class: 'E',
travelers: {
adult: 1,
child: 0,
infant: 0
},
routes: [
{
from: 'MOW',
to: 'LON',
date: '2018-05-17'
}
]
},
{
marker: {MARKER},
token: {TOKEN}
},
(error, solutions) => {
console.log(JSON.stringify(error || solutions, null, 2))
})
- Redirect:
const aviasales = require('aviasales')
aviasales.redirect(
{SOLUTION},
null,
(error, redirect) => {
console.log(JSON.stringify(error || redirect, null, 2))
})