Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Flights API examples — price calendar, cheapest destinations, booking options

Google has had no public flights API since QPX Express shut down in 2018. These are three small, working Python scripts that get the data anyway, through the Google Flights Scraper Actor on Apify. No browser, no proxy setup, no HTML parsing — the Actor returns flat JSON rows.

Every output below is a real run, not an illustration.

pip install apify-client
export APIFY_TOKEN=...   # console.apify.com/settings/integrations

1. Which day of the next two months is cheapest?

python examples/cheapest_day.py DPS SIN 45
DPS -> SIN: 45 priced days

  2026-11-19      50 USD
  2026-11-20      50 USD
  2026-11-27      50 USD
  2026-11-21      56 USD
  2026-11-26      56 USD

Cheapest: 2026-11-19 at 50 USD

One call returns the whole price calendar as rows, so you can sort, chart or diff it against yesterday's run. Useful for a fare alert that only fires on a real drop.

2. Where can I fly cheaply from here?

python examples/explore_from.py DPS 10
Cheapest destinations from DPS

     63 USD  Komodo                 Indonesia        Wings Abadi Airlines nonstop    1.5h
     91 USD  Yogyakarta             Indonesia        Lion                 nonstop    1.5h
    107 USD  Perth                  Australia        Jetstar              nonstop    3.6h
    190 USD  Brisbane               Australia        Batik Air            nonstop    5.8h
    211 USD  Sydney                 Australia        Batik Air            nonstop    6.1h

This is the "Explore" map behind Google Flights, as a table: city, country, price, airline, stops and flight time. Coordinates come back too, if you are putting it on a map.

3. Who actually sells this ticket, and for how much?

python examples/who_sells_it.py DPS SIN 2026-11-19
Jetstar — 50 USD
       50 USD  (870000 IDR)         Jetstar [airline]
      119 USD  (2085182 IDR)        Qantas [airline]
      128 USD  (2251997 IDR)        Jettzy [agency]

Scoot — 64 USD
       64 USD  (1112308 IDR)        Scoot [airline]
       65 USD  (1139996 IDR)        Jettzy [agency]

The same seat, sold three ways at 50, 119 and 128 dollars. Each option carries the seller, whether it is the airline or an agency, the price in the local currency of the point of sale, and a direct booking link. This is the part most flight scrapers skip.

What else the Actor returns

Beyond these three scripts: flight numbers, aircraft type, layover airports and durations, CO₂ emissions per itinerary, Google's own price level ("low" / "typical" / "high") with the historical band it compares against, multi-city itineraries, and batch routes in one run. Filters cover cabin, stops, airlines to include or exclude, max price, max duration, max layover, and departure/arrival time windows.

Full field list and input reference: apify.com/lergassy/google-flights-scraper

Notes

  • Prices are what Google Flights shows for that point of sale. Set market (a two-letter country) to price a route the way a buyer in another country sees it — fares genuinely differ.
  • The Actor reads Google's own search endpoint and falls back to the rendered page when that endpoint refuses a datacentre address; resultsSource in every row tells you which path ran.
  • These scripts use apify-client 3.x, where call() returns a Run object — run.default_dataset_id, not run["defaultDatasetId"] as older tutorials show.

MIT licensed. Issues and pull requests welcome.

About

Working Python examples for Google Flights data: price calendar, cheapest destinations, and which seller offers a fare at what price

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors