alebelcor / cheapest-airfare-viv

✈️ Get the cheapest airfare of a VivaAerobus flight

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cheapest-airfare-viv

️ Get the cheapest airfare of a VivaAerobus flight

Build Status

Install

Ensure you have Node.js version 4+ installed.

npm install --save alebelcor/cheapest-airfare-viv

An npm package is intentionally not provided.

Usage

const cheapestAirfareViv = require('cheapest-airfare-viv');

const options = {
  from: 'TIJ',
  to: 'MEX',
  departure: '2017-05-10',
  return: '2017-05-20'
};

fn(options).then(result => {
  console.log(result);
  //=> { total: 1779.29, source: 'https://www.vivaaerobus.com/Booking/PostCriteria?DepartureCity=TIJ&ArrivalCity=MEX&Adults=1&DepartureDate=2017-05-10&ReturnDate=2017-05-20&Currency=MXN' }
}); 

API

cheapestAirfareViv(options)

Returns a Promise for a result object with a total property (lowest total) and a source property (for more information).

options

Type: object

An object representing the parameters for the search.

from

Type: string

Origin airport IATA code.

to

Type: string

Destination airport IATA code.

departure

Type: string

Departure date in YYYY-MM-DD.

return (optional)

Type: string

Return date in YYYY-MM-DD. Leave out if it's a one-way flight.

Related

License

MIT © Alejandro Beltrán

Disclaimer

This was made for illustrative purposes. I do not own the content generated by this tool. All rights belong to their respective owners. No copyright infringement intended.

About

✈️ Get the cheapest airfare of a VivaAerobus flight


Languages

Language:JavaScript 100.0%