# Google Flights Scraper — All Flights & Cheapest Dates (`datafabrik/google-flights-scraper`) Actor

Every flight Google Flights has for a route and date (100–300, not just the top 15): prices, airlines, flight numbers, stops, layovers, aircraft, CO₂. Plus price insights (low/typical/high, 60-day history) and a cheapest-dates calendar. Pay per search, not per flight.

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

## Pricing

from $6.00 / 1,000 flight searches

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 — All Flights, Price Insights & Cheapest Dates

Get **every flight Google Flights has** for a route and date — usually 100 to 300 options, not only the 10–15 shown before you click "View more flights" — with price, airlines, flight numbers, times, stops, layovers, aircraft, legroom and CO₂ emissions.

Each search also returns **Google's price insights**: whether today's price is *low*, *typical* or *high*, the typical price range, and the **price history of the last 60 days**. A second mode builds a **cheapest-dates calendar**: the lowest price for every departure day over up to a year.

- ✈️ One-way and round trip, any cabin, up to 9 passengers
- 🗺️ Many routes and dates in one run (every origin × every destination × every date)
- 🏙️ City codes (PAR, LON, NYC…) and multi-airport searches (`CDG+ORY`)
- 🔁 Round trips: optional return options for the cheapest or best outbound
- 📉 Price level, typical range and 60-day price history for every search
- 📅 Cheapest dates over a range, one-way or with a fixed trip length
- ⚡ HTTP only, no browser: a search takes 1–3 seconds
- 💸 **Pay per search, not per flight** — failed, empty and invalid searches are never charged

### What you can do with it

- **Fare monitoring**: run it on a schedule for your routes and get alerted when `searchPriceLevel` turns `low`.
- **Travel apps and agencies**: full result lists with flight numbers and segments, ready for your own filters.
- **Market research**: compare airlines, prices and emissions across hundreds of routes.
- **Flexible trips**: find the cheapest week to fly with the cheapest-dates mode.

### Input

| Field | What it does |
|---|---|
| `mode` | `flights` (every flight for given dates) or `cheapest-dates` (lowest price per day over a range). |
| `origins` | Airports: IATA codes (`CDG`), city codes (`PAR` = CDG+ORY+BVA), lists (`CDG+ORY`) or Google place ids (`/m/05qtj`). |
| `destinations` | Same format. Every origin is combined with every destination. |
| `departureDates` | `YYYY-MM-DD` dates (flights mode). One search per route and date. |
| `tripType` | `one_way` or `round_trip`. |
| `returnDates` | Round trip: one return date per departure date, same order. |
| `tripLengthDays` | Round trip: return = departure + N days (required for round trips in cheapest-dates mode). |
| `returnFlightsFor` | Round trip: also fetch the return options for the `cheapest` or `best` outbound (`none` by default). No extra charge. |
| `dateRangeStart` / `dateRangeEnd` | Cheapest-dates mode: first and last departure day (up to 366 days). |
| `cabinClass` | `economy`, `premium_economy`, `business`, `first`. |
| `adults`, `children`, `infantsInSeat`, `infantsOnLap` | Passengers (max 9 in total). Prices are the total for all passengers. |
| `maxStops` | `any`, `nonstop`, `one_stop_or_fewer`, `two_stops_or_fewer`. |
| `airlines` | Only these airlines: IATA codes (`AF`, `DL`) or `STAR_ALLIANCE`, `SKYTEAM`, `ONEWORLD`. |
| `maxFlightsPerSearch` | Cap per search (0 = all). Google's top flights come first. |
| `includeUnpricedFlights` | Keep flights Google lists as "price unavailable". Off by default. |
| `outputFormat` | `flights`: one row per flight (best for spreadsheets). `searches`: one item per search with a `flights` array. |
| `currency`, `language`, `country` | Currency of prices, language of names, and point of sale. |
| `maxConcurrency` | Searches run in parallel (default 5). |
| `maxRetries` | Retries per request (default 6). Google often needs one retry; it is automatic. |
| `proxy` | Apify datacenter proxy by default — cheap and enough for Google Flights. |

#### Example: every flight Paris → New York on two dates

```json
{
  "origins": ["PAR"],
  "destinations": ["NYC"],
  "departureDates": ["2026-11-15", "2026-11-22"]
}
```

#### Example: cheapest week-long trips Lyon ⇄ Lisbon this winter

```json
{
  "mode": "cheapest-dates",
  "origins": ["LYS"],
  "destinations": ["LIS"],
  "tripType": "round_trip",
  "tripLengthDays": 7,
  "dateRangeStart": "2026-12-01",
  "dateRangeEnd": "2027-02-28",
  "currency": "EUR"
}
```

### Output

One row per flight (`outputFormat: "flights"`):

```json
{
  "type": "flight",
  "origin": "CDG", "destination": "JFK", "departureDate": "2026-11-15",
  "leg": "outbound", "rank": 1, "category": "top",
  "price": 391, "currency": "USD",
  "airlines": ["American"], "flightNumbers": ["AA 43"],
  "departure": "2026-11-15T11:25", "arrival": "2026-11-15T13:50",
  "durationMinutes": 505, "stops": 0, "layovers": [],
  "emissionsKg": 359, "typicalEmissionsKg": 370, "emissionsVsTypicalPercent": -3,
  "segments": [{ "flightNumber": "AA 43", "from": "CDG", "to": "JFK", "aircraft": "Boeing 787", "legroom": "31 inches", "...": "..." }],
  "searchCheapestPrice": 383, "searchPriceLevel": "low", "typicalPriceRange": [390, 560],
  "googleFlightsUrl": "https://www.google.com/travel/flights/search?tfs=…"
}
```

