Google Flights API & Scraper — Fares & Price Insights
Pricing
from $0.01 / 1,000 dataset items
Google Flights API & Scraper — Fares & Price Insights
Google Flights fares for any routes and dates: one-way or round trip, every itinerary with airlines, flight numbers, times, stops, layovers, aircraft, CO2, plus Google's low/typical/high price insight and price history.
Pricing
from $0.01 / 1,000 dataset items
Rating
0.0
(0)
Developer
Daniel Posztos
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
9 days ago
Last modified
Categories
Share
Google Flights API & Scraper — Fares, Schedules & Price Insights
SEO title: Google Flights API — fares, schedules, price insights SEO description: Google Flights API for Python, JavaScript or no code: one-way and round-trip fares for any routes and dates, airlines, flight numbers, stops, CO2, plus Google's low/typical/high price verdict.
A Google Flights API you can call from Python, JavaScript, any HTTP client or an AI agent. Give it routes and dates and get every itinerary Google Flights shows, one row each:
- Fare: total for your passengers and cabin class, in your currency (round-trip total for round trips)
- Schedule: airlines, departure and arrival in local time, total duration, stops, layover airports and durations
- Every segment: flight number, aircraft, legroom, times
- CO2: Google's emission estimate vs. the typical flight on the route
- Price insight: Google's own verdict on the search ("prices are currently low / typical / high"), the typical price range, and optionally ~60 days of price history
Search many origins, destinations and dates in one run. Every combination is searched, so a list of dates gives you a fare calendar.
Why this exists
Google Flights has no public API, and the most-used scraper bills per page plus per booking option, so a single route lookup can cost several cents. This actor reads the same data the Google Flights results page is built from, without a browser:
- Searches are encoded the way the Google Flights app does it. Natural-language searches return no flights from cloud servers most of the time; encoded searches return flights.
- Fast: the first attempt goes out directly. Only when Google answers with an error does a retry go through a fresh proxy session.
- One flat row per itinerary, ready for a spreadsheet, a database or an AI agent.
Cloud test: 3 origins × 2 destinations × 5 dates = 30 searches → 300 itineraries in 43 seconds. Every search returned flights; 6 of 36 requests needed a retry.
Input
| Field | What it does | Default |
|---|---|---|
origins | IATA codes: airports (JFK) or metro areas (NYC, LON) | — |
destinations | Same format | — |
departureDates | YYYY-MM-DD list; each date is a search | — |
tripLengthDays | Empty = one-way; e.g. 7 = round trip returning 7 days later | one-way |
adults, children, infantsInSeat, infantsOnLap | Passengers (max 9) | 1 adult |
cabinClass | economy, premium_economy, business, first | economy |
maxStops | any, nonstop, 1, 2 | any |
maxResultsPerSearch | Itineraries per search (Google lists ~10-40) | 30 |
currency | USD, EUR, GBP... | USD |
includePriceHistory | ~60-day price history on each search's first row | false |
language, countryCode | Interface language, point of sale | en-US, us |
proxyConfiguration | Proxy used for retries | Apify Proxy |
Worked example — input
{"origins": ["JFK"],"destinations": ["LHR"],"departureDates": ["2026-11-20"],"maxResultsPerSearch": 10}
Worked example — output (one row, real data)
{"origin": "JFK","destination": "LHR","departureDate": "2026-11-20","returnDate": null,"tripType": "one_way","cabinClass": "economy","passengers": {"adults": 1, "children": 0, "infantsInSeat": 0, "infantsOnLap": 0},"currency": "USD","rank": 4,"category": "other","price": 420,"airlines": ["Aer Lingus"],"departureAirport": "JFK","departureTime": "2026-11-20T17:00","arrivalAirport": "LHR","arrivalTime": "2026-11-21T08:05","durationMinutes": 605,"stops": 1,"layovers": [{"airport": "DUB", "airportName": "Dublin Airport", "city": "Dublin", "durationMinutes": 125}],"segments": [{"flightNumber": "EI 104", "airline": "Aer Lingus", "departureAirport": "JFK", "departureAirportName": "John F. Kennedy International Airport", "departureTime": "2026-11-20T17:00", "arrivalAirport": "DUB", "arrivalAirportName": "Dublin Airport", "arrivalTime": "2026-11-21T04:30", "durationMinutes": 390, "aircraft": "Airbus A330", "legroom": "31 inches"},{"flightNumber": "EI 152", "airline": "Aer Lingus", "departureAirport": "DUB", "departureAirportName": "Dublin Airport", "departureTime": "2026-11-21T06:35", "arrivalAirport": "LHR", "arrivalAirportName": "Heathrow Airport", "arrivalTime": "2026-11-21T08:05", "durationMinutes": 90, "aircraft": "Airbus A320neo", "legroom": "29 inches"}],"emissions": {"grams": 394000, "typicalGrams": 432000, "differencePercent": -9},"priceInsights": {"priceLevel": "high", "priceLevelCode": 5, "lowestPrice": 420, "typicalPrice": 286, "typicalPriceRange": [170, 300]},"bookingToken": "CjRIOURJY3dQbEoxOTRB...","googleFlightsUrl": "https://www.google.com/travel/flights/search?tfs=...","hasData": true,"scrapedAt": "2026-10-12T15:13:02Z"}
Output notes
- Times are local to each airport (
2026-11-20T17:00at JFK,08:05at LHR the next day), the same as on Google Flights. priceis the total for all passengers. For round trips it is the round-trip total, and the row describes the outbound flight. Google only shows return-flight options after you pick an outbound flight, so they are not included.priceInsightsdescribes the whole search and repeats on every row of it.priceLevelis Google's own verdict,typicalPriceRangeis the range Google considers normal for the route.priceHistory(when requested) is only on rank 1.category:bestis Google's "Best" list,otheris everything else, ranked as Google ranks them.- A search that fails or has no flights appears as one row with
hasData: falseand anerror. That row is not charged.
Use it from code or an AI agent
curl -X POST "https://api.apify.com/v2/acts/westerly_breaker~google-flights-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"origins": ["BUD"], "destinations": ["LON", "PAR"], "departureDates": ["2026-12-04", "2026-12-05"], "tripLengthDays": 3, "maxStops": "nonstop", "maxResultsPerSearch": 5}'
From Python (pip install apify-client):
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_TOKEN>")run = client.actor("westerly_breaker/google-flights-scraper").call(run_input={"origins": ["NYC"], "destinations": ["LON"], "departureDates": ["2026-11-20", "2026-11-21"], "maxResultsPerSearch": 5})for flight in client.dataset(run["defaultDatasetId"]).iterate_items():print(flight["departureDate"], flight["price"], flight["airlines"], flight["stops"])
Common uses: fare monitoring (schedule a daily run and watch price and priceLevel), finding the cheapest day in a date range, comparing routes and airlines for travel tools and agents, and route and schedule research.
Pricing (pay-per-event)
$0.001 per itinerary delivered, platform usage included. You control the cost with maxResultsPerSearch.
- 1 route × 14 dates × 10 itineraries = 140 × $0.001 = $0.14
- Searches that fail or have no flights are not charged.
- If you set a maximum cost per run, the actor stops cleanly at that limit. Every row you paid for is delivered, and you are never billed for a row you didn't get.
Error messages
Bad input stops the run before any request, naming the field and the fix, for example:
'origins' entry 'London' is not a 3-letter IATA code. Use airport codes like 'JFK', 'LHR' or metro-area codes like 'NYC', 'LON' (they cover all of the city's airports).Each infant on lap needs an adult: 'infantsOnLap' cannot exceed 'adults'.
Known limitations
- Return-flight details for round trips and per-site booking options (airline vs. agencies) each need extra requests per itinerary and are not included yet.
- Multi-city trips are not supported yet (one-way and round trip only).
- Fares change constantly and can differ by
countryCode(point of sale), the same as on google.com.
Data source
Public Google Flights search results (google.com/travel/flights), the same data the web page shows. No login, no API key.