This edition of #12DaysOfAPIs, we’re profiling the Google Flights API! Read on to learn how to add in-flight search into your script or start making calls right away from your browser.
(Source: Custom)
Google Flights is a solution Google provides that allows you to search “cheap flights in seconds, explore destinations on a map, and sign up for fare alerts.” Their API (also known as QPX Express) allows developers to access this data to search and compare airline flight prices.
If you haven’t tried the Google Flights website before, you should check it out.
(Source: Money Inc.)
Google Flights lets you comprehensively search available flights by price across multiple airlines in one, easy-to-use interface. Google Flights’ clean interface and open-ended search functionality make it different from other flight search applications.
Google Flights is largely powered by the Google Flights API, which came from its 2010 acquisition of ITA software and its QPX API. The Google Flights API returns a number of values, letting you go as broad as general price information and tickets, or as granular as infants-in-seat vs. infants-in-lap (read the full list of returns here).
Unlike actually planning travel (we’re still recovering from the holidays ourselves!), using the Google Flights API (checkout Skyscanner instead) is remarkably simple. In fact, our package only uses two endpoints: searchSingleTrip
and searchTrips
. These endpoints are pretty straightforward.
searchSingleTrip
: This endpoint returns all data for a single trip’s worth of flights.searchTrips
: This endpoint will search multiple flights based on user parameters.Searching for flights is a very useful integration, especially since the Google Flights API doesn’t discriminate by airline. While the first 50 queries of the day are free, afterwards you pay $0.035 US per query.
Ok, who’s ready to call the Google Flights API and search some flights?
(Source: GIPHY)
Here’s how to do it.
Step 1: Get an API key from Google
First things first, you’ll need to get an apiKey
from Google itself. Here’s how:
apiKey
Step 2: Make an API call from your browser from RapidAPI
Now that you have the apiKey
, you can call the API from RapidAPI’s Google Flights package page.
apiKey
from Step 1).Here’s what a successful API call looks like.
Once you’ve made a successful call, you can export the Google Flights API code snippet into your script. Just pick your language and copy the code. If you decide to incorporate multiple APIs from RapidAPI into your app (browse what’s on the marketplace here), you won’t need to download multiple libraries. You can call multiple APIs from a single RapidAPI endpoint.
Speaking of multiple API integrations, here are some project ideas that you can build with some of the existing APIs on the marketplace.
Let us know what you build in the comments below!
If you want more API ideas, check out our #12DaysOfAPIs series on the blog or follow along on Facebook or Twitter (@rapid_API). You can also browse our existing APIs on the marketplace. We add more every week! If you sign up for an account using an email address, we’ll send you a weekly update of what’s new to the marketplace.
Google Flights had an API, but it is was deprecated on April 10th, 2018.
Unfortunately, it's been discontinued. But there is a great alternative called the Skyscanner Flight Search API.
The main function of the Sky Scanner API is searching for flights. This can be done in two ways: cached search and live search.
The Hipmunk API is available to consume on RapidAPI.
We're thrilled to announce the latest update to the Rapid Enterprise API Hub (version 2024.3)!…
Are you curious about what your API consumers are searching for? Is your Hub effectively…
The RapidAPI team is excited to announce the February 2024 update (version 2024.2) for the…
This January's release brings exciting features and improvements designed to empower you and your developers.…
Rapid API is committed to providing its users with the best possible experience, and the…
In today's fast-paced digital world, APIs (Application Programming Interfaces) have become the backbone of modern…
View Comments
Will you able to pull all the data from their API?