Times are **local airport times**. Round-trip prices are the total round-trip price, as on Google Flights.

A summary of each search — status, number of flights, cheapest price, price level, typical range, usual price and the 60-day `priceHistory` — is saved in the key-value store record `SEARCHES` (and inside each item with `outputFormat: "searches"`). Searches that fail or that Google rejects (unknown airport, date too far ahead) also appear in the dataset with their `status` and `errors`, free of charge.

Cheapest-dates mode returns one row per departure day: `departureDate`, `returnDate`, `price`, `isCheapestInWindow`.

### Pricing

Pay per event:

- **Flight search** — one route + date with at least one flight, **all flights included** (often 100–300 rows).
- **Price calendar** — up to 60 consecutive departure days for one route.

Empty, invalid and failed searches are never charged. Set a maximum cost per run in Apify and the scraper stops cleanly when it is reached.

### FAQ

**Are these the prices Google Flights shows?** Yes — the same data the Google Flights website loads, in the currency and country you choose. Prices change often; the scraper returns them at the time of the run.

**Why do some flights have no price?** Google lists some itineraries as "price unavailable". They are skipped unless you enable `includeUnpricedFlights`.

**Can I book or get airline booking links?** No, the scraper reads search results only. Each row has a `googleFlightsUrl` that opens the same search on Google Flights.

**Multi-city trips?** Not yet — one-way and round trip only.

**How far ahead can I search?** Google Flights covers about 11 months. Dates beyond that come back as `invalid` (not charged).

**Is it legal?** The scraper only collects public flight and price information shown to any visitor, no personal data. You are responsible for using the data in line with applicable laws and Google's terms.

### Support

Found a problem or need a field? Open an issue on the Actor page — issues are answered quickly.

# Actor input Schema

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

<b>Flights</b>: every flight for each route and date. <b>Cheapest dates</b>: the lowest price for each departure day over a date range (Google's price calendar).

## `origins` (type: `array`):

IATA airport codes (CDG, JFK…), city codes (PAR, LON, NYC… = all airports of the city), several airports joined with + (CDG+ORY), or a Google place id (/m/05qtj). Every origin is combined with every destination.

## `destinations` (type: `array`):

Same format as origins.

## `departureDates` (type: `array`):

Dates as YYYY-MM-DD. One search per route and date. Used in <b>Flights</b> mode.

## `tripType` (type: `string`):

One way, or round trip (then give return dates or a trip length).

## `returnDates` (type: `array`):

One return date per departure date, in the same order. Or leave empty and set a trip length.

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

Return date = departure date + this many days. Required for round trips in <b>Cheapest dates</b> mode.

## `returnFlightsFor` (type: `string`):

Google lists outbound flights with the round-trip price. Pick an outbound to also get the matching return options (one extra request, no extra charge).

## `dateRangeStart` (type: `string`):

First departure day to check (YYYY-MM-DD). Default: today. Used in <b>Cheapest dates</b> mode.

## `dateRangeEnd` (type: `string`):

Last departure day to check (YYYY-MM-DD), up to 366 days after the start. Default: 60 days.

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

Cabin class to search.

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

Number of adults (12+).

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

Number of children aged 2–11.

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

Infants under 2 with their own seat.

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

Infants under 2 on an adult's lap.

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

Maximum number of stops.

## `airlines` (type: `array`):

Only these airlines: 2-character IATA codes (AF, DL…) or STAR\_ALLIANCE, SKYTEAM, ONEWORLD. Empty = all.

## `maxFlightsPerSearch` (type: `integer`):

0 = all flights Google has (often 100–300). Google's top flights come first.

## `includeUnpricedFlights` (type: `boolean`):

Google lists some flights as "price unavailable". Off by default.

## `outputFormat` (type: `string`):

<b>One row per flight</b> (plus one summary row per search) is best for spreadsheets. <b>One item per search</b> nests the flights.

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

3-letter code: USD, EUR, GBP…

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

Language of airport and airline names (en, fr, de…).

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

Point of sale (us, fr, gb…). Prices can differ by country.

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

How many searches run at the same time.

## `maxRetries` (type: `integer`):

How many times a failed request is retried (Google often needs one retry).

## `proxy` (type: `object`):

Apify datacenter proxy works well for Google Flights and is the cheapest.

## Actor input object example

```json
{
  "mode": "flights",
  "origins": [
    "CDG"
  ],
  "destinations": [
    "JFK"
  ],
  "departureDates": [
    "2026-11-15"
  ],
  "tripType": "one_way",
  "returnFlightsFor": "none",
  "cabinClass": "economy",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "maxStops": "any",
  "maxFlightsPerSearch": 0,
  "includeUnpricedFlights": false,
  "outputFormat": "flights",
  "currency": "USD",
  "language": "en",
  "country": "us",
  "maxConcurrency": 5,
  "maxRetries": 6,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `searches` (type: `string`):

No description

## `calendar` (type: `string`):

No description

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

No description

# 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 = {
    "origins": [
        "CDG"
    ],
    "destinations": [
        "JFK"
    ],
    "departureDates": [
        "2026-11-15"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datafabrik/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 = {
    "origins": ["CDG"],
    "destinations": ["JFK"],
    "departureDates": ["2026-11-15"],
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("datafabrik/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 '{
  "origins": [
    "CDG"
  ],
  "destinations": [
    "JFK"
  ],
  "departureDates": [
    "2026-11-15"
  ],
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call datafabrik/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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