How to scrape Google Flights prices, routes, and CO2 data

Last updated

There is no public Google Flights API: Google shut down QPX Express on April 10, 2018 and never replaced it. Datapika's Google Flights scraper on Apify fills that gap by running a route and date query against the live Google Flights results page and returning every itinerary as structured JSON. Google typically shows 30 to 80 itineraries per query, and each one costs $0.0015, so a single search runs roughly 5 to 12 cents and 1,000 itineraries cost $1.50. Each row carries the total price, airline IATA codes, stop count, per-segment airports and aircraft, and CO2 emissions in grams.

Is there an official Google Flights API?

No. Google's only public airfare feed was QPX Express, a product of its $700 million ITA Software acquisition. Google announced on November 1, 2017 that it would retire the API, citing low interest among travel partners, and switched it off on April 10, 2018. The enterprise version stayed available only to large contracted customers, so independent developers lost programmatic access to Google's fare data. That is the gap a Google Flights scraper fills: it reads the public results page for a route and date and converts what a traveler would see into machine-readable rows. Datapika runs on Apify with no API key on your side and no login to Google, and the store listing showed 3,696 runs as of August 2026. You pay per itinerary delivered rather than per month, which matters when you only need a few routes checked once a day.

  • QPX Express was retired on April 10, 2018 after a five-month notice period, per TechCrunch
  • Google cited low interest among travel partners as the reason for the shutdown
  • QPX Enterprise continued, but only for large contracted travel companies
  • Datapika reads the public Google Flights results page instead, no key or Google account needed
  • Billing is per itinerary returned, not per month or per API call

What fields does a Google Flights scraper return per itinerary?

Every dataset row is one itinerary for the route and date you asked for. At the top level you get the total price as a number, the list of airline names and their two-letter IATA codes, the stop count, total trip time in minutes, and ISO 8601 departure and arrival timestamps. The segments array then breaks the trip into legs, each with the origin and destination airport code and full name, leg departure and arrival times, leg duration, and the aircraft type as Google displays it, for example Airbus A320. Two carbon fields close the record: this itinerary's CO2 estimate in grams and the typical figure Google reports for the route, so you can flag greener options without extra math. A scraped_at UTC timestamp is stamped on every row, and the query inputs (airports, date, trip type, cabin, passenger counts) are echoed back so rows from different runs stay self-describing.

  • price (number), airline_codes (array of IATA codes), airline_names (array)
  • stops (integer, 0 = nonstop) and duration_min_total (integer minutes)
  • departure and arrival as ISO datetimes for the whole itinerary
  • segments: per-leg airport code and name, times, duration_min, plane_type
  • carbon_emission_g and carbon_typical_on_route_g in grams
  • scraped_at plus echoed inputs: from_airport, to_airport, date, return_date, trip, seat, passengers

How much does it cost to scrape Google Flights?

Datapika charges one event, itinerary scraped, at $0.0015, as listed on the Apify Store in August 2026. Nothing is charged for the query itself, so a route with no results costs nothing. Google Flights typically surfaces 30 to 80 itineraries per route and date, which puts a single search between about 4.5 and 12 cents. The max_results input defaults to 25 and caps at 200, so you control the ceiling on every run. At the default of 25 a search costs at most $0.0375, and 1,000 itineraries in any combination of routes cost $1.50. For a fare monitor that checks 20 routes twice a day at the default cap, that is 1,000 itineraries per day, or roughly $45 per month, with no base subscription. If you set a maximum total charge on the run in Apify, the actor stops pushing rows once that budget is reached, and the charge is posted once at the end for the rows actually delivered.

  • $0.0015 per itinerary returned, Apify Store, August 2026
  • Typical single search: 30 to 80 itineraries, about 4.5 to 12 cents
  • max_results default 25 (at most $0.0375 per search), maximum 200
  • 1,000 itineraries = $1.50; 10,000 = $15
  • No charge for empty results or for the query itself

Which routes, trip types, and cabins can you scrape?

The input takes three-letter IATA airport codes for origin and destination, such as JFK to LAX or LHR to NRT, and a departure date in YYYY-MM-DD format. Leave the date blank and the actor searches 30 days from today. Add a return_date and set trip to round-trip for combined outbound and return pricing; multi-city is the third trip type. Cabin class is one of four values: economy, premium-economy, business, or first. Passenger counts follow Google's own model: 1 to 9 adults, up to 8 children aged 2 to 11, and infants under 2 split into in-seat and on-lap, up to 8 each, so family and group fares come back priced correctly. The language input accepts an ISO code such as en, es, fr, de or ja and defaults to en, with 30+ result languages supported, which changes airline and airport names in the output to match the locale. Runs default to 1,024 MB of memory and a 300 second timeout.

  • Origin and destination as 3-letter IATA codes (JFK, LAX, LHR, CDG, NRT)
  • Trip types: one-way, round-trip, multi-city
  • Cabins: economy, premium economy, business, first
  • Passengers: 1 to 9 adults, 0 to 8 children, infants in seat and on lap
  • Language: ISO code such as en, es, fr, de, ja, 30+ supported, default en
  • Date defaults to today plus 30 days when left empty

How do developers and AI agents call the Google Flights scraper?

