Google Flights has no public API. Google closed QPX Express, the developer API behind its fare engine, and never replaced it. Its partner programs let airlines and agencies sell tickets on Google, not read fares. To get fares in code, you read Google Flights' public pages; our API does that, and the script below finds the cheapest days to fly a route.
What Google's flights API was
Google's developer API for flights was QPX Express, which priced trips on the ITA engine behind Google Flights. Google stopped new sign-ups and shut it down on April 10, 2018, calling it a very basic pricing and shopping API. Google's flight partner programs today carry airline and agency fares into Google Flights; they don't hand fares back out. The Travel Impact Model API is public and free with a key, but returns emissions estimates, no fares.
Google Flights fares with ToolzerHub
We make ToolzerHub. Our Google Flights API has four routes, each a GET with the x-api-key header at 1 credit a call:
/v1/google-flights/searchreturns the flights for a day, with optionalreturn_date,cabin,stops, passenger counts andcurrency./v1/google-flights/price-calendarreturns a price for each departure day, up to 92 days, one-way or withtrip_length_daysfor round trips./v1/google-flights/date-gridreturns a 7x7 grid of round-trip prices, three days either side./v1/google-flights/booking-optionsreturns the booking options for a flight'sbooking_token.
origin and destination take a city name ("New York" covers JFK, LGA and EWR), an IATA airport or a metro code.
export TOOLZERHUB_API_KEY=your_key
curl -G -H "x-api-key: $TOOLZERHUB_API_KEY" \
--data-urlencode "origin=JFK" \
--data-urlencode "destination=LHR" \
--data-urlencode "departure_date=2026-12-10" \
"https://api.toolzerhub.com/v1/google-flights/search"
The first flight in data.best_flights, with most segment fields and its tokens trimmed:
{
"airlines": ["American"],
"departure_airport": "JFK",
"arrival_airport": "LHR",
"departure_time": "2026-12-10T21:15",
"arrival_time": "2026-12-11T09:15",
"duration_minutes": 420,
"stops": 0,
"price": 300,
"segments": [
{
"airline_code": "AA",
"flight_number": "AA 104",
"aircraft": "Boeing 787",
"legroom": "31 in",
"emissions_grams": 310837
}
],
"layovers": [],
"emissions": { "grams": 311000, "typical_for_route_grams": 434000, "difference_percent": -28 }
}
This search returned 3 best_flights and 17 other_flights, priced in USD. price_insights added a lowest_price of 298, a typical_price_range of 170 to 470 and a daily price history. One call priced all 31 December days, from 282 to 603 USD. The dearest of them:
{ "departure_date": "2026-12-20", "return_date": null, "price": 603 }
Find the cheapest days to fly
The script makes one price-calendar call for your date range and sorts the days by price. Then it runs a search on each of the 3 cheapest days. Each row holds the calendar price, the best flight's price, airlines, flight numbers, stops, times and Google's typical range. Save it as cheapest_flights.py and install requests (pip install requests).
import csv
import os
import sys
import time
import requests
BASE = "https://api.toolzerhub.com/v1/google-flights"
HEADERS = {"x-api-key": os.environ.get("TOOLZERHUB_API_KEY", "")}
FIELDS = ["origin", "destination", "date", "calendar_price", "price", "airlines", "flights",
"stops", "duration_minutes", "departure_time", "arrival_time", "typical_low", "typical_high"]
def get(path, params, tries=3):
for attempt in range(tries):
r = requests.get(f"{BASE}/{path}", headers=HEADERS, params=params, timeout=90)
if r.status_code in (429, 500, 502, 503, 504) and attempt < tries - 1:
time.sleep(10 * (attempt + 1))
continue
r.raise_for_status()
return r.json()["data"]
def main(origin, destination, start, end, top="3", out="cheapest_flights.csv"):
# One call prices every departure day in the range (up to 92 days), one-way.
days = get("price-calendar", {"origin": origin, "destination": destination,
"start_date": start, "end_date": end})["days"]
days = sorted((d for d in days if d["price"]), key=lambda d: d["price"])
print(f"{len(days)} priced days, cheapest {days[0]['price']} on {days[0]['departure_date']}, "
f"dearest {days[-1]['price']} on {days[-1]['departure_date']}")
new_file = not os.path.exists(out)
with open(out, "a", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=FIELDS)
if new_file:
writer.writeheader()
for day in days[: int(top)]:
# Then a full search on each of the cheapest days for the actual flights.
found = get("search", {"origin": origin, "destination": destination,
"departure_date": day["departure_date"]})
flights = found["best_flights"] or found["other_flights"]
if not flights:
print(f"{day['departure_date']}: no flights")
continue
best = min(flights, key=lambda x: x["price"] or 10**9)
typical = (found.get("price_insights") or {}).get("typical_price_range") or [None, None]
writer.writerow({
"origin": origin, "destination": destination, "date": day["departure_date"],
"calendar_price": day["price"], "price": best["price"],
"airlines": " + ".join(best["airlines"]),
"flights": " ".join(s["flight_number"] for s in best["segments"]),
"stops": best["stops"], "duration_minutes": best["duration_minutes"],
"departure_time": best["departure_time"], "arrival_time": best["arrival_time"],
"typical_low": typical[0], "typical_high": typical[1],
})
print(f"{day['departure_date']}: {best['price']} {found['currency']}, "
f"{' + '.join(best['airlines'])}, {best['stops']} stops")
if __name__ == "__main__":
if len(sys.argv) < 5:
sys.exit("usage: python cheapest_flights.py JFK LHR 2026-12-01 2027-02-28 [top] [file.csv]")
if not HEADERS["x-api-key"]:
sys.exit("set TOOLZERHUB_API_KEY first")
main(*sys.argv[1:])
python cheapest_flights.py JFK LHR 2026-12-01 2027-02-28 makes 4 calls and appends 3 rows. We ran it one-way on JFK to LHR, SFO to NRT and Chicago to Paris, by city name for the last, from December through February.
What the price calendars showed
Each route came back with 90 priced days. Prices are one-way, in USD:
| Route | Cheapest day | Dearest day | Cheapest flight searched | Seconds |
|---|---|---|---|---|
| JFK to LHR | 266, Feb 1 | 603, Dec 20 | 300, JetBlue B6 1107 nonstop | 14.3 |
| SFO to NRT | 359, Dec 1 | 1,852, Dec 19 | 359, ZIPAIR ZG 25 nonstop | 6.1 |
| Chicago to Paris | 299, Jan 7 | 800, Dec 18 | 299, JetBlue one stop | 5.7 |
The dearest day on all three routes fell between Dec 18 and Dec 20. ZIPAIR's ZG 25 held 359 on Dec 1, Dec 2 and Jan 18.
On SFO to NRT and Chicago to Paris the calendar price matched the search. On JFK to LHR the calendar said 266, but the cheapest flight a search returned on Feb 1 to 3 was 300. Re-check a calendar price with a search before you send an alert. Google's typical range for JFK to LHR in February was 195 to 285, below every flight it returned.
What it costs
A route check is 4 credits: one calendar call and three searches. A daily check of 5 routes is 20 credits a day, about 600 a month. The 100 free credits a month cover 25 route checks; $19 buys 10,000 credits that never expire, and plans for higher volume cover more routes. Set your key and run the script on your route; the first CSV is ready in seconds.
For other travel prices, see our Skyscanner API post and Airbnb listings and calendars. To see how a fare moved over two months, read Google Flights price history; for hotel prices by seller, the Google Hotels API.
We are not affiliated with Google.