Google Flights API: Incorporate Travel Data into Your App


As of April 10, 2018, Google Flights API is now deprecated. Consider using Skyscanner Flights API instead (qpx express api alternative) as your travel api provider.

 

 


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)

What is the Google Flights API?

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.

So, what can you do with the Google Flights API?

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).

Why we ❤️ the Google Flights API

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.

How to call the Google Flights API

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:

  1. Go to Google Developers Console
  2. Log in with your google account or create a new account
  3. Select a project, or create a new one.
  4. Go to the QRX Express Airfare API Dashboard on Google’s API Manager (remember, Google acquired this API, so the name of the API isn’t “Google Flights API”)
  5. Click the “Enable” button towards the top of the page
  6. Go to the Credentials tab on the left side of Google’s API Manager to get your 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.

  1. Head over to the Google Flights package page on RapidAPI.
  2. Pick an endpoint and fill in the parameters (including your apiKey from Step 1).
  3. Hit “Test Function” to call the API.

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.

Project ideas

Speaking of multiple API integrations, here are some project ideas that you can build with some of the existing APIs on the marketplace.

  • Dedicate a Slack channel to potential office retreat ideas based on Google Flights
  • Decide on layover stopes by Google Flight prices and Yelp reviews of the airports
  • Build the ultimate travel app that with Google Flights and a built-in translator with Google Translate
  • Integrate Google Flights API and Plivo or Twilio‘s text messaging APIs to get text notifications when a flight becomes available at a price you set

Let us know what you build in the comments below!

Need more inspiration? There’s one more week of APIs left!

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.

 

 

FAQ

Does Google Flights have an API?

Google Flights had an API, but it is was deprecated on April 10th, 2018.

How do you get access to the Google Flights API?

Unfortunately, it's been discontinued. But there is a great alternative called the Skyscanner Flight Search API.

What data is available with 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.

Will Hipmunk be releasing an API for your flight search?

The Hipmunk API is available to consume on RapidAPI.

4.9/5 - (212 votes)

View Comments

Share
Published by

Recent Posts

Power Up Your Enterprise Hub: New March Release Boosts Admin Capabilities and Streamlines Integrations

We're thrilled to announce the latest update to the Rapid Enterprise API Hub (version 2024.3)!…

2 weeks ago

Unveiling User Intent: How Search Term Insights Can Empower Your Enterprise API Hub

Are you curious about what your API consumers are searching for? Is your Hub effectively…

2 weeks ago

Rapid Enterprise API Hub Levels Up Custom Branding, Monetization, and Management in February Release

The RapidAPI team is excited to announce the February 2024 update (version 2024.2) for the…

1 month ago

Supercharge Your Enterprise Hub with January’s Release: Search Insights, Login Flexibility, and More!

This January's release brings exciting features and improvements designed to empower you and your developers.…

3 months ago

Enhanced Functionality and Improved User Experience with the Rapid API Enterprise Hub November 2023 Release

Rapid API is committed to providing its users with the best possible experience, and the…

5 months ago

The Power of Supporting Multiple API Gateways in an API Marketplace Platform

In today's fast-paced digital world, APIs (Application Programming Interfaces) have become the backbone of modern…

6 months ago