Three entry points share the same actor. In the Apify Console you fill the form and download the dataset as JSON, CSV, or Excel. From code you call the Apify API with your token: POST the input object to the run-sync-get-dataset-items endpoint for openclawai~google-flights-scraper and the response body is the itinerary array, ready for a pandas DataFrame or a Postgres insert. For agents, the actor is exposed as an MCP tool through Apify's MCP server at mcp.apify.com, so a Claude or GPT based travel assistant can ask for JFK to LAX on a given date and receive typed rows without HTML parsing. Because the query inputs are echoed in every row, you can fan out dozens of route and date combinations in parallel runs and merge the datasets by from_airport, to_airport, and date. Schedule runs in Apify to build a daily fare history for a route.

  • Console: fill the form, run, export JSON, CSV, or Excel
  • REST: run-sync-get-dataset-items returns the itinerary array in one call
  • Python: pip install apify-client, then client.actor('openclawai/google-flights-scraper').call(run_input=...)
  • MCP: add the actor as a tool through Apify's MCP server at mcp.apify.com
  • Schedules and webhooks in Apify turn one query into a daily fare history
Output fields per itinerary, with values from the JFK to LAX example in the actor README
FieldExampleNotes
price149Total fare as a number in the displayed currency, typically USD; null if Google shows no fare
airline_codes["B6"]Two-letter IATA airline codes, one per operating carrier
airline_names["JetBlue"]Human-readable names matching airline_codes
stops0Number of layovers; 0 means nonstop
duration_min_total353Door-to-door trip time in minutes
departure / arrival2026-06-15T06:00:00 / 2026-06-15T08:53:00ISO datetimes for first departure and final arrival, local airport time
segments[].from_airport{"code": "JFK", "name": "John F. Kennedy International Airport"}Per-leg origin with IATA code and full airport name; to_airport has the same shape
segments[].plane_typeAirbus A320Aircraft as Google displays it, per leg
segments[].duration_min353Leg duration in minutes; departure and arrival per leg also included
carbon_emission_g407000Estimated CO2 for this itinerary in grams
carbon_typical_on_route_g363000Google's typical CO2 for the route; compare to flag greener options
scraped_at2026-04-30T10:18:06.919ZUTC timestamp of the search; inputs (route, date, trip, seat, passengers) are echoed alongside

How to do it

  1. 1.Open https://apify.com/openclawai/google-flights-scraper and enter the origin and destination IATA codes (for example JFK and LAX), a departure date, and an optional return date.
  2. 2.Pick the trip type (one-way, round-trip, multi-city), a cabin class, and passenger counts, then set max_results between 1 and 200 to cap your spend at $0.0015 per itinerary.
  3. 3.Start the run and export the dataset as JSON, CSV, or Excel, or fetch it through the Apify API with the run-sync-get-dataset-items endpoint.
  4. 4.For AI agents, connect Apify's MCP server at https://mcp.apify.com and enable openclawai/google-flights-scraper as a tool so the assistant can request itineraries directly.
Run the Google Flights Scraper

Questions, answered

Does Google Flights have an official API, and what happened to it?

No public API exists today. Google's QPX Express API, built on the ITA Software technology it bought for $700 million, was the only sanctioned airfare feed. Google announced the shutdown on November 1, 2017, citing low interest among travel partners, and closed it on April 10, 2018. Only the enterprise version survived for large contracted customers. Scraping the public Google Flights results page is now the practical route to this data for independent developers.

Is the flight data live or cached?

Live. Every run performs a fresh Google Flights search at the moment you start it, and each row carries a scraped_at UTC timestamp so you know exactly when the fare was observed. There is no shared cache between customers. If you need price history, schedule the actor in Apify and append each run's dataset to your own store; fares change often enough that a snapshot from an hour ago can already be stale.

What currency is the price in, and does the output include booking links?

The price field is the total Google displays for the itinerary, typically in USD, and it can be null when Google shows no fare for a result. The output does not include a booking or deep link, because Google Flights routes purchases through airline and agency sites that vary per itinerary. Use the airline codes, flight times, and airport codes to rebuild a search on the carrier's site or in your own booking flow.

How many itineraries does one search return, and can I get more?

Google Flights typically surfaces 30 to 80 itineraries per route and date, and the actor returns up to the max_results you set, default 25, maximum 200. If Google shows fewer results than your cap, you are charged only for what is delivered. To cover more options, run separate searches for nearby dates or alternate airports and merge the datasets using the echoed from_airport, to_airport, and date fields.

Can I scrape round-trip and multi-city itineraries?

Yes. Set trip to round-trip and supply a return_date to get combined outbound and return pricing, or set trip to multi-city. The segments array lists every leg with its own airports, times, duration, and aircraft type, and the top-level stops count tells you how many layovers the itinerary includes. All four cabin classes and full passenger mixes (adults, children, infants in seat, infants on lap) work with every trip type.

What are the run limits and failure modes?

The default run uses 1,024 MB of memory with a 300 second timeout, which is ample for a single route and date. Google sometimes throttles repeated queries, so the actor retries each search up to 3 times with 2, 4 and 8 second backoff before failing the run with a clear status message; a failed run pushes no rows and bills nothing. Routes with no direct or connecting service return an empty dataset at no charge.

Keep reading