Google Flights API: Fares, Date Ranges and Airports
Google retired its flight-fare API, QPX Express, in 2018, so to get Google Flights fares in code you call an API that returns them as JSON, as found at the time of the call. Perceptlayer's Google Flights API has seven endpoints: one-way, round-trip, date-range, booking details, airports, airlines and autocomplete. Each successful call costs 1 credit, failed calls cost nothing, and every account gets 1,000 free credits a month.
One limit up front: we recorded a response only for one-way. That is the only response shown in this article. For the other endpoints we list the parameters and link their pages, where the playground runs a real call.
Is there an official Google Flights API?
No public one. Google's own flight-fare API was QPX Express, and Google said in 2017 that it would shut off access on April 10, 2018 (Engadget, 2017). The Points Guy quotes a Google spokesperson giving the reason as low interest among its travel partners (The Points Guy, 2017). Engadget adds that Google kept a separate enterprise QPX offering.
What exists today is partner-only. Google's Flights Search developer page (2026) describes onboarding for airlines and online travel agencies, and says its materials are shared under NDA with select, invite-only partners. It describes Google Flights as a metasearch engine that links out to those partners. That is a feed for companies selling tickets, not a self-serve fare API for developers. If you want Google Flights fares in code, you need another route.
That leaves two options: build and maintain a scraper for the Google Flights page, or call an API that returns the page's fares as JSON. If you only need a few lookups, the website is fine. If you need fares in a script, an agent or a dashboard, the endpoints below are the shorter path. For the maintenance side of that trade-off, see what maintaining a scraper really involves.
Which endpoints does the Google Flights API have?
The Google Flights API has 7 endpoints, all GET, all 1 credit per successful call. Three are search endpoints (one-way, round-trip, date-range), one takes a booking token from a search, and three are lookups for airports, airlines and place names. They sit under the Travel area of the catalogue.
| Endpoint | Returns | Required parameters |
|---|---|---|
/v1/google-flights/one-way |
One Way | origin, destination, departure_date |
/v1/google-flights/round-trip |
Round Trip | origin, destination, departure_date, return_date |
/v1/google-flights/date-range |
Date Range | origin, destination, from_date, to_date |
/v1/google-flights/booking-details |
Booking Details | booking_token, origin, destination, departure_date, airline, flight_number |
/v1/google-flights/airports |
Airports | none |
/v1/google-flights/airlines |
Airlines | none |
/v1/google-flights/autocomplete |
Autocomplete | q |
You can try any of them in the playground on the API page before writing code.
How do you search one-way fares?
Send origin, destination and departure_date to GET /v1/google-flights/one-way with your key in the X-API-Key header. The response lists flights with a price, stop count, airline and per-leg times. This call asks for JFK to LAX on 15 December 2026:
curl "https://api.perceptlayer.com/v1/google-flights/one-way?origin=JFK&destination=LAX&departure_date=2026-12-15" \
-H "X-API-Key: $API_KEY"
You don't have a key yet? Get a free API key; the quick start covers the first call and authentication covers the header. Here is an excerpt of the recorded response, trimmed with …:
{
"flights": [
{
"price": 179,
"currency": "USD",
"total_duration_minutes": 384,
"stops": 0,
"airline_name": "JetBlue",
"emissions": {
"co2_kilograms": 426,
"typical_co2_kilograms": 344,
"difference_percent": 24
},
"booking_token": "CjRISVFvemhYdy1QZTBBQTR3SXdCRy0tLS0tLS0tLWVqY3J5N0FBQUFBR3JhOFJBQUFyOGdBEgZCNjIyMjMaCwiwiwEQAhoDVVNEOBxwsIsB",
"legs": [
{
"airline": "B6",
"flight_number": "2223",
"departure_airport": "JFK",
"arrival_airport": "LAX",
"departure_time": "2026-12-15T08:01:00",
"arrival_time": "2026-12-15T11:25:00",
"duration_minutes": 384
}
]
},
…
],
"search_metadata": {
"origin": "JFK",
"destination": "LAX",
"departure_date": "2026-12-15",
"cabin_class": "Economy",
"sort_by": "Top Flights",
"currency": "USD",
…
}
}
The second recorded itinerary was a nonstop Delta flight, number 773, at 189 USD and 378 minutes. Its emissions.difference_percent was -29, against 24 for the JetBlue flight above. search_metadata echoes the search, including the sort_by and cabin_class it applied.
Which one-way parameters narrow the results?
The optional parameters filter and sort the list. Allowed values below are the ones the endpoint documents.
| Parameter | Type | Notes |
|---|---|---|
adults, children, infants_in_seat, infants_on_lap |
integer | Passenger counts |
cabin_class |
string | economy, premium_economy, business, first |
max_stops |
string | any, nonstop, one_or_fewer, two_or_fewer |
sort_by |
string | top_flights, cheapest, departure_time, arrival_time, duration, emissions |
airlines[] |
list of string | Airline codes, up to 2 characters each |
max_price |
integer | Price ceiling |
max_duration_minutes |
integer | Duration ceiling |
exclude_basic, include_baggage |
boolean | Fare-type and baggage options |
departure_time_min, departure_time_max, arrival_time_min, arrival_time_max |
integer | Time windows |
currency, hl, gl |
string | Currency (up to 3 characters), language and country |
For a price-first view, add sort_by=cheapest&max_stops=nonstop.
How do you search round trips?
Use GET /v1/google-flights/round-trip with the same three parameters as one-way plus return_date. It accepts the same passenger, cabin, stop, sort and filter parameters, plus api_version (documented value: 2) and departure_token, a string of up to 16,384 characters.
curl "https://api.perceptlayer.com/v1/google-flights/round-trip?origin=JFK&destination=LAX&departure_date=2026-12-15&return_date=2026-12-22&sort_by=cheapest" \
-H "X-API-Key: $API_KEY"
We have no recorded round-trip response either, so this section stops at the request. The Round Trip page lists every parameter and has the playground for a real call. The call costs 1 credit, the same as one-way.
How do you search a range of dates in one call?
GET /v1/google-flights/date-range takes from_date and to_date along with origin and destination, in place of a single departure_date. An optional trip_duration integer is also accepted. Each successful call costs 1 credit.
We have no recorded date-range response, so we won't describe what it returns here; the playground on its page runs a real call. The cost angle is documented, though. Covering December with one-way takes one call per departure date, so 31 credits. One date-range call over the same window is 1 credit. Whether its output fits your use is something to check in the playground before you rely on it.
curl "https://api.perceptlayer.com/v1/google-flights/date-range?origin=JFK&destination=LAX&from_date=2026-12-01&to_date=2026-12-31" \
-H "X-API-Key: $API_KEY"
It also accepts passengers, cabin_class, exclude_basic, max_stops, currency, outbound_times, bags and api_version. The Date Range page shows what a call returns when you run it in the playground.
How do you look up airports, airlines and booking details?
The lookup endpoints take little or no input. GET /v1/google-flights/airports and GET /v1/google-flights/airlines take no parameters and return the airports and airlines lists. GET /v1/google-flights/autocomplete takes q (up to 255 characters) with optional hl and gl, and takes free text; its page shows the output.
curl "https://api.perceptlayer.com/v1/google-flights/airlines" \
-H "X-API-Key: $API_KEY"
booking-details is the follow-up to a search. Every flight in the one-way response carries a booking_token. Pass it with origin, destination, departure_date, airline (a 2-character code like B6) and flight_number (like 2223), all of which appear in the recorded flight above. What the call returns is on the Booking Details page.
When does another source fit better?
This API returns fares as found at the time of the call, and they may differ when you book. Treat a price as a snapshot for tracking, comparison or an agent's answer, not as a quote. If you need a bookable, ticketable fare, or you sell tickets yourself, an airline's own API or a booking-grade source is the better fit. For a handful of one-off lookups, the Google Flights website is enough.
What does a daily fare check cost?
A daily fare check costs 1 credit per route per day, because every successful call costs 1 credit. Tracking one route for 30 days is 30 × 1 = 30 credits, inside the 1,000 free credits you get each month after verifying an email. No credit card is needed.
Here is the arithmetic for larger watches:
| Watch (30 days) | Calls | Credits per month | Covered by |
|---|---|---|---|
| 1 route, one-way | 30 | 30 | free tier |
| 1 route, one-way + round-trip | 60 | 60 | free tier |
| 20 routes, one call a day | 600 | 600 | free tier |
| 100 routes, one call a day | 3,000 | 3,000 | free tier covers 1,000; the other 2,000 need a pack |
The 100-route watch is 100 routes × 30 daily calls. The free 1,000 credits cover the first 1,000 calls. For the remaining 2,000 you buy a Starter pack of 10,000 credits. Packs are sold whole, so 2,000 calls × 1 credit = 2,000 credits used, and the unused 8,000 credits last 12 months and cover later months. See pricing for what credits cost. Failed calls return X-Credits-Used: 0, and each success reports X-Credits-Remaining. See credits.
A minimal Python check that prints the cheapest nonstop and your balance:
import os
import requests
resp = requests.get(
"https://api.perceptlayer.com/v1/google-flights/one-way",
params={
"origin": "JFK",
"destination": "LAX",
"departure_date": "2026-12-15",
"sort_by": "cheapest",
"max_stops": "nonstop",
},
headers={"X-API-Key": os.environ["API_KEY"]},
timeout=30,
)
resp.raise_for_status()
flights = resp.json()["flights"]
best = flights[0]
print(best["airline_name"], best["price"], best["currency"])
print("credits left:", resp.headers["X-Credits-Remaining"])
Run it from a scheduler once a day and store the price. To avoid repeat charges on identical lookups, see caching API responses.
How do you handle errors and retries?
Errors return an HTTP status and a JSON body with error.code, error.message and error.request_id. The ones you'll meet are invalid_parameters (422) for a bad airport code or date, rate_limited (429) and temporarily_unavailable (503), which both carry a Retry-After header with the seconds to wait. See errors and rate limits.
Requests have no idempotency key, so a call that timed out on your side may still have succeeded and been billed. Read how to retry without paying twice before you wrap these calls in a loop. For agents, the same endpoints are available through the MCP server.
Next step: run the JFK to LAX call above in the playground, then move it into a daily job.
APIs in this post
Frequently asked questions
Does Google have an official Flights API?
No public one. Google's QPX Express API was announced for shutdown in 2017, with access ending on April 10, 2018 (Engadget, 2017). Google's Flights Search developer page (2026) now describes a program for airlines and online travel agencies, shared under NDA with select, invite-only partners. Perceptlayer's Google Flights API returns fares as JSON from publicly available sources, as found at the time of the call.
How much does a Google Flights API call cost?
Each successful call to any of the 7 endpoints costs 1 credit. Failed calls cost nothing. You get 1,000 free credits every month after verifying an email, with no credit card. After that, credits come in prepaid packs from 10,000 to 5,000,000 credits, so 20,000 calls × 1 credit = 20,000 credits. See pricing for what credits cost.
Can I search a range of dates in one call?
GET /v1/google-flights/date-range takes origin, destination, from_date and to_date, and costs 1 credit per successful call. It also accepts an optional integer trip_duration. Run it in the playground on the Date Range page to see what it returns.
Do I need an airport code or can I search by city name?
The origin and destination parameters accept up to 3 characters, so send IATA airport codes such as JFK or LAX. If you only have free text, call autocomplete with q to resolve it, or use airports to get the full list.
Can an AI agent call the Google Flights API?
Yes. The MCP server at https://api.perceptlayer.com/mcp exposes search_endpoints, get_endpoint and call_endpoint. The first two only read the catalogue and cost nothing. call_endpoint runs a flights endpoint with its parameters and spends 1 credit on success. See the MCP docs.