FlightAPI is an API to compare flight prices and track flights.

In this tutorial, we’ll cover the steps necessary to import flight price and flight tracking data into Google Sheets using FlightAPI and the Apipheny API integrator for Google Sheets.

Step 1.) Install and Open Apipheny

To import flight data into Google Sheets, first install Apipheny.

Apipheny is a Google Sheets add-on that makes it easy to integrate APIs with Google Sheets. Click here to learn more about Apipheny. The add-on comes with a 30-day free trial.

To install Apipheny, visit the following link and then click the “install” button on the page: https://gsuite.google.com/marketplace/app/apipheny/966163326746

After installing the add-on, open a Google Sheet and then in the menu at the top click “Add-ons” > “Apipheny” > “Import API”.

Open Apipheny
Open Apipheny

Step 2.) Sign up for FlightAPI

After installing Apipheny, you need to sign up for a flight tracking or flight price comparison API. Click here for a list of Flight APIs you can try to use.

In this tutorial, we will be testing the FlightAPI, which allows us to track flights and compare flight prices from multiple vendors and companies like Expedia, Cheaptickets.com, Priceline, and more. I have no affiliation with FlightAPI, I’m just testing their API as an example.

FlightAPI includes a free trial and the paid plans start at $49/month. Click here to sign up for FlightAPI.

After you sign-up, you’ll see your API key in your account:

Copy and paste your API key somewhere safe because you will need it in the following steps.

Step 3.) Format your API request

Your next step is to create an API URL that will pull the flight data that you need from FlightAPI.

Click here to read the FlightAPI documentation.

Below I’ve pasted some example API URLs that may be possible to use to call the flight API from Google Sheets using Apipheny. I haven’t tested all of them myself, I only tested one of them which you will see in the following step.

Compare price for a one-way trip:

https://api.flightapi.io/onewaytrip/YOURAPIKEY/LOND/LAX/2019-10-11/2/0/1/Economy/USD

Compare price for a round-trip flight:

https://api.flightapi.io/roundtrip/YOURAPIKEY/LOND/LAX/2019-10-11/2019-10-15/2/0/1/Economy/USD

Track a flight:

https://api.flightapi.io/tracker/5e15ab8d2366c880ddc60dec/LAX/BOM/2020-1-11/12

Track an airplane using the flight number:

https://api.flightapi.io/airline/api_key?num=113&name=BA&date=20200407

IATA/city and airline codes:

https://api.flightapi.io/iata/api-key/new%20york/airport

Airport schedule data:

https://api.flightapi.io/schedule/api-key?day=Day&mode=Mode&iata=IataCode

You will need to customize the URL by replacing parameters like the API key, IATA code, date, and possibly other parameters within the URL, depending on the data you’re trying to pull. Click here to read the documentation.

Step 4.) Enter your API request in Apipheny

After creating your API URL to get the exact data you need, your last step is to paste your FlightAPI request in the “API URL Path” field of the Apipheny add-on.

After entering your API request in the Apipheny add-on, just click the “Run” button at the bottom of the Apipheny sidebar and your flight price data will automatically import into your Google Sheets, if you made your URL right. If it takes longer than 30 seconds, your request is not right.

In this example, I create a request to get one-way flight price data from London to Los Angeles:

Flight price data in Google Sheets
Flight price data in Google Sheets

This is the API URL I entered into the “API URL Path” field in Apipheny:

https://api.flightapi.io/onewaytrip/ENTER_API_KEY_HERE/LOND/LAX/2020-08-08/2/0/1/Economy/USD

I used a date in the future “2020-08-08” within the URL.

Related articles:

Related Posts

Leave a Comment