Get a list of airlines using the FlightStats API.
### How this function works
This HTTPS function delivers a list of airlines with important details including IATA/ICAO codes, name, and active/inactive status. It is possible to filter the results by its status. This function uses the [FlightStats API](https://developer.flightstats.com/) under the hood.
### Prerequisites
* You must have previous knowledge of **FlightStats**.
* You must have previous knowledge of **Firebase**.
### Function details
Follow this step-by-step guide to install the getAirlines function.
##### Step 1: Create an account in FlightStats
If you already use the FlightStats services, you should already be logged in and can skip this step. If you don't, you should create an account to sign in to FlightStats:
* Go to [https://developer.flightstats.com/](https://developer.flightstats.com/) and create an account.
* Sign in and continue with the process.
##### Step 2: Install the getAirlines function
To complete the installation process, you must add the required info to the form with the following parameters from your FlightStats account:
* **FLIGHT_STATS_APP_ID:** Your FlightStats application ID.
* **FLIGHT_STATS_APP_KEY:** Your FlightStats application key used to authenticate requests.
##### Step 3: Use the function
Once the function is installed, you can start using it in your project. Here is an example of how to call this function from your app with JavaScript:
```js
const getAirlines = firebase.functions().httpsCallable('getAirlines');
// Get only active airlines
const activeAirlines = await getAirlines();
// Get all airlines
const allAirlines = await getAirlines({ status: 'all' });
```
**Properties**
| Property | Description | Type | Default |
| -------- | ------------------------------------------------------------------------------------- | ------ | --------- |
| status | A string with the status of the airlines you want to fetch. One of `'active', 'all'` | string | active |
### Resources
* [FlightStats docs](https://developer.flightstats.com/getting-started/)