# Google Flights Scraper - Fares, Airlines & Stops (`get_anything/google-flights-scraper`) Actor

Scrape Google Flights fares by route and date: price, airline, stops, times and duration for one-way and round-trip searches. Filter by cabin, stops and passengers. Best with a residential proxy. Export JSON, CSV or Excel for fare monitoring and price comparison.

- **URL**: https://apify.com/get\_anything/google-flights-scraper.md
- **Developed by:** [Get Anything](https://apify.com/get_anything) (community)
- **Categories:** Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

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 — Fares, Airlines, Stops & Times

Search **Google Flights** by route and date and get clean, structured fares: **price, airline, stops, departure/arrival times, total duration** and a Google Flights link — for **one-way and round-trip** trips, any cabin and passenger mix.

### How it works & the residential-proxy requirement

Google Flights has **no public API** and renders its fare list client-side, so this Actor builds the same `tfs` query the website uses and drives **Camoufox** (a hardened browser) to render the results page, then reads the flight cards.

Google **aggressively blocks datacenter IPs** and shows a consent wall on some regions, so a **residential proxy** is required in practice. The default `proxyConfiguration` requests Apify's `RESIDENTIAL` group pinned to `US` (which also avoids the EU consent wall). Without a residential proxy you'll usually get 0 offers.

### What it does

- Search **multiple routes** in one run (`searches` list), or a single route via the `origin` / `destination` shortcut.
- **One-way or round-trip** (add `returnDate` for round-trip).
- Filter by **cabin class**, **max stops**, and **passenger counts** (adults, children, infants).
- Choose **currency** and **market/locale**.
- Export to **JSON, CSV, or Excel**, or pull via the Apify API.

### Input

| Field | Description |
|-------|-------------|
| `searches` | List of routes: `{ "origin", "destination", "departDate", "returnDate?" }` (IATA codes, dates `YYYY-MM-DD`). |
| `origin` / `destination` / `departDate` / `returnDate` | Single-route shortcut instead of `searches`. |
| `cabinClass` | economy / premium-economy / business / first. |
| `maxStops` | any / nonstop / one-stop / two-stops. |
| `adults` / `children` / `infantsInSeat` / `infantsOnLap` | Passenger counts. |
| `currency` | ISO code, e.g. `USD`, `AED`, `GBP`. |
| `market` | Google locale, e.g. `en-US`, `en-AE`. |
| `maxResultsPerSearch` | Cap per route. |
| `proxyConfiguration` | **Residential proxy recommended** (default). |

#### Example

```json
{
  "searches": [
    { "origin": "DXB", "destination": "LHR", "departDate": "2026-10-15", "returnDate": "2026-10-22" },
    { "origin": "AUH", "destination": "JFK", "departDate": "2026-11-01" }
  ],
  "cabinClass": "economy",
  "maxStops": "nonstop",
  "adults": 2,
  "currency": "AED",
  "market": "en-AE",
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Output

Each flight offer is one dataset item:

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departDate": "2026-10-20",
  "returnDate": null,
  "tripType": "one-way",
  "price": 184,
  "currency": "USD",
  "priceText": "$184",
  "airline": "Delta",
  "stops": "Nonstop",
  "duration": "6 hr 6 min",
  "departure": "Departure time: 9:25 AM.",
  "arrival": "Arrival time: 12:31 PM.",
  "cabinClass": "economy",
  "googleFlightsUrl": "https://www.google.com/travel/flights?tfs=..."
}
```

### Common uses

- **Fare monitoring** — schedule a run per route and watch for price drops.
- **Price comparison** — pull many routes/dates in one run.
- **Travel dashboards & alerts** — feed structured fares into your own tooling.

### Notes & limitations

- **Residential proxy required in practice** — see above. This is inherent to Google Flights, not specific to this Actor.
- Google Flights markup changes often; field parsing is best-effort and degrades gracefully (a field it can't read becomes `null` rather than failing the run). If Google changes layout, selectors may need an update.
- Prices are indicative "from" fares shown by Google at scrape time and can change before booking.
- Use IATA codes for reliability (`DXB`, `LHR`, `JFK`).

# Actor input Schema

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

List of routes to search. Each item: { "origin": "DXB", "destination": "LHR", "departDate": "2026-10-15", "returnDate": "2026-10-22" }. Use IATA airport/city codes. Omit returnDate for one-way.

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

Optional single-route shortcut instead of 'searches'. IATA code, e.g. 'DXB'.

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

IATA code, e.g. 'LHR'.

## `departDate` (type: `string`):

YYYY-MM-DD.

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

YYYY-MM-DD. Leave empty for one-way.

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

Cabin class to search.

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

Maximum number of stops per flight.

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

Number of adult passengers.

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

Number of child passengers (2-11).

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

Number of infants occupying a seat.

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

Number of infants on lap.

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

ISO currency code, e.g. 'USD', 'AED', 'GBP', 'EUR'.

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

Google locale, e.g. 'en-US', 'en-AE', 'en-GB'.

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

Cap on flight offers returned per route.

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

Google blocks datacenter IPs. A residential proxy is strongly recommended.

## Actor input object example

```json
{
  "searches": [
    {
      "origin": "DXB",
      "destination": "LHR",
      "departDate": "2026-10-15",
      "returnDate": "2026-10-22"
    }
  ],
  "origin": "",
  "destination": "",
  "departDate": "",
  "returnDate": "",
  "cabinClass": "economy",
  "maxStops": "any",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "currency": "USD",
  "market": "en-US",
  "maxResultsPerSearch": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Structured flight offers in the default dataset, one item per fare.

# 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 = {
    "searches": [
        {
            "origin": "DXB",
            "destination": "LHR",
            "departDate": "2026-10-15",
            "returnDate": "2026-10-22"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("get_anything/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 = { "searches": [{
            "origin": "DXB",
            "destination": "LHR",
            "departDate": "2026-10-15",
            "returnDate": "2026-10-22",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("get_anything/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 '{
  "searches": [
    {
      "origin": "DXB",
      "destination": "LHR",
      "departDate": "2026-10-15",
      "returnDate": "2026-10-22"
    }
  ]
}' |
apify call get_anything/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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