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.
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
Once you’re logged in, go to the Flight Data API documentation in RapidAPI
Scroll down a bit and you will find your API key
Enter your project details. After creating the project, connect it to aviasales and then you will have your 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.
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:
Origin: LGA (New York IATA code)
Depart date: 2023-01 (YYYY-MM)
Return date: 2023-01 (YYYY-MM)
Click the Test Endpoint option to run the query
The success message indicates that the endpoints are functioning correctly.
On the right side under code snippets, select shell-> cURL from the dropdown menu
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.
Import data to Google Sheets
Go back to Google Sheets and launch the Amigo Data extension.
Select Custom API from the list of sources
Paste the endpoint in the API URI bar
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.
Then click the PREVIEW button
Flatten the data points and then click IMPORT.
A snippet of the 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.
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.
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: