# Google Flights Scraper: Prices, Itineraries & Cheapest Dates (`fairfetch/google-flights-scraper`) Actor

Flight prices from Google Flights for any route, dates, passengers, cabin and currency: every itinerary with airlines, flight numbers, legs, layovers, duration, CO2 and price insight. Round trips with return flights, and a cheapest-dates calendar. $0.15 per 1,000 flights.

- **URL**: https://apify.com/fairfetch/google-flights-scraper.md
- **Developed by:** [Naveen Raja](https://apify.com/fairfetch) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.15 / 1,000 flights

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Flights Scraper: Prices, Itineraries & Cheapest Dates

Get **flight prices and full itineraries from Google Flights** for any route, date, passengers, cabin and currency: the price for all passengers, airlines, flight numbers, every leg with airports and local times, aircraft and legroom, layovers, total duration, CO2 estimate, Google's "top flight" and cheapest flags, and Google's typical price range. Round trips come with the round-trip total, and optionally with **every return flight** for each outbound flight. A **cheapest-dates mode** prices up to 60 departure dates and returns the cheapest itinerary of each day.

**Price: $0.15 per 1,000 flights** ($0.00015 per itinerary), plus $0.0005 per run (one Actor start event per GB of memory: once at the default 256 MB). Round-trip rows with their return flights cost $0.001 each, and a cheapest-dates row $0.0002. No subscription and no extra usage fees: platform and proxy costs are included. Error rows and the run summary are free.

| You want | Rows | You pay |
|---|---|---|
| Every flight of one route and date (Google lists about 20-300; default max 100) | 100 | $0.015 + $0.0005 |
| 100 flights on each of 10 routes | 1,000 | $0.15 + $0.0005 |
| The 10 cheapest flights of 20 routes, every day for a month | 6,000 | $0.90 + $0.015 |
| 20 outbound flights of a round trip, each with its return flights | 20 | $0.02 + $0.0005 |
| The cheapest flight of each of the next 60 departure dates | 60 | $0.012 + $0.0005 |

> **Unofficial.** This Actor is not affiliated with, endorsed by or sponsored by Google. Google Flights is a trademark of Google LLC. See [Legal](#legal) before you use the data.

### What you get

- **One row per itinerary**, the same fields every time: `price` (the total for all passengers), `priceExact` (unrounded), `currency`, `airlines`, `flightNumbers`, `departureTime` / `arrivalTime` (local), `durationMinutes`, `stops`, `layovers`, `legs` (each flight with aircraft and legroom), `co2EmissionsKgPerPassenger`, `isBest`, `isCheapest`, `priceLevel`, `googleFlightsUrl` and more ([all fields](#output-fields)).
- **The whole list Google has**: about 20-300 itineraries per route and date (nonstop and connections), in Google's own "best" order or sorted by price, duration or departure time; duplicates removed.
- **Any route**: airport codes (`JFK`, or several: `JFK,EWR,LGA`), city codes (`NYC`, `LON`, `PAR`) or names as Google Flights knows them (`New York`, `Bali`, `Italy`, `München`). Many routes in one run, each with its own dates, passengers, cabin and currency if you like.
- **Your currency, from any IP**: 71 currencies; the requested currency is honoured from Apify's data centers and from other countries (checked with USD, EUR, GBP, INR and JPY on 22 Oct 2026).
- **Passengers, cabin and stops**: adults, children, infants on lap and in seat; economy, premium economy, business or first; nonstop, up to 1 or up to 2 stops.
- **CO2 per passenger and in total**: Google's emissions estimate for the itinerary, per seated passenger and for the whole party, next to the route's typical value.
- **Round trips, stated honestly**: each outbound flight with the cheapest round-trip total that starts with it (as Google shows it). Turn on **Add return flights** to get each outbound flight's return options with the exact round-trip total of each combination.
- **Cheapest dates** (price calendar with details): for up to 60 departure dates, the cheapest itinerary of each day with its airline, flight numbers, times and stops, not just a number; round trips keep the same trip length.
- **Price insight**: Google's typical price range for similar trips and whether today's lowest price is low, typical or high.
- **Clear errors**: an unknown airport, an ambiguous name (Springfield), a route without flights or a wrong date gets a free error row with the reason; the other searches still run.

### Use cases

- **Fare monitoring**: schedule a daily run for your routes with a relative departure date ("30 days") and chart how prices move.
- **Cheapest travel dates**: price a route for every day of the next weeks and pick the cheapest day, with the actual flight.
- **Travel apps and deal alerts**: feed Google's itineraries, price levels and typical ranges into your app or alerts.
- **Market and route research**: who flies a route, how many nonstops, typical fares by cabin, connections and layover airports.
- **Corporate travel and emissions**: compare fares with Google's CO2 estimates per passenger and per itinerary.
- **Data for automations**: one predictable JSON row per itinerary, callable from the API, Make, Zapier or n8n.

### How to use

1. Fill **From** and **To** (e.g. `JFK` and `LHR`, or `New York` and `Paris`), and/or list routes under **More routes** (`JFK-LHR`, `SFO-NRT`, `Paris to Rome`). More routes run in addition to From/To: clear From and To to search only those routes. Airport codes in capitals are always codes; a three-letter word like `Goa` or `Kos` is looked up as a place first.
2. Pick the **departure date** (empty = 30 days from today) and, for a round trip, a **return date** or **trip length**.
3. Set **passengers**, **cabin**, **stops** and **currency** if you need to.
4. Choose **What to return**: every itinerary (default) or the cheapest flight of each date.
5. Run, then download the results as JSON, CSV or Excel, or use the API. A run summary is saved as the `SUMMARY` record.

#### Input examples

One way, the 50 cheapest flights:

```json
{
    "origin": "JFK",
    "destination": "LHR",
    "departureDate": "2026-12-05",
    "sortBy": "price",
    "maxResultsPerSearch": 50
}
```

Round trip for a family, with return flights, in euros:

```json
{
    "origin": "New York",
    "destination": "Paris",
    "departureDate": "30 days",
    "tripLengthDays": 7,
    "adults": 2,
    "children": 1,
    "infantsOnLap": 1,
    "currency": "EUR",
    "includeReturnFlights": true,
    "maxResultsPerSearch": 20,
    "maxReturnFlights": 5
}
```

Cheapest flight of each of the next 30 days, nonstop only, for several routes:

```json
{
    "mode": "cheapest_dates",
    "routes": ["BOM-DXB", "DEL-BLR", "LON-PAR"],
    "departureDate": "1 day",
    "calendarDays": 30,
    "maxStops": "0",
    "currency": "INR"
}
```

#### Searches with their own settings

`searches` runs several searches with different settings in one run; each entry overrides the main form:

```json
{
    "searches": [
        {"origin": "SFO", "destination": "NRT", "departureDate": "2026-12-10", "returnDate": "2026-12-20", "currency": "JPY"},
        {"origin": "FRA", "destination": "JFK", "departureDate": "2026-11-28", "cabinClass": "business", "currency": "EUR"},
        {"origin": "SYD", "destination": "AKL", "departureDate": "2027-01-10", "tripLengthDays": 7, "adults": 2, "currency": "AUD"}
    ],
    "maxResultsPerSearch": 30
}
```

Keys: `origin`, `destination`, `departureDate`, `returnDate`, `tripLengthDays`, `adults`, `children`, `infantsOnLap`, `infantsInSeat`, `cabinClass`, `maxStops`, `currency`.

#### Output example

A real row from a cloud run on 22 Oct 2026 (SFO to Tokyo Narita, one way, 1 adult, economy, USD):

```json
{
  "status": "ok",
  "resultType": "flight",
  "origin": "SFO",
  "destination": "NRT",
  "originResolved": "San Francisco International Airport (SFO)",
  "destinationResolved": "Narita International Airport (NRT)",
  "tripType": "one_way",
  "departureDate": "2026-12-05",
  "returnDate": null,
  "position": 2,
  "isBest": true,
  "isCheapest": false,
  "price": 670,
  "priceExact": 669.8,
  "currency": "USD",
  "priceScope": "one_way_total",
  "adults": 1,
  "children": 0,
  "infantsOnLap": 0,
  "infantsInSeat": 0,
  "cabinClass": "economy",
  "airlines": ["Asiana Airlines"],
  "airlineCodes": ["OZ"],
  "flightNumbers": ["OZ 211", "OZ 102"],
  "departureAirport": "SFO",
  "departureAirportName": "San Francisco International Airport",
  "departureTime": "2026-12-05T23:00",
  "arrivalAirport": "NRT",
  "arrivalAirportName": "Narita International Airport",
  "arrivalTime": "2026-12-07T11:20",
  "durationMinutes": 1160,
  "stops": 1,
  "layovers": [
    {"airport": "ICN", "airportName": "Incheon International Airport", "city": "Seoul", "durationMinutes": 230,
     "overnight": false, "changesAirport": false, "nextDepartureAirport": null}
  ],
  "legs": [
    {"flightNumber": "OZ 211", "airline": "Asiana Airlines", "airlineCode": "OZ", "number": "211",
     "departureAirport": "SFO", "departureAirportName": "San Francisco International Airport", "departureTime": "2026-12-05T23:00",
     "arrivalAirport": "ICN", "arrivalAirportName": "Incheon International Airport", "arrivalTime": "2026-12-07T05:10",
     "durationMinutes": 790, "aircraft": "Airbus A350", "legroom": "32 in", "alsoSoldAs": []},
    {"flightNumber": "OZ 102", "airline": "Asiana Airlines", "airlineCode": "OZ", "number": "102",
     "departureAirport": "ICN", "departureAirportName": "Incheon International Airport", "departureTime": "2026-12-07T09:00",
     "arrivalAirport": "NRT", "arrivalAirportName": "Narita International Airport", "arrivalTime": "2026-12-07T11:20",
     "durationMinutes": 140, "aircraft": "Boeing 777", "legroom": "32 in", "alsoSoldAs": []}
  ],
  "co2EmissionsKgPerPassenger": 732,
  "co2EmissionsKgTotal": 732,
  "typicalCo2EmissionsKgPerPassenger": 624,
  "co2DifferencePercent": 17,
  "priceLevel": "typical",
  "typicalPriceLow": 280,
  "typicalPriceHigh": 1250,
  "optionsCompared": null,
  "returnFlights": null,
  "returnFlightsCount": null,
  "googleFlightsUrl": "https://www.google.com/travel/flights?tfs=GhoSCjIwMjYtMTItMDVqBRIDU0ZPcgUSA05SVEABSAGYAQI&hl=en&gl=us&curr=USD",
  "language": "en",
  "country": "us",
  "scrapedAt": "2026-10-22T13:40:59Z",
  "error": null,
  "errorKind": null
}
```

With **Add return flights**, a round-trip row also has `returnFlights` (cheapest first; shortened to one of four):

```json
{
  "tripType": "round_trip", "departureDate": "2026-12-05", "returnDate": "2026-12-12",
  "price": 797, "priceExact": 796.84, "currency": "EUR", "priceScope": "round_trip_total", "flightNumbers": ["ZG 25"],
  "returnFlights": [
    {"price": 797, "priceExact": 796.84, "isBest": false, "airlines": ["ZIPAIR Tokyo"], "flightNumbers": ["ZG 26"],
     "departureAirport": "NRT", "departureTime": "2026-12-12T21:25", "arrivalAirport": "SFO", "arrivalTime": "2026-12-12T13:35",
     "durationMinutes": 550, "stops": 0, "layovers": [], "legs": ["..."],
     "co2EmissionsKgPerPassenger": 343, "co2EmissionsKgTotal": 343}
  ],
  "returnFlightsCount": 4
}
```

#### Output fields

| Field | Meaning |
|---|---|
| `status` | `ok` for a flight or date row (charged), `error` for a free error row |
| `resultType` | `flight` (one itinerary of a search) or `cheapest_of_date` (Cheapest dates mode) |
| `origin`, `destination` | What you typed |
| `originResolved`, `destinationResolved` | The airports or places Google searched, e.g. "New York" or "Heathrow Airport (LHR)" |
| `tripType`, `departureDate`, `returnDate` | `one_way` or `round_trip`, and the dates searched |
| `position` | Position after sorting (1 = first); null in Cheapest dates mode |
| `isBest` | Flights mode: Google ranks the itinerary among its "top flights" (best mix of price and convenience); null in Cheapest dates mode, where Google's price order has no top list |
| `isCheapest` | The lowest price of the search (ties share it); in Cheapest dates mode, the cheapest date of the window |
| `price`, `currency` | The price as Google Flights lists it: **the total for all passengers, including required taxes and fees** (bags and optional extras not included), in a whole currency unit |
| `priceExact` | The same price unrounded, from the itinerary's fare data (Google's list rounds it up: 669.80 is listed as 670) |
| `priceScope` | `one_way_total`, or `round_trip_total`: the cheapest round trip that starts with this outbound flight |
| `adults`, `children`, `infantsOnLap`, `infantsInSeat`, `cabinClass` | What the price is for |
| `airlines`, `airlineCodes`, `flightNumbers` | Airline names as Google shows them, the IATA codes of the airlines flying the legs, and the flight numbers |
| `departureAirport`, `departureAirportName`, `departureTime` | First departure (local time, `YYYY-MM-DDTHH:MM`) |
| `arrivalAirport`, `arrivalAirportName`, `arrivalTime` | Final arrival (local time) |
| `durationMinutes`, `stops` | Total travel time including layovers; number of stops |
| `layovers` | Each stop: `airport`, `airportName`, `city`, `durationMinutes`, `overnight`, `changesAirport` and `nextDepartureAirport` (when you must change airports) |
| `legs` | Each flight: `flightNumber`, `airline`, airports and local times, `durationMinutes`, `aircraft`, `legroom`, `alsoSoldAs` (partner flight numbers of the same flight) |
| `co2EmissionsKgPerPassenger`, `co2EmissionsKgTotal` | Google's CO2e estimate for the itinerary per seated passenger, and for all seated passengers together (Google gives the total for adults, children and infants in seat; lap infants have no seat); null where Google shows none |
| `typicalCo2EmissionsKgPerPassenger`, `co2DifferencePercent` | Google's typical CO2e for the route per seated passenger, and this itinerary against it in percent |
| `priceLevel`, `typicalPriceLow`, `typicalPriceHigh` | Google's typical price range for similar trips, for the whole party like `price`, and whether the search's lowest price is `low`, `typical` or `high` against it |
| `optionsCompared` | Cheapest dates mode: priced itineraries Google listed for that date (its short list, which holds the cheapest) |
| `returnFlights`, `returnFlightsCount` | With **Add return flights**: the return options, each with its exact round-trip total, flights, times, stops, layovers, legs and CO2 (per passenger and total) |
| `googleFlightsUrl` | Opens the same search on Google Flights (route, dates, passengers, cabin, stops, currency) |
| `language`, `country`, `scrapedAt` | Language and Google region (`gl`) used, and run start time |
| `error`, `errorKind` | Error rows only: the reason, and `invalid_input`, `not_found`, `no_results` (your input or the route), or `blocked`, `network`, `source_error`, `proxy_error`, `internal_error` |

Dataset views: **Flights**, **Legs and layovers**, **Return flights**, **Cheapest dates** and **Errors**.

#### About prices

- **Total for everyone, taxes included**: Google Flights lists the price for all passengers together, including required taxes and fees. Checked bags, seat selection and other extras are not included.
- **Rounded up in the list**: Google lists whole units (USD 335 for a fare of 334.50). `priceExact` gives the unrounded fare from the itinerary's own fare data; it is null when Google gives none.
- **Round trips**: Google prices round trips as a whole. An outbound row's `price` is the cheapest round trip that starts with that flight; the return you would pick can cost more. **Add return flights** lists the actual combinations with their totals.
- **Where the prices are for**: the requests come from Apify's data centers (mostly US). The **Google region** setting (`gl`) is passed to Google as is, but in our tests (22 Oct 2026: 6 routes on 4 continents, 7 regions each) it changed no fare and no itinerary, and the fares were the same from an Indian IP. Booking sites can still charge differently by country. The currency is a conversion by Google.
- **Prices change by the minute**: a row is what Google showed at `scrapedAt`.
- **Itineraries without a price** (some airlines don't sell through Google, e.g. many Indian domestic flights) are skipped and not charged; the summary counts them. If every flight of a search has no price, you get a free `no_results` row.

### Pricing

Pay per event: you pay only for rows in your dataset.

| Event | Price | When |
|---|---|---|
| Flight | $0.00015 | One itinerary row |
| Flight with return flights | $0.001 | One outbound row of a round trip with its return flights (**Add return flights** on). A row whose return flights could not be read, or for which Google lists none, costs $0.00015 |
| Cheapest flight of a date | $0.0002 | One row in Cheapest dates mode |
| Actor start | $0.0005 | Once per run (Apify charges one start event per GB of memory: once at the default 256 MB, twice at 2 GB) |

Error rows (including dates without flights), itineraries without a price, duplicates and the `SUMMARY` record are free. Set a maximum cost per run in Apify Console: the Actor stops cleanly at that limit and never fetches what it can't charge for.

### Use it from the API

```bash
curl -X POST "https://api.apify.com/v2/acts/fairfetch~google-flights-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"origin": "JFK", "destination": "LHR", "departureDate": "30 days", "sortBy": "price", "maxResultsPerSearch": 20}'
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("fairfetch~google-flights-scraper").call(
    run_input={"routes": ["JFK-LHR", "SFO-NRT"], "departureDate": "2026-12-05", "returnDate": "2026-12-12",
               "currency": "EUR", "maxResultsPerSearch": 10}
)
for flight in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(flight["origin"], flight["flightNumbers"], flight["departureTime"], flight["price"], flight["currency"])
```

### Performance and limits

- **Speed**: one request per search (0.2-0.7 MB), usually under a second. 1,188 flights from 9 routes took 10 seconds in our tests. Return flights need one more request per outbound flight (60 outbound flights with returns: 28 seconds). Cheapest dates need one request per date (90 dates on 3 routes: 72 seconds).
- **Google's own list**: about 20-300 itineraries per route and date; Google returns at most about 300 (`maxResultsPerSearch` up to 300).
- **Dates**: departures from today to 330 days ahead (Google Flights' limit). In Cheapest dates mode, dates past that limit are left out (noted in the summary); a date without flights gets a free row, and a route without flights on any date gets one free `no_results` row, as in Flights mode.
- **Passengers**: up to 9 in total, at most one infant on lap per adult and at most 2 infants (on lap and in seat together) per adult. Some cabins have no fares for some passenger mixes (for example premium economy with children on some routes): you get a free `no_results` row.
- **Places**: airport codes in capitals (`GOA`) are always codes. A three-letter word not in capitals (`Goa`, `Kos`) is looked up first: a city or region of exactly that name wins (Goa, India), otherwise it is the airport code (`jfk`, `Bom`); the run summary notes when a word could also have been a code. A name Google matches to several places (Springfield) is refused with the candidates; use a more specific name ("Springfield, Illinois") or an airport code. A name is matched with Google Flights' own place search; check `originResolved` / `destinationResolved`.
- **Temporary errors**: Google's servers now and then answer with a temporary error, mostly for unusual city-to-city round trips the first time they are computed. The Actor retries from another IP, then once more after a pause; a date or search that still fails gets a note or a free error row and is not charged.
- **Blocking**: Google rarely blocks this endpoint from data-center IPs (no block in our tests). A blocked request is retried from another IP; nothing is solved or bypassed. If every search fails on our side, the run fails and only the Actor start is charged.
- **Proxy**: the default Apify Proxy (data center) is recommended. Residential and Google SERP proxy groups are not supported (they would cost more than the results). If your own proxy settings can't be set up or don't connect, the run ends with a free `proxy_error` row instead of going on without a proxy. Only connection failures count as a proxy problem: errors from Google itself are retried and reported as ours.
- **Not included**: booking options and booking links (which site sells the ticket), bag fees, multi-city trips and "explore anywhere" searches.

### FAQ

**Why do my prices differ from what I see on Google Flights?** Fares change by the minute, Google shows your own currency, and the list rounds prices up. Set **Currency** to yours and compare `priceExact` with the price on Google's booking page.

**Is a round-trip price for both directions?** Yes, `priceScope` says `round_trip_total`: the cheapest round trip that starts with that outbound flight, for all passengers. Turn on **Add return flights** to see each return option and its exact total.

**Can I track fares every day?** Yes: use a relative departure date such as "30 days" (and a trip length for round trips), save the input as a task and schedule it. Each run costs a fraction of a cent per route.

**How do I find the cheapest day to fly?** Use **Cheapest dates** with up to 60 dates. Each row is that day's cheapest itinerary with its details; `isCheapest` marks the cheapest day(s).

**Does it give booking links?** No. It returns Google's itinerary and price data, plus a link that opens the same search on Google Flights; it does not output Google's paid click-out links.

**Which airports does a city search include?** The ones Google Flights includes for that city (for example JFK, LGA and EWR for New York). Use airport codes to fix the airports.

### Legal

This Actor reads flight data that Google Flights shows to any visitor without signing in: itineraries, prices, airlines, schedules, aircraft and emissions estimates. It does not log in, solve CAPTCHAs or collect personal data.

Google's terms of service restrict automated access to its services. Google's `robots.txt` (checked 22 Oct 2026) disallows crawlers from `/travel/flights/search` (the address of Google Flights' results page), `/travel/flights/booking` and `/travel/flights/s/`, among other travel paths; `/travel/flights` itself is not disallowed. The Actor does not load those pages: it calls the data endpoint behind the results page (`/_/FlightsFrontendUi/data/batchexecute`, the same request the page makes), which `robots.txt` does not list, and its links use `/travel/flights?tfs=...`. It is still the same data as the disallowed results page. The Actor does not output Google's paid click-out or booking links. You are responsible for using the Actor and the data lawfully and in line with the terms that apply to you, including the airlines' rights in their fares and schedules. This is not legal advice.

# Actor input Schema

## `origin` (type: `string`):

Where the trip starts: an airport code in capitals (JFK), several airport codes separated by commas (JFK,EWR,LGA), a city code (NYC, LON, PAR), or a city or region name as Google Flights knows it (New York, Bali, Italy, Goa). A three-letter word not in capitals ("Goa", "Kos") is looked up as a place first and used as an airport code only when no place has exactly that name; type the code in capitals (GOA) to force the airport. A name that matches several places (Springfield) gives a free error row listing them.

## `destination` (type: `string`):

Where the trip goes, in the same forms as "From".

## `departureDate` (type: `string`):

A date (YYYY-MM-DD) or a date relative to today (UTC), e.g. "30 days" or "2 weeks": relative dates keep scheduled runs looking the same distance ahead. Empty = 30 days from today. Google Flights sells flights up to 330 days ahead.

## `returnDate` (type: `string`):

Optional. Empty = one way (unless "Trip length" is set). A date (YYYY-MM-DD) or a date relative to today (UTC). Round-trip rows list the outbound flights, each with the cheapest round-trip total Google shows for it; turn on "Add return flights" to get the return options too.

## `tripLengthDays` (type: `integer`):

Optional instead of a return date: the return is this many days after the departure (handy with relative departure dates and with "Cheapest dates"). 0 or empty = use the return date, or one way.

## `routes` (type: `array`):

Optional. One route per line, each searched with the dates, passengers and cabin above: ORIGIN-DESTINATION with codes (JFK-LHR, JFK,EWR-LHR, NYC-PAR) or names with " to " (New York to London). These run in addition to From/To: clear From and To to search only these routes. A route that can't be read gives a free error row; the others still run.

## `mode` (type: `string`):

"Flights": one row per itinerary of each search (sorted as you choose). "Cheapest dates": one row per departure date with that day's cheapest itinerary (a price calendar with full flight details), for "Number of dates" days from the departure date; round trips keep the same trip length.

## `maxResultsPerSearch` (type: `integer`):

Flights mode: at most this many itineraries per search (Google Flights lists about 20-300 for a route and date; the top flights come first with "Best").

## `sortBy` (type: `string`):

Order of the itineraries (and which ones are kept when "Max flights per search" is smaller than the list).

## `includeReturnFlights` (type: `boolean`):

Round trips in Flights mode: every outbound row also lists its return flights (cheapest first, each with the exact round-trip total). One extra request per outbound flight; such rows are charged as "Flight with return flights" instead of "Flight".

## `maxReturnFlights` (type: `integer`):

With "Add return flights": how many return options to keep for each outbound flight, cheapest first.

## `calendarDays` (type: `integer`):

Cheapest dates mode: how many departure dates to price, starting at the departure date (one request and one row per date).

## `adults` (type: `integer`):

Passengers aged 12 and over. Prices are the total for all passengers.

## `children` (type: `integer`):

Passengers aged 2 to 11.

## `infantsOnLap` (type: `integer`):

Under 2, on an adult's lap (at most one per adult).

## `infantsInSeat` (type: `integer`):

Under 2, with their own seat. At most 9 passengers in total, and at most 2 infants (on lap and in seat together) per adult.

## `cabinClass` (type: `string`):

The cabin Google Flights prices.

## `maxStops` (type: `string`):

Google Flights' stops filter.

## `currency` (type: `string`):

Currency of all prices (Google Flights converts; the requested currency is honoured from any IP).

## `language` (type: `string`):

Google language code for airport, city and airline names, e.g. en, de, fr, es, ja, pt-BR.

## `country` (type: `string`):

Two-letter region code sent to Google as "gl", e.g. us, gb, de, in. In our tests (22 Oct 2026: 6 routes on 4 continents, 7 regions each) it changed no fare and no itinerary, so you can leave it at "us"; prices are always in the currency you choose.

## `searches` (type: `array`):

Optional. A list of objects, each one search: {"origin": "SFO", "destination": "NRT", "departureDate": "2026-12-10", "returnDate": "2026-12-20", "adults": 2, "cabinClass": "business", "currency": "JPY"}. Fields an entry leaves out come from the main form; allowed fields: origin, destination, departureDate, returnDate, tripLengthDays, adults, children, infantsOnLap, infantsInSeat, cabinClass, maxStops, currency.

## `proxyConfiguration` (type: `object`):

The default Apify Proxy (data center) works and costs nothing extra. Residential and Google SERP proxies are refused (they would cost more than the results).

## `maxConcurrency` (type: `integer`):

How many searches run at the same time.

## `maxAttempts` (type: `integer`):

How many times a request is tried in total (each retry from another IP) before the search is reported as failed.

## Actor input object example

```json
{
  "origin": "JFK",
  "destination": "LHR",
  "routes": [
    "JFK-LHR",
    "SFO-NRT",
    "Paris to Rome"
  ],
  "mode": "flights",
  "maxResultsPerSearch": 10,
  "sortBy": "best",
  "includeReturnFlights": false,
  "maxReturnFlights": 5,
  "calendarDays": 14,
  "adults": 1,
  "children": 0,
  "infantsOnLap": 0,
  "infantsInSeat": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "currency": "USD",
  "language": "en",
  "country": "us",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 4,
  "maxAttempts": 4
}
```

# Actor output Schema

## `results` (type: `string`):

All rows as JSON, the same fields in every row (null where Google has no value).

## `flights` (type: `string`):

Price, airlines, flight numbers, times, duration, stops, CO2 and link.

## `details` (type: `string`):

Every leg (aircraft, legroom, times) and layover, CO2 against typical, price level.

## `returns` (type: `string`):

Round trips with "Add return flights": each outbound flight with its return options.

## `dates` (type: `string`):

Cheapest dates mode: the cheapest itinerary per departure date.

## `errors` (type: `string`):

Free error rows: searches that returned nothing and why.

## `summary` (type: `string`):

Per-search rows, skipped itineraries, errors and notes, plus request statistics.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "origin": "JFK",
    "destination": "LHR",
    "maxResultsPerSearch": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fairfetch/google-flights-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "origin": "JFK",
    "destination": "LHR",
    "maxResultsPerSearch": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("fairfetch/google-flights-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "origin": "JFK",
  "destination": "LHR",
  "maxResultsPerSearch": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call fairfetch/google-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fairfetch/google-flights-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6S7wMyu9SWd6UFRGU/builds/LKQbYyaJhfys62ZlC/openapi.json
