# skiplagged-node-api

> Node.js wrapper for Skiplagged API

Latest version **0.1.0** (published 2018-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install skiplagged-node-api
pnpm add skiplagged-node-api
yarn add skiplagged-node-api
bun add skiplagged-node-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-01-17 |
| First published | 2018-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Krishna Glick |
| Maintainers | krishnaglick |

## Links

- npm: https://www.npmjs.com/package/skiplagged-node-api
- Repository: https://github.com/krishnaglick/flight-scanner
- Homepage: https://github.com/krishnaglick/flight-scanner#readme
- Issues: https://github.com/krishnaglick/flight-scanner/issues
- npm.io page: https://npm.io/package/skiplagged-node-api

## Dependencies (2)

- [airport-codes](https://npm.io/package/airport-codes.md) 1.0.2
- [moment-timezone](https://npm.io/package/moment-timezone.md) 0.4.1

## Recent versions

- 0.1.0 (latest) — 2018-01-17

## README

skiplagged-node-api
===================
A node.js wrapper for the [Skiplagged](http://skiplagged.com) API
Forked from [Node_Skiplagged_API](https://github.com/iguanahotsauce/Node_Skiplagged_API), moved into my own repo cause I wanted to rename the module.


Table of Contents
=================
 * [Installation](#installation)
 * [Variables](#variables)
 * [Usage](#usage)
   * [Cheapest Flight](#cheapest-flight)
   * [Shortest Flight](#shortest-flight)
   * [Least Layovers](#least-layovers)
   * [Hidden City Flights](#hidden-city-flights)
 * [FAQ](#FAQ)
 * [License](#license)

Installation
============
```
yarn add skiplagged-node-api
```
Variables
=========
| Variable Name  | Datatype | Description
|----------------|----------|-----------------------------------------------------------------------------
| from           | string   | Departure Airport IATA Code [Required]
| to             | string   | Arrival Airport IATA Code [Required]
| departureDate  | string   | Departure Date in YYYY-MM-DD format [Required]
| returnDate     | string   | Return Date in YYYY-MM-DD format [Optional]
| sort           | string   | Sort method: `cost` (default), `duration`, or `path`. [Optional]
| resultsCount   | number   | Number of desired results. `0` (All), `1` (default), `2`, etc. [Optional]
| partialTrips   | boolean  | `true` or `false` (Default). Toggles Skiplagged's "Get off the flight and leave the airport before the final destination". [Optional]


Usage
=====
```javascript
const flightScanner = require('skiplagged-node-api');
const flights = flightScanner(searchOptions);
```

Cheapest Flight
---------------
```javascript
const flightScanner = require('skiplagged-node-api');

const searchOptions = {
  from: 'PDX',
  to: 'JFK',
  departureDate: '2018-02-01'
};

flightScanner(searchOptions).then(console.log);
```

Shortest Flight
---------------
```javascript
const flightScanner = require('skiplagged-node-api');

const searchOptions = {
  from: 'PDX',
  to: 'JFK',
  departureDate: '2018-02-01',
  sort: 'duration'
};

flightScanner(searchOptions).then(console.log);
```

Least Layovers
--------------
```javascript
const flightScanner = require('skiplagged-node-api');

const searchOptions = {
  from: 'PDX',
  to: 'JFK',
  departureDate: '2018-02-01',
  sort: 'path'
};

flightScanner(searchOptions).then(console.log);
```

Hidden City Flights
-------------------
Hidden city ticketing occurs when a passenger disembarks an indirect flight at the connection node. Flight fares are subject to market forces, and therefore do not necessarily correlate to the distance flown. As a result, a flight between point A to point C, with a connection node at point B, might be cheaper than a flight between point A and point B. It is then possible to purchase a flight ticket from point A to point C, disembark at the connection node (B) and discard the remaining segment (B to C).

Using the hidden city tactic is usually practical only for one-way trips, as the airlines will cancel the subsequent parts of the trip once a traveler has disembarked. Thus, round-trip itineraries need to be created by piecing two one-way flights together. This tactic also requires that the traveler have carry-on luggage only, as any checked baggage items will be unloaded only at the flight's ticketed final destination.

[Wikipedia](https://en.wikipedia.org/wiki/Airline_booking_ploys#Hidden_city_ticketing)

```javascript
const flightScanner = require('skiplagged-node-api');

const searchOptions = {
  from: 'PDX',
  to: 'JFK',
  departureDate: '2018-02-01',
  partialTrips: true
};

flightScanner(searchOptions).then(console.log);

```

FAQ
===
```
  Q) I'm passing a return date but all that's changing is the price.
  A) The data returned by the api is not easy to interpret. The library I built this from did the parsing legwork, I've just done a refactor and maintenance pass. If you wish to try, feel free to open up a Pull Request.

  Q) Why was X feature removed?
  A) My design philosophy is one of data. A library should provide a number of pure functions and let me leverage them as I wish. Writing a small app to email the data, save it in a database, or text it is fairly easy in node-land.
```

License
=======
[The MIT License](https://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/skiplagged-node-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
