# Google Flights Scraper – Batch Route Prices to CSV (`kilo_metric/google-flights-scraper`) Actor

Search multiple Google Flights routes in one run and export results to CSV. Get flight prices, airlines, flight numbers, departure and arrival times, stops, layovers, duration and CO2 estimates. Supports one-way and round-trip searches. Uses plain HTTP.

- **URL**: https://apify.com/kilo_metric/google-flights-scraper.md
- **Developed by:** [Kilo Metric](https://apify.com/kilo_metric) (community)
- **Categories:** Travel, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 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

### Try two routes in one run

Paste this JSON in the **Input** tab and click **Start**. Open **Output** to export the results as CSV.

```json
{
  "routes": [
    { "origin": "BCN", "destination": "LHR", "departureDate": "30 days" },
    { "origin": "JFK", "destination": "LAX", "departureDate": "3 weeks" }
  ],
  "currency": "GBP",
  "market": "GB",
  "sortBy": "price",
  "maxResults": 5
}
```

### What does Google Flights Scraper do?

**Google Flights Scraper** searches [Google Flights](https://www.google.com/travel/flights) for the **routes and dates** you enter and saves every itinerary listed on the results page: **price, airline, flight numbers, departure and arrival times, stops, layovers, total duration, aircraft, legroom and CO₂ estimate**.

Enter two airport codes and a date, click **Start**, and get one row per flight. Search a single route, or a whole list of routes in one run.

- **One-way and round-trip searches**: for a round trip, `price` is the total round-trip fare and the row describes the outbound flights
- **Many routes per run**, all with the same passenger, cabin and stop settings
- **Passengers and cabin**: adults, children, infants in a seat or on a lap; economy, premium economy, business or first; any number of stops, nonstop only, or up to 1 or 2 stops
- **Currency, market (country of sale) and language** of your choice
- **Relative dates** such as `30 days` or `2 weeks`, so scheduled runs and saved tasks never search a date in the past
- **Sorting and limits**: Google's own ranking, price, duration or departure time, and a cap on flights per search
- **Nothing fails silently**: input mistakes, refused searches and searches without flights each get a row that explains what happened, and the run's status message sums it up
- **Pay for flights, not for errors**: rows that explain an error or an empty search are free
- **Plain HTTP, no browser**: a search is one request for the results page, plus retries only when needed
- **Apify Proxy by default**: a search that Google refuses is retried from a new IP address
- **Apify platform**: start runs through the API, schedule them, connect them to integrations and webhooks, use proxies and monitor every run

### What data can you get from Google Flights?

| Field | Example | Description |
|---|---|---|
| `price`, `currency` | `952`, `USD` | Fare as listed by Google Flights, taxes and fees included; for a round trip, the total round-trip fare |
| `airline`, `airlineCodes` | `Icelandair`, `["FI"]` | Airline name(s) and IATA airline codes |
| `flightNumbers` | `["FI451", "FI617"]` | One flight number per leg |
| `departAirport`, `departAt` | `LHR`, `2026-12-21T12:15` | First departure, local time at the airport |
| `arriveAirport`, `arriveAt` | `JFK`, `2026-12-21T17:40` | Final arrival, local time at the airport |
| `stops`, `layovers` | `1`, KEF for 60 min | Number of stops; airport, name, city and minutes of each layover |
| `totalDurationMinutes`, `duration` | `625`, `10 hr 25 min` | Total travel time, in minutes and as text |
| `legs` | 2 legs | Per leg: flight number, airline, airports, times, duration, aircraft, legroom, CO₂ |
| `emissionsKg`, `emissionsVsTypicalPercent` | `421`, `21` | Google's CO₂ estimate in kg, and how much it differs from the typical value for the route (%) |
| `isBestFlight` | `true` | Listed under Google's "Top flights" |
| `rank` | `1` | Position after sorting |
| `bookingToken` | | Google's price token for the itinerary, as is |
| `googleFlightsUrl` | | The searched results page; opens in a browser |
| `origin`, `destination`, `departureDate`, `returnDate`, `tripType`, `cabinClass`, `passengers` | | The search the flight belongs to |

### How to scrape Google Flights

1. Open the Actor's **Input** tab.
2. Enter the departure airport (**From**), the arrival airport (**To**) and the **Departure date**. Add a **Return date** for a round trip.
3. To search several routes in one run, list them under **Routes** instead.
4. Set the passengers, cabin class and stops, and optionally the currency, market, language, sorting and the maximum number of flights per search.
5. Click **Start**. When the run finishes, the flights are in the **Output** tab, ready to export or to read through the Apify API.

### Input

The simplest input is one route:

```json
{
  "origin": "LHR",
  "destination": "JFK",
  "departureDate": "30 days"
}
```

For a batch input, see [Try two routes in one run](#try-two-routes-in-one-run).

| Field | Type | Default | Description |
|---|---|---|---|
| `origin` | string | | Departure airport, 3-letter IATA code (e.g. `LHR`) |
| `destination` | string | | Arrival airport, 3-letter IATA code (e.g. `JFK`) |
| `departureDate` | string | | `YYYY-MM-DD`, or relative to the day of the run (UTC): `30 days`, `2 weeks`, `1 month`, `1 year` |
| `returnDate` | string | empty | Return date for a round trip. Same formats; relative dates also count from the day of the run |
| `routes` | array | empty | List of `{ "origin", "destination", "departureDate", "returnDate" }`. When it is not empty, the four fields above are ignored |
| `adults` | integer | `1` | 1 to 9 |
| `children` | integer | `0` | Aged 2 to 11 |
| `infantsInSeat` | integer | `0` | Under 2, with their own seat |
| `infantsOnLap` | integer | `0` | Under 2, on an adult's lap; no more than the number of adults. At most 9 passengers in total |
| `cabinClass` | string | `economy` | `economy`, `premium_economy`, `business` or `first` |
| `maxStops` | string | `any` | `any`, `0` (nonstop only), `1` or `2` |
| `currency` | string | `USD` | 3-letter currency code for the prices |
| `market` | string | empty | 2-letter country code of the point of sale (e.g. `US`, `GB`). Empty lets Google decide |
| `language` | string | `en` | Language of airport and airline names (e.g. `en`, `de`, `en-GB`) |
| `maxResults` | integer | `100` | 1 to 300 flights per search, kept after sorting |
| `sortBy` | string | `best` | `best` (Google's order: Top flights first, then the other flights by price), `price`, `duration` or `departure` |
| `proxyConfiguration` | object | Apify Proxy (datacenter) | Proxy settings, see the FAQ |

If part of the input is wrong, for example a date in the past or the same airport twice, that route is skipped and explained in the output, and the other routes still run.

### Output

Each search adds one row per flight to the dataset. A real result from a one-way search London Heathrow → New York JFK, run on 21 November 2026:

```json
{
  "type": "flight",
  "rank": 1,
  "origin": "LHR",
  "destination": "JFK",
  "departureDate": "2026-12-21",
  "returnDate": null,
  "tripType": "one_way",
  "cabinClass": "economy",
  "passengers": { "adults": 1, "children": 0, "infantsOnLap": 0, "infantsInSeat": 0 },
  "currency": "USD",
  "price": 952,
  "isBestFlight": true,
  "airline": "Icelandair",
  "airlineCodes": ["FI"],
  "flightNumbers": ["FI451", "FI617"],
  "stops": 1,
  "layovers": [
    { "airport": "KEF", "airportName": "Keflavík International Airport", "city": "Reykjavík", "durationMinutes": 60 }
  ],
  "departAirport": "LHR",
  "departAt": "2026-12-21T12:15",
  "arriveAirport": "JFK",
  "arriveAt": "2026-12-21T17:40",
  "totalDurationMinutes": 625,
  "duration": "10 hr 25 min",
  "legs": [
    {
      "flightNumber": "FI451", "airline": "Icelandair", "airlineCode": "FI",
      "from": "LHR", "fromName": "Heathrow Airport", "to": "KEF", "toName": "Keflavík International Airport",
      "departAt": "2026-12-21T12:15", "arriveAt": "2026-12-21T15:30", "durationMinutes": 195,
      "aircraft": "Boeing 767", "legroom": "31 in", "emissionsKg": 153
    },
    {
      "flightNumber": "FI617", "airline": "Icelandair", "airlineCode": "FI",
      "from": "KEF", "fromName": "Keflavík International Airport", "to": "JFK", "toName": "John F. Kennedy International Airport",
      "departAt": "2026-12-21T16:30", "arriveAt": "2026-12-21T17:40", "durationMinutes": 370,
      "aircraft": "Boeing 737MAX 8 Passenger", "legroom": "31 in", "emissionsKg": 268
    }
  ],
  "emissionsKg": 421,
  "emissionsVsTypicalPercent": 21,
  "bookingToken": "CjRIeEszZnhqV1RYZDBBR3I5a1FCRy0tLS0tLS0teWliZGcxNEFBQUFBR3NCbVVVTTFKbHNBEgtGSTQ1MXxGSTYxNxoLCKLnBRACGgNVU0Q4HXCi5wU=",
  "googleFlightsUrl": "https://www.google.com/travel/flights?tfs=CBwQAhoeEgoyMDI2LTEyLTIxagcIARIDTEhScgcIARIDSkZLQAFIAXABmAEC&hl=en&curr=USD",
  "resultsSource": "page"
}
```

#### Rows that are not flights

The dataset also explains what did not work, so a run never ends with an unexplained empty result. These rows are free: only flight rows are charged. Filter on `"type": "flight"` if you only want flights.

- **`"type": "error"`**: a route that could not be searched. `reason` is one of `invalid_input` (the route is skipped, `field` names the mistake), `blocked:refused`, `blocked:rate_limited`, `blocked:captcha`, `blocked:consent`, `blocked:forbidden`, `blocked:redirect`, `skipped:blocked` (not requested, see the FAQ on refused searches), `network`, `server_error`, `no_payload`, `http_error`, `parse_error` or `internal_error`.
- **`"type": "notice"`** with `"reason": "no_results"`: the search worked, but Google Flights listed no flights for it.

The **Output** tab has two views of the same rows: **Flights** (price, airline, flight numbers, times, stops, duration) and **Searches, errors and notices** (the search each row belongs to, and the reason and message of error and notice rows).

```json
{
  "type": "error",
  "reason": "invalid_input",
  "field": "departureDate",
  "message": "departureDate 2026-11-01 is in the past (today is 2026-11-21, UTC)",
  "origin": "LHR",
  "destination": "JFK",
  "departureDate": "2026-11-01",
  "returnDate": null
}
```

```json
{
  "type": "error",
  "origin": "BCN",
  "destination": "LHR",
  "departureDate": "2026-12-10",
  "returnDate": null,
  "tripType": "one_way",
  "cabinClass": "economy",
  "currency": "GBP",
  "reason": "blocked:refused",
  "message": "blocked:refused without a proxy to rotate to; stopped. Google refused or limited the requests: try again later, or set a proxy.",
  "googleFlightsUrl": "https://www.google.com/travel/flights?tfs=CBwQAhoeEgoyMDI2LTEyLTEwagcIARIDQkNOcgcIARIDTEhSQAFIAXABmAEC&hl=en&curr=GBP&gl=GB"
}
```

In addition, the key-value store record `SEARCH_SUMMARY` holds one summary per search: status, flights found and returned, lowest price, time taken, bytes transferred and every HTTP attempt.

**Run status.** A run ends as **Succeeded** when at least one search worked, even if it listed no flights, and when the input only had mistakes (nothing was searched). It ends as **Failed** when routes were searched and every search failed, so schedules, webhooks and API clients can tell.

### How much does it cost to scrape Google Flights?

The Actor uses pay-per-event pricing: you pay for the flights you get.

| What | Price |
|---|---|
| Flight: one dataset row of `"type": "flight"` | **$0.10 per 1,000 flights** ($0.0001 per flight) |
| Actor start (based on run memory) | $0.00005 per GB, with a minimum of one event. At the default 4 GB, the start fee is $0.0002 per run. |
| Error and notice rows | free |

- The platform usage of the run, including Apify Proxy, is covered by these prices.
- One search usually returns 9 to 30 flights, so the flight rows cost about $0.001 to $0.003, plus the start fee for the run. Use **Max flights per search** (`maxResults`) to cap it.
- Apify's free plan gives $5 of usage credit every month: enough for about 50,000 flights.
- If you set a spending limit for a run, the Actor stops searching once the limit is reached, and the status message says how many routes were not searched.

### FAQ

#### Why do I get fewer flights than Google Flights shows in my browser?

The Actor reads the itineraries that Google embeds in the results page. That is a limited list: in tests in November 2026, one search returned between 9 and 32 itineraries (9 to 30 in the test runs on the Apify platform). The Actor does not page through further results.

#### What happens when Google refuses a search?

Google sometimes answers a search with an error instead of results.

- **With a proxy** (the default): the Actor retries the search from a new proxy session, i.e. a new IP address, up to 3 attempts in total. Rate limits (HTTP 429), CAPTCHA pages and consent pages are retried the same way. If every attempt fails, the search gets an error row and the run moves on to the next route.
- **Without a proxy**: a refused search is not retried. It gets an error row (`blocked:refused`) and the run moves on to the next route. A rate limit, CAPTCHA page or consent page applies to every request from the same IP address, so the remaining routes of the run are not requested: each of them gets an error row with `skipped:blocked`. Set a proxy, or try again later.

Error rows are free.

#### Which proxy should I use?

Keep the default: **Apify Proxy** with datacenter IP addresses. In a test run on the Apify platform in November 2026, Google refused 2 of 8 datacenter attempts, and the retries from new IP addresses completed all 6 searches.

- Apify's **residential proxies** (the RESIDENTIAL group) are not offered in this version. A run that selects them stops with an `invalid_input` row for `proxyConfiguration` and searches nothing.
- You can enter **your own proxy URLs** in the **Proxy configuration** field instead. Their cost is yours.
- **Without a proxy**, a refused search is not retried (see above).

#### Are prices per person or for all passengers?

Prices are the fares listed by Google Flights, taxes and fees included; for one adult the results page says "Prices include required taxes + fees for 1 adult". Whether the listed price for several passengers is per person or for the whole group has not been verified yet, so check `googleFlightsUrl` when you search for more than one passenger.

#### What does a round-trip row contain?

`price` is the total fare of the round trip. The rest of the row (`legs`, `flightNumbers`, times, `stops`, `duration`) describes the outbound flights; the return flights are not listed. `returnDate` and `tripType` (`round_trip`) show which search the row belongs to.

#### Known limitations

- Airports must be 3-letter IATA codes; city names and city codes such as `LON` or `NYC` are not supported yet.
- Round trips list the outbound flights only, with the round-trip price; the return flights are not listed.
- No multi-city trips, price calendar, price insights (low, typical or high), booking options, or filters by airline or price.
- Times are local times at each airport, without a time zone.

#### Is it legal to scrape Google Flights?

The Actor reads publicly visible flight listings and its output contains no personal data. However, Google's Terms of Service restrict automated access to Google services. Make sure your use complies with the terms that apply to you and with the law where you are, and ask a lawyer before using the data commercially. You are responsible for how you use the data. This Actor is not affiliated with, endorsed by or sponsored by Google.

#### Can I run it through the API or on a schedule?

Yes. Like any Apify Actor, it can be started through the Apify API, run on a schedule, and connected to integrations and webhooks. Relative dates such as `30 days` keep scheduled searches pointed at the future.

#### Something looks wrong?

Open an issue on the **Issues** tab and include the run link. If a search ends with `parse_error`, or with a `no_results` notice while its `googleFlightsUrl` shows flights in your browser, the results page format may have changed: please report it.

# Actor input Schema

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

Departure airport as a 3-letter IATA code, e.g. `LHR` or `JFK`. City names and city codes such as `LON` are not supported yet. Ignored when **Routes** is filled in.

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

Arrival airport as a 3-letter IATA code, e.g. `JFK`. Ignored when **Routes** is filled in.

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

A date as `YYYY-MM-DD`, or relative to the day of the run (UTC), e.g. `30 days` or `2 weeks`. Relative dates keep scheduled runs and saved tasks from going stale. Ignored when **Routes** is filled in.

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

Leave empty for a one-way search. Same formats as the departure date; relative dates also count from the day of the run, not from the departure date. Ignored when **Routes** is filled in.

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

One search per route. When this list is not empty, the single-route fields above are ignored; the passenger, cabin, stop, currency and result settings below apply to every route. A route with a mistake is skipped and reported in the dataset; the other routes still run.

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

Adult passengers. At most 9 passengers per search in total (adults, children and infants).

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

Passengers aged 2 to 11.

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

Infants under 2 with their own seat.

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

Infants under 2 on an adult's lap. Cannot exceed the number of adults.

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

Travel class to search.

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

Maximum number of stops per direction.

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

3-letter currency code for the prices, e.g. `USD`, `EUR`, `GBP`.

## `market` (type: `string`):

2-letter country code of the point of sale, e.g. `US`, `GB`, `DE`. Prices and the airlines and agencies shown can differ by market. Leave empty to let Google decide.

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

Language of airport and airline names, e.g. `en`, `de`, `en-GB`.

## `maxResults` (type: `integer`):

Upper limit of flights saved per search, applied after sorting. The Google Flights results page lists a limited number of itineraries per search, so you may get fewer.

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

Order of the saved flights. "Google's order" keeps Google's ranking: the Top flights first (best trade-off of price and convenience), then the other flights by price.

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

Proxies for the requests to Google. Default: Apify Proxy, datacenter IP addresses. A search that Google refuses is retried from a new proxy session (a new IP address), up to 3 attempts in total. Apify residential proxies (the RESIDENTIAL group) are not offered in this version; your own proxy URLs work. Without a proxy, a refused search is reported and not retried, and a rate limit, CAPTCHA or consent page stops the remaining routes of the run.

## Actor input object example

```json
{
  "origin": "LHR",
  "destination": "JFK",
  "departureDate": "30 days",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "currency": "USD",
  "language": "en",
  "maxResults": 100,
  "sortBy": "best",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset rows: one per flight itinerary (type "flight"), plus one "error" or "notice" row for each route without flights.

## `searchSummary` (type: `string`):

One summary per search: status, flights found and returned, lowest price, time taken and every HTTP attempt.

# 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": "LHR",
    "destination": "JFK",
    "departureDate": "30 days",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kilo_metric/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": "LHR",
    "destination": "JFK",
    "departureDate": "30 days",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("kilo_metric/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": "LHR",
  "destination": "JFK",
  "departureDate": "30 days",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call kilo_metric/google-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kilo_metric/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/NZM8sAWJuc5GrJ2kr/builds/aibe3hTfboib8sin3/openapi.json
