SerpBase
Back to Blog

Google Flights API: Get the Flight Price Card from Google Search as JSON

Google has no public flights API. A route query returns the flight card from Google Search as JSON: airlines, durations, prices and stops. Tested on two routes.

November 27, 2026
By SerpBase Team3 min read

Short answer: Google has no public flights API, but a route query on /google/search returns the flight card Google shows on the results page as a flight_search object — origin, destination and the cheapest fare per airline with duration, price and a Google Flights link.

It is the card from Google Search, not a full Google Flights search. You do not choose the dates or cabin; you get what Google decides to show for the route. For "what does this route cost right now, roughly, and who flies it" that is enough, for one credit.

The request

curl -X POST 'https://api.serpbase.dev/google/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"q":"flights from new york to london","gl":"us","hl":"en"}'

What comes back

We ran two routes on 27 November 2026.

New York to London, mobile (the default device).

"flight_search": {
  "title": "Flights to London",
  "origin": "New York, NY (all airports)",
  "destination": "London, United Kingdom (all airports)",
  "departure_date": "Thu, Jan 7",
  "return_date": "Wed, Jan 13",
  "options": [
    {"airline": "Multiple airlines", "duration": "14h 50m+", "price": "$599", "link": "https://www.google.com/travel/flights?..."},
    {"airline": "Iberia", "duration": "6h 55m+", "price": "$621", "link": "..."},
    {"airline": "American", "duration": "6h 55m", "price": "$663", "link": "..."}
  ]
}

Los Angeles to Tokyo, desktop. Origin Los Angeles, CA (LAX), destination Tokyo, Japan (all airports), four options, each with a stops field: ZIPAIR Tokyo 11h 55m $661 Nonstop; American 1d 1h+ $882 Connecting; Air Canada 1d 6h+ $895 Connecting; American 12h 15m $927 Nonstop. No dates on this one.

So the two devices give different details: the mobile card had the travel dates, the desktop card had stops.

Python: log the cheapest fare on a few routes

import csv, datetime, time, requests

ROUTES = [("new york", "london"), ("los angeles", "tokyo")]

with open("fares.csv", "a", newline="") as f:
    out = csv.writer(f)
    for a, b in ROUTES:
        r = requests.post(
            "https://api.serpbase.dev/google/search",
            headers={"X-API-Key": "YOUR_API_KEY"},
            json={"q": f"flights from {a} to {b}", "gl": "us", "hl": "en"},
            timeout=60,
        ).json()
        card = r.get("flight_search") if r["status"] == 0 else None
        if not card:
            print(a, b, "no flight card:", r.get("error"))
            continue
        for o in card["options"]:
            out.writerow([datetime.date.today(), card["origin"], card["destination"],
                          card.get("departure_date"), card.get("return_date"),
                          o["airline"], o["duration"], o["price"]])
        time.sleep(1)

Things that trip people up

  • Google picks the dates. The mobile card said Thu, Jan 7 to Wed, Jan 13. You cannot ask for other dates here; follow an option's link to Google Flights for that.
  • Prices are strings with the currency sign ($599), in the currency of the gl you send. Strip and convert before you compare.
  • duration can end with + (14h 50m+, 1d 1h+), meaning "from". Treat it as a lower bound.
  • stops came only on desktop and dates only on mobile in our tests. Pick the device for the detail you need and use .get() for the other.
  • Multiple airlines is a real value of airline, for itineraries that mix carriers.
  • The card is left out when Google does not show one. Phrase the query as a route (flights from X to Y) and check for the field.
  • Three or four options, not a full list. It is the cheapest fare per airline that Google chose to show.

Related endpoints

The same search response carries organic results from the fare sites, and other cards when Google shows them: stock quotes, weather, local places.

Cost and limits

Each search costs 1 credit; failed requests are not charged. The response is always HTTP 200 with a status field: 0 means success, anything else comes with an error string. Credits cost $0.25–$0.50 per 1,000 depending on the plan, and new accounts get 500 free credits without a card.