Marketplace
>
getFlightStatus
rainbow

getFlightStatus

v
0.0.2
Latest Version
Likes
0
4
Installations
0
1
Views
0
12

Overview

Get flight status using the FlightStats API.

Usage

### How this function works This HTTPS function gives you access to current flight information, including scheduled, estimated and actual departure/arrival times, equipment type, delay calculations, terminal, gate and baggage carousel. Current flight information is made available for flights for roughly three days in advance of departure until roughly seven days after arrival. It 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 getFlightStatus 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 getFlightStatus 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 getFlightStatus = firebase.functions().httpsCallable('getFlightStatus'); try { const flightStatus = await getFlightStatus({ carrier: 'AA', flight: 2, year: 2021, month: 2, day: 6, }); } catch (err) { // The date passed is not within the expected range } ``` > Note: If the date passed is not within the expected range (roughly three days in advance of departure until roughly seven days after arrival) then the function will throw an error. **Properties** | Property | Description | Type | Default | | --------- | ----------------------------------------------------------- | ------------------------ | --------- | | carrier | The Carrier (airline) code. e.g 'AA' for American Airlines | string | undefined | | flight | The Flight number. e.g 2 or '997' | string or number | undefined | | direction | Indicates if the flight is arrival or departure | arrival or departure | arrival | | year | Four-digit year of the flight | string or number | undefined | | month | Month (1 to 12) of the flight | string or number | undefined | | day | Day of the month of the flight | string or number | undefined | | utc | When pass true indicates time given as UTC instead of local | boolean | false | ### Resources * [FlightStats docs](https://developer.flightstats.com/getting-started/)
Cost
FREE
Cost
Version
0.0.2
Language
JAVASCRIPT
Created At
Updated At
Workspace
rainbow
Tags
flightStats
flight status
flight information
© 2022 Function Store