To scrape Google Flights, give a scraper a route and a date, let it read Google's public flight results page, and save every itinerary with its fare, airline, flight numbers, times, stops, layovers and aircraft. On Scrape.ly that is one ready-made Actor and a flat $0.02024 per search, however many itineraries the page lists, with no Google account, flights API key or proxy of your own.
This guide shows what each search returns, the no-code steps, the same job in curl, Python, Node.js and through an AI agent, and a real run from 26 October 2026: 15 one-way itineraries from Los Angeles to New York on the day before Thanksgiving, with Google's own price history for the route. More Google how-tos: Google Shopping and Google Scholar; for stays, see Airbnb MCP.
What data you can get from Google Flights
The Google Flights Scraper saves one dataset item per search. It holds every itinerary from the results page (all_flights), split into best_flights and other_flights the way Google ranks them, plus price_insights and airports. The Flights view shows one row per itinerary:
| Field | What it holds |
|---|---|
price, currency | The fare for your search: one-way, or round-trip when you set a return date |
airlines, flight_numbers | Carrier and flight numbers, such as B6 300, B6 702 for a connection |
departure_time, arrival_time | Local times at each end |
stops, stops_label, layover_airports | Number of stops, "Nonstop" or "1 stop", and where |
duration, duration_minutes | Total travel time |
travel_class, overnight, often_delayed | Cabin and Google's red-eye and delay flags |
carbon_emissions_g | Google's carbon estimate in grams |
flights[] (in best_flights, other_flights) | Each leg with airplane, legroom and amenities such as Wi-Fi and power |
price_insights | Lowest fare, price level, typical range and a daily price history for the route |
search_metadata tells you how many itineraries the page held and how many Google marked as best. The price_insights block is the part most DIY scrapers never reach: Google's own view of whether today's fare is low, typical or high.
How to scrape Google Flights without code
- Open the Actor's page in the Scrape.ly Store.
- Pick the preset One-way LAX to JFK, 15 flights. "Try this input" loads it in the console. This is the exact input of our run:
{
"origin": "LAX",
"destination": "JFK",
"maxResults": 15,
"adults": 1,
"children": 0,
"infants": 0,
"currency": "USD",
"language": "en",
"country": "us",
"travelClass": "economy"
}- Set your own airports and date, then click Start. The preset leaves
outboundDateempty, so the Actor searched 30 days ahead: 25 November 2026. - Open the Flights view, or export JSON, CSV or Excel.
The fields that matter most:
origin,destination: airport or metro codes. Separate several with commas (CDG,ORY) to search a whole city.outboundDate,returnDate:YYYY-MM-DD. A return date makes it a round trip, and each outbound row then shows the round-trip fare, as in the New York to London round-trip preset.maxResults: itineraries to keep. Best matches are kept first.maxStops,maxPrice,airlines,travelClass: filters.maxStops: 0keeps nonstop flights only.country,currency,language: the point of sale. Google shows different fares to a traveler in the US and one in Germany.
Scrape Google Flights with the API
Create a token under Settings → API & Integrations in the dashboard and export it as SCRAPELY_TOKEN. Our run took 5 seconds, so the synchronous endpoint returns the search in one call:
curl -X POST "https://api.scrape.ly/v2/actors/roamandroof~google-flights-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer $SCRAPELY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"origin": "LAX", "destination": "JFK", "outboundDate": "2026-11-25", "maxResults": 15, "currency": "USD", "country": "us"}'The call waits up to 45 seconds and returns a JSON array with one item per search. If a run ever takes longer, the call answers 408 while the run keeps going, so don't call again: start it with POST /v2/actors/roamandroof~google-flights-scraper/runs, poll /v2/actor-runs/RUN_ID?waitForFinish=60, then read /v2/actor-runs/RUN_ID/dataset/items. The Actors API docs cover each step.
Scrape flight prices across several dates with Python
One run is one route on one date, so the way to scrape flight prices across a week is one call per date. Install the client with pip install scrapely-client-python:
import os
from scrapely_client import ScrapelyClient
client = ScrapelyClient(os.environ["SCRAPELY_TOKEN"], api_url="https://api.scrape.ly")
for date in ["2026-11-23", "2026-11-24", "2026-11-25"]:
run = client.actor("roamandroof/google-flights-scraper").call(
run_input={"origin": "LAX", "destination": "JFK", "outboundDate": date, "maxResults": 20, "maxStops": 0}
)
search = next(client.dataset(run.default_dataset_id).iterate_items())
cheapest = min(search["all_flights"], key=lambda f: f["price"])
level = search["price_insights"]["price_level"]
print(f'{date} ${cheapest["price"]} {cheapest["airlines"]} {cheapest["flight_numbers"]} ({level})')Three dates cost 3 × $0.02024 = $0.061 at list price. Run the script daily from a schedule and you have a fare tracker.
Node.js (npm install scrapely-client):
import { ScrapelyClient } from 'scrapely-client';
const client = new ScrapelyClient({ token: process.env.SCRAPELY_TOKEN, baseUrl: 'https://api.scrape.ly' });
const run = await client.actor('roamandroof/google-flights-scraper').call({
origin: 'LAX',
destination: 'JFK',
outboundDate: '2026-11-25',
maxResults: 15,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].all_flights.map((f) => [f.price, f.airlines, f.flight_numbers, f.stops_label]));The Python client docs cover the rest; the JavaScript client works the same way. If you're comparing it with flight data APIs, the Google Flights API page presents the same Actor as an API product.
With an AI agent (MCP)
Scrape.ly runs a hosted MCP server at https://mcp.scrape.ly. In Cursor, add it to ~/.cursor/mcp.json:
{
"mcpServers": {
"scrapely": {
"url": "https://mcp.scrape.ly",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
}In Claude Code, run claude mcp add --transport http scrapely https://mcp.scrape.ly, then /mcp to sign in. Add ?actors=roamandroof/google-flights-scraper to the URL to expose only this Actor. Then ask: "Use scrapely to search Google Flights from LAX to JFK on 25 November, nonstop only, and tell me the three cheapest fares with times and aircraft." The agent calls call-actor and get-actor-output; the run in this article was started the same way. The MCP docs list the other clients.
A real run: LAX to JFK the day before Thanksgiving
We ran the preset on 26 October 2026. With no date set, it searched Wednesday, 25 November 2026, the day before Thanksgiving. It saved 15 itineraries (3 best, 12 other) in 5 seconds as one search, and its list price was $0.02024. The first five rows, in Google's order:
| Category | Price | Airline | Flights | Departs | Arrives | Stops | Duration |
|---|---|---|---|---|---|---|---|
| best | $204 | JetBlue | B6 524 | 13:30 | 21:57 | Nonstop | 5h 27m |
| best | $204 | Delta | DL 938 | 15:40 | 23:52 | Nonstop | 5h 12m |
| best | $215 | American | AA 32 | 11:44 | 20:00 | Nonstop | 5h 16m |
| other | $174 | JetBlue | B6 300, B6 702 | 07:20 | 20:31 | 1 stop | 10h 11m |
| other | $185 | JetBlue | B6 300, B6 2102 | 07:20 | 19:04 | 1 stop | 8h 44m |
2026-10-26T14:25:22.459Z [Scrapely] Container started (setup 1.6 s)
2026-10-26T14:25:23.627Z [scrapely.actor] INFO [Scrapely] Initializing API storage for run 07765a788d884cc7b
2026-10-26T14:25:23.799Z [scrapely.proxy_configuration] INFO Platform proxy access check succeeded.
2026-10-26T14:25:23.799Z [scrapely.actor] INFO Using proxy group DATACENTER.
2026-10-26T14:25:25.444Z [scrapely.actor] INFO [Status message]: Saved 15 itineraries for LAX to JFK on 2026-11-25 (3 best, 12 other).
2026-10-26T14:25:25.979Z [Scrapely] Container state: status=exited exitCode=0 oomKilled=falseWhat all 15 itineraries show:
- The cheapest fare isn't a "best" flight. The lowest price was $174, a JetBlue connection through Fort Lauderdale that takes 10 hours 11 minutes. The cheapest nonstop was $204, on JetBlue and Delta. If you only read the top of the page, you miss the $30 saving and its five-hour cost.
- Nonstops dominate. 13 of the 15 itineraries were nonstop, priced from $204 to $254, and took 5h 12m to 5h 27m. JetBlue had 8 of the 15, American 4 and Delta 3.
- Google's flags come along. Three itineraries were red-eyes (
overnight) and three carried Google'soften_delayedflag, including American's AA 32 among the best flights. - Aircraft and carbon differ more than price. The JetBlue A320 on B6 524 offered 33 inches of legroom and Wi-Fi at 422 kg of CO2, 27% above the route's typical 333 kg. Delta's DL 938, a Boeing 767 at the same $204, was 30% below it at 232 kg.
- The price history is the bonus.
price_insightsrated $174 as "typical" against a typical range of $125 to $275, and its history held 61 daily prices from 27 August to 26 October 2026, between $153 and $294.
What it costs
The Actor charges one event: $0.02024 per search that returns itineraries ($20.24 per 1,000 searches), with platform usage (compute and proxy) included. A wrong airport code returns no rows and isn't charged. Prices checked on 26 October 2026.
- Our run: 1 search × $0.02024 = $0.02024 at list price for all 15 itineraries. Our account was billed $0.0162 because its plan has a 20% Store discount.
- One route, checked daily for a month: 30 × $0.02024 = $0.61.
- Ten routes, checked daily: 300 searches × $0.02024 = $6.07 a month.
Because the price is per search, not per itinerary, set maxResults high: keeping all 15 rows cost the same as keeping one. The Free plan's $5 of monthly credit covers 247 searches. A maximum charge per run stops a run cleanly when it reaches the cap; see pricing for plans.
What to watch out for
- One route per run. Several airports in one field are fine (
JFK,EWR,LGA), but a second route needs a second run. Loop over routes and dates as in the Python example. - First results page only. Itineraries come from the page Google renders, so a search returns at most what that page lists. Our search found 15.
- Round trips list outbound flights. With a return date, each row is an outbound choice priced at the round-trip fare. Picking a return flight is a second page the Actor doesn't open.
- No booking links or multi-city. Booking-option lookups for every fare brand and multi-city trips aren't included, so treat the fares as a price signal and check them before you buy.
- Fares move. Prices depend on country, currency and date, and change between runs. Store the run time with each result and compare runs, not single snapshots.
- Hand-built scrapers break on the URL. Google packs the whole search into an encoded
tfsparameter: Scrapfly's guide describes it as "a Base64-encoded Protobuf message", and FlightPowers' Playwright guide advises never building one yourself. With the Actor you pass airport codes and dates.
Is it legal to scrape Google Flights?
The Actor reads the public Google Flights results page, the same one any logged-out visitor sees, without signing in or booking anything, and the rows hold fares and schedules published by airlines. Google's rules on automated access are specific, though. Its Terms of Service (effective July 30, 2026) list "using automated means to access content from any of our services in violation of the machine-readable instructions on our web pages (for example, robots.txt files that disallow crawling, training, or other activities)" as abuse, and Google's robots.txt disallows paths such as /travel/flights/search and /search for all crawlers. Read both before you build a commercial product on this data.
Flight results don't contain personal data: no passenger names, no bookings. Use the data for price research and alerts, and don't republish Google's pages as your own. Our guide on whether web scraping is legal covers the general rules. This is general information, not legal advice: for commercial use, ask a lawyer about your case.
Why Scrape.ly for Google Flights data
- There's no official API to fall back on. Google shut down its QPX Express airfare API on April 10, 2018, keeping only the enterprise product for large partners, as TechCrunch reported. The Actor reads the page travelers use today.
- No browser, no encoded URLs. DIY guides drive Playwright, wait for a growing list and parse
aria-labeltext. The Actor returned structured fields in 5 seconds on a datacenter proxy. - A flat price per search. $0.02024 buys the whole results page, price insights included, with a hard cap per run if you want one.
- Ready for monitoring and agents. Schedule daily runs per route, push fares to Sheets or a webhook, or let an agent call it over MCP. Our guides on scheduling scrapers and scraping Airbnb show the same pattern for other travel data.
FAQ
Does Google Flights have an API?
No public one. Google retired QPX Express, its airfare API, on April 10, 2018, and the enterprise product is only for contracted partners. Scraping the public results page, or calling a scraper like this one over REST, is how developers get Google Flights data today.
How do I scrape flight prices for many dates?
Run one search per date and keep the cheapest itinerary from each, as in the Python example. Each search costs $0.02024, so a week of dates is $0.14 at list price. Google's price_insights history adds about two months of daily prices for the route on top.
Can I scrape round-trip fares?
Yes. Set returnDate and every outbound row shows the round-trip fare. The New York to London round-trip preset is a ready example.
Can I get nonstop flights only?
Yes. Set maxStops to 0, or start from the nonstop SFO to Seattle preset. In our unfiltered run, 13 of 15 LAX to JFK itineraries were nonstop anyway.
Does it show prices in other currencies?
Yes. Set currency (EUR, GBP …) and country for the point of sale. The country changes which fares Google shows, so keep it fixed when you compare runs over time.
How much does it cost to scrape Google Flights?
$0.02024 per search, platform usage included, no matter how many itineraries it returns. Our 15-itinerary run cost $0.02024 at list price.




