---
title: "Google Flights API: Fares, Date Ranges and Airports"
description: "Get Google Flights fares as JSON: one-way, round-trip and date-range calls, a recorded JFK to LAX response, and the credit cost of a daily fare check."
url: https://perceptlayer.com/blog/google-flights-api
---

[Blog](https://perceptlayer.com/blog) / [API guides](https://perceptlayer.com/blog/category/api-guides)

# Google Flights API: Fares, Date Ranges and Airports

28 Aug 2026 Perceptlayer 7 min read

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.

## Key takeaways

-   Google shut down its QPX Express flights API in April 2018. The Google Flights API here offers 7 endpoints for fares as JSON.
-   `GET /v1/google-flights/one-way` needs only `origin`, `destination` and `departure_date`. It returns itineraries with `price`, `stops`, `legs` and `emissions`.
-   `round-trip` adds `return_date`, and `date-range` takes `from_date` and `to_date` instead of a single date.
-   Every endpoint costs 1 credit per successful call. A daily check of one route is 30 credits a month, well inside the free 1,000.
-   Each flight carries a `booking_token` you can pass to `booking-details`.

## 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](https://www.engadget.com/2017-11-01-google-flight-data-api-shutdown.html), 2017). The Points Guy quotes a Google spokesperson giving the reason as low interest among its travel partners ( [The Points Guy](https://thepointsguy.com/2017/11/google-stop-flight-data-travel), 2017). Engadget adds that Google kept a separate enterprise QPX offering.

What exists today is partner-only. Google's [Flights Search developer page](https://developers.google.com/travel/flights) (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](https://perceptlayer.com/blog/scraper-vs-api-maintenance-cost).

## Which endpoints does the Google Flights API have?

The [Google Flights API](https://perceptlayer.com/apis/google-flights) 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](https://perceptlayer.com/verticals/travel) area of the catalogue.

| Endpoint | Returns | Required parameters |
| --- | --- | --- |
| [`/v1/google-flights/one-way`](https://perceptlayer.com/apis/google-flights/one-way) | One Way | `origin`, `destination`, `departure_date` |
| [`/v1/google-flights/round-trip`](https://perceptlayer.com/apis/google-flights/round-trip) | Round Trip | `origin`, `destination`, `departure_date`, `return_date` |
| [`/v1/google-flights/date-range`](https://perceptlayer.com/apis/google-flights/date-range) | Date Range | `origin`, `destination`, `from_date`, `to_date` |
| [`/v1/google-flights/booking-details`](https://perceptlayer.com/apis/google-flights/booking-details) | Booking Details | `booking_token`, `origin`, `destination`, `departure_date`, `airline`, `flight_number` |
| [`/v1/google-flights/airports`](https://perceptlayer.com/apis/google-flights/airports) | Airports | none |
| [`/v1/google-flights/airlines`](https://perceptlayer.com/apis/google-flights/airlines) | Airlines | none |
| [`/v1/google-flights/autocomplete`](https://perceptlayer.com/apis/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:

```bash
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](https://perceptlayer.com/signup); the [quick start](https://docs.perceptlayer.com/quickstart) covers the first call and [authentication](https://docs.perceptlayer.com/authentication) covers the header. Here is an excerpt of the recorded response, trimmed with `…`:

```json
{
  "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.

```bash
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](https://perceptlayer.com/apis/google-flights/round-trip) 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.

```bash
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](https://perceptlayer.com/apis/google-flights/date-range) 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.

```bash
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](https://perceptlayer.com/apis/google-flights/booking-details).

## 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](https://perceptlayer.com/pricing) for what credits cost. Failed calls return `X-Credits-Used: 0`, and each success reports `X-Credits-Remaining`. See [credits](https://docs.perceptlayer.com/credits).

A minimal Python check that prints the cheapest nonstop and your balance:

```python
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](https://perceptlayer.com/blog/cache-web-data-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](https://docs.perceptlayer.com/errors) and [rate limits](https://docs.perceptlayer.com/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](https://perceptlayer.com/blog/retry-web-api-calls-without-paying-twice) before you wrap these calls in a loop. For agents, the same endpoints are available through the [MCP server](https://docs.perceptlayer.com/ai-agents).

Next step: run the JFK to LAX call above in the [playground](https://perceptlayer.com/apis/google-flights), then move it into a daily job.

## APIs in this post

-   [Google Flights **1 credit per call** · 7 endpoints](https://perceptlayer.com/apis/google-flights)

## 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](https://www.engadget.com/2017-11-01-google-flight-data-api-shutdown.html), 2017). Google's [Flights Search developer page](https://developers.google.com/travel/flights) (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](https://perceptlayer.com/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](https://perceptlayer.com/apis/google-flights/date-range) 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](https://docs.perceptlayer.com/ai-agents).

travel flights google flights fares airports

## More from the blog

1.  [API guides](https://perceptlayer.com/blog/category/api-guides) 7 Sept 2026 Perceptlayer 6 min read
    
    ## [Kiwi.com API: Search Fares and Cheapest Dates as JSON](https://perceptlayer.com/blog/kiwi-flights-api-cheapest-dates)
    
    Search Kiwi.com fares by origin, destination and date, then scan a window with calendar-cheapest-dates. A recorded London–Barcelona response and costs.
    
2.  [API guides](https://perceptlayer.com/blog/category/api-guides) 22 Oct 2026 Perceptlayer 7 min read
    
    ## [Booking.com Reviews API: Hotel Review Scores as JSON](https://perceptlayer.com/blog/booking-com-reviews-api-json)
    
    Pull Booking.com review scores and guest reviews as JSON with two GET calls at 1 credit each. Parameters, sorting, paging and the cost of covering a city.
    
3.  [API guides](https://perceptlayer.com/blog/category/api-guides) 21 Oct 2026 Perceptlayer 6 min read
    
    ## [Vrbo API: Vacation Rental Listings and Availability](https://perceptlayer.com/blog/vrbo-api-vacation-rental-listings)
    
    Search Vrbo with required check\_in and check\_out, then pull a listing's availability and reviews by property\_id. Parameters, cURL and the cost of 50 listings.
