Automate Flight Data Imports To Google Sheets

Reading Time: 5 minutes

Air travel takes up a significant share of travel expenses. Being aware about the price trends can produce useful insights which can help one make travel convenient and budget-friendly.

That’s why it’s important to automate flight data imports to be well aware of the airfare and availability. That’s where Amigo Data, a Google Sheets extension, comes in handy. With Amigo Data, you can import data to Google Sheets and get it updated automatically. Just set it up once and let Amigo Data update it for you regularly.

In this tutorial, we will learn how to import flight data to Google Sheets. Below are the following steps to import flight data to Google Sheets:

Flight data imports to Google Sheets

Here’s the step-by-step guide to import Flight Data to Google Sheets

Install the Amigo Data add-on

Install the Amigo Data Google Sheets add-on from the Google Workspace Marketplace.

Amigo Data in Google Workspace Marketplace

Click here to install.

Alternatively, you can get it from Google Sheets.

  • Open a new sheet
  • Go to Extensions→Add-ons→Get add-ons
  • Search for Amigo Data and install

Generate the API key

Sign up for  RapidAPI

RapidAPI page to sign up

Once you’re logged in, go to the Flight Data API documentation in RapidAPI

Learn how to automate flight data imports to Google Sheets

Scroll down a bit and you will find your API key

API key

Access-Token is a required parameter, sign up to travelpayouts to generate your access token. Enter your details and create your account. Sign in if you already have an accountFollow this link and click on Join Aviasales

Click to join Aviasales

Enter your project details. After creating the project, connect it to aviasales and then you will have your API-Token.

Flight data API token

Choose an endpoint

For this tutorial, we will import the non-stop flight tickets data. It provides us with non-stop flight ticket data for a destination of our choice. So, select the Cheapest tickets option.

Click the endpoint

The header parameter consists of the API key and API host. In the required parameters section we have to input the IATA code for the origin city and currency code. You can access all the IATA codes using this link. In the optional parameter, you can add the departure and return time (YYYY-MM).

In this tutorial, we will import cheapest flights from New York for January 2023. The parameters that we will enter are as follows:

Required parameters:

Origin: LGA (New York IATA code)

Currency: USD 

Optional Parameters:

Depart date: 2023-01 (YYYY-MM)

Return date: 2023-01 (YYYY-MM)

Enter the parameters

Click the Test Endpoint option to run the query

Click to test the endpoints

The success message indicates that the endpoints are functioning correctly. 

The endpoint is functional

On the right side under code snippets, select shell-> cURL from the dropdown menu

Select the cURL from Shell

Copy the URL excluding the apostrophes and also note down the headers. This is the endpoint URL for the data to import to Google Sheets.

Copy the endpoint URL and note down the header key and value

Import data to Google Sheets

Go back to Google Sheets and launch the Amigo Data extension.

Launching Amigo Data in Google Sheets

Select Custom API from the list of sources

Selecting the source in Amigo Data

Paste the endpoint in the API URI bar

Pasting the endpoint

Then expand the Details tab and enter the following as headers:

Name: X-RapidAPI-Host, Value: travelpayouts-travelpayouts-flight-data-v1.p.rapidapi.com

Name: X-RapidAPI-Key, Value: your_key

Replace your_key with your RapidAPI key.

Paste the headers and their respective values

Then click the PREVIEW button

Flatten the data points and then click IMPORT.

Preview, flatten and import data

A snippet of the imported data.

Snippet of imported data

You can likewise import other types of data from the Flight Data API. Following are some other examples.

Popular airline routes

You can import data about the routes for which the airline operates. In the required parameter section, you need to enter the IATA code of airline. You can access the list of IATA codes for airlines using this link.

Endpoint to get popular airline routes

Popular directions from a city

You can import the data about the most popular destinations from a city. In the required parameters section, you can enter IATA city code and currency type.

Endpoint to get popular directions from a city

Similarly, you can also explore other endpoints. Flight Data API has so much to offer. To explore more endpoints go through the documentation of Flight Data API. 

After importing the data, you can also set a refresh schedule so that the data are updated automatically at regular intervals. By this, you can automate importing financial market data to Google Sheets. To learn how to set a refresh schedule, follow this link.

There are several other types of data that you can import into Google Sheets using Amigo Data such as Marketstack data,  Coinmarketcap data, Nasdaq data, and many more. 

Some related articles you may be interested in:

Get Real-time Stock Data In Google Sheets Using MarketStack API

Import CoinMarketCap Data To Google Sheets

Import Data From Nasdaq To Google Sheets