Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Flights Scraper for Python (no browser, no API key)

Search Google Flights from Python or the command line and get clean JSON: prices, airlines, flight numbers, times, stops, layovers, aircraft, legroom, CO2 emissions and Google's price history for the route.

  • No Selenium / Playwright - a plain HTTPS request, ~1 second per search
  • One-way and round trip, any cabin class, adults / children / infants
  • Nonstop / max-stops and airline filters
  • City codes (NYC, LON, PAR) search all airports of the city
  • Any currency and language

Install

pip install curl_cffi
git clone https://github.com/janik4321sdfa/google-flights-python
cd google-flights-python

Command line

python -m google_flights JFK LHR 2026-11-12
python -m google_flights PRG NYC 2026-12-01 --return-date 2026-12-08 --cabin business
python -m google_flights LON DXB 2027-01-10 --adults 2 --nonstop --currency EUR --json
    295 USD  2026-11-12T08:00 -> 2026-11-12T20:10   430 min  stops=0  Virgin Atlantic  (VS 26)
    312 USD  2026-11-12T18:30 -> 2026-11-13T06:40   430 min  stops=0  British Airways  (BA 178)
    ...
Typical price range: 225 - 295 USD (today: typical)

Python

from google_flights import search

flights, insights, url = search("JFK", "LHR", "2026-11-12", adults=2, max_stops=0)
cheapest = min(flights, key=lambda f: f["price"])
print(cheapest["price"], cheapest["airlines"], cheapest["legs"][0]["flightNumber"], cheapest["co2Kg"])
print(insights["typicalPriceLow"], insights["typicalPriceHigh"], insights["priceHistory"][:3])

Every flight contains price (total for all passengers), airlines, departure, arrival, durationMinutes, stops, layovers, legs (flight number, aircraft, legroom, codeshares), co2Kg, typicalCo2Kg and isBestFlight.

How it works

Google Flights encodes the search in the tfs URL parameter - a base64 protobuf message. build_tfs() builds it by hand (no protobuf dependency), and parse_results() reads the server-rendered ds:1 data block of the results page.

Running at scale (many routes, daily price tracking)

Google starts rate-limiting a single IP after many searches. If you need thousands of searches, scheduled price monitoring or no maintenance when Google changes its page, use the hosted version:

Google Flights Scraper on Apify - same data, rotating IPs, scheduling, CSV/Excel export, $1 per 1,000 flights, you pay only for results.

Related hosted scrapers: Google Hotels - Google Trends - YouTube Transcripts

Disclaimer

Unofficial, not affiliated with Google. Uses publicly available flight search results; respect Google's terms and use reasonable request rates.

License

MIT

About

Unofficial Google Flights scraper for Python: prices, airlines, stops, CO2, price history. No browser, no API key.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages