# Google Flights Scraper: Fares, Dates & Airlines (`mastertools/google-flights-scraper`) Actor

Google Flights fares by route and dates: every itinerary with airline, flight numbers, stops, layovers, times and CO2, plus a cheapest-day price calendar and Google's typical price. No login.

- **URL**: https://apify.com/mastertools/google-flights-scraper.md
- **Developed by:** [Master Tools](https://apify.com/mastertools) (community)
- **Categories:** Travel, Agents, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 75.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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.
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: Fares, Dates & Airlines

**Find the cheapest day to fly — and every flight behind it — straight from Google Flights.**

Type a route and a date, press Start, and in a couple of seconds get every itinerary Google Flights shows: price, airline, flight numbers, departure and arrival times, stops, layovers, travel time, aircraft and CO2. Add a date range and get a ready **price calendar**: the cheapest fare for every day of the month, with Google's own verdict on whether the price is low, typical or high.

### What you get

- **The cheapest day of the month in one run** — search a whole date range and get one row per day with the lowest fare, airline and stops. A month of round-trip fares in about a minute.
- **Know a good deal when you see it** — every row carries Google's usual price for the trip, the typical range and how many percent today's fare is above or below it.
- **Every itinerary in full detail** — airline, flight numbers, departure and arrival times, duration, stops, layover airports and waits, aircraft, legroom, operating carrier, overnight flights and self-transfers.
- **One click to book** — each flight comes with a link that opens exactly that itinerary in Google Flights with every seller's fare.
- **Round trips and flexible stays** — set a return date, or a trip length like 7 days and every departure in the range gets its own return.
- **Many routes at once** — several airports in From and To, or a list like JFK-LHR, LAX-NRT, SFO-CDG.
- **Any cabin, any party** — economy to first, up to 9 travellers with children and infants, nonstop only, favourite airlines or alliances, 70+ currencies and the country you buy from.
- **CO2 and baggage** — estimated emissions per flight versus the route average, and a link to each airline's baggage rules.
- **Works out of the box** — no login, no cookies, no proxies to set up. Press Start: the example input returns flights in seconds.

### Who uses it

- **Fare trackers and deal alerts** — schedule the run daily with a relative date like `30` (days from today) and catch price drops.
- **Travel agencies and tour operators** — price whole calendars and route lists for offers and packages.
- **Analysts and researchers** — airline competition by route, nonstop availability, price seasonality, CO2 by carrier.
- **AI agents** — one short input, a compact answer in seconds.

### How to use

1. Press **Start** — the example (New York JFK → London LHR, 30 days from today) works as is.
2. Put in your own airports and dates. For a price calendar, fill **Last departure date** and choose **Cheapest flight per day**.
3. Download the results as JSON, CSV or Excel, or get them through the API.

### Input

| Field | What it does | Example |
|---|---|---|
| `from` | Departure airport code, several with commas | `JFK` or `JFK, EWR` |
| `to` | Arrival airport code, several with commas | `LHR` |
| `departureDate` | A date, or days from today. Empty = 30 days from today | `2026-12-20` or `30` |
| `departureDateTo` | Last departure date for a date range | `2027-01-20` |
| `resultType` | `flights` — every itinerary; `cheapest` — one row per day (price calendar) | `cheapest` |
| `returnDate` | Return date for a round trip | `2026-12-30` |
| `stayDays` | Round trip of this many days for every departure in the range | `7` |
| `cabinClass` | `economy`, `premium-economy`, `business`, `first` | `business` |
| `maxStops` | `any`, `nonstop`, `1`, `2` | `nonstop` |
| `airlines` | Only these airlines or alliances | `["BA", "AA"]` or `["STAR_ALLIANCE"]` |
| `adults`, `children`, `infantsInSeat`, `infantsOnLap` | Travellers | `2`, `1`, `0`, `0` |
| `routes` | Many routes at once, used instead of From and To | `["JFK-LHR", "LAX-NRT"]` |
| `currency`, `country` | Currency and country of sale | `EUR`, `DE` |
| `maxFlightsPerSearch` | Cap on rows per route and day | `20` |

A whole month of daily round-trip fares:

```json
{
  "from": "JFK",
  "to": "LHR",
  "departureDate": "2027-03-01",
  "departureDateTo": "2027-03-31",
  "stayDays": 7,
  "resultType": "cheapest"
}
```

### Output

One flat row per itinerary (or per day in price-calendar mode). The full flight-by-flight breakdown is in `legs`.

```json
{
  "route": "JFK-LHR",
  "departureDate": "2026-12-16",
  "returnDate": null,
  "tripType": "one-way",
  "cabinClass": "economy",
  "rank": 2,
  "price": 503,
  "currency": "USD",
  "airline": "Aer Lingus",
  "flightNumbers": "EI 108, EI 156",
  "departureAirport": "JFK",
  "arrivalAirport": "LHR",
  "departureTime": "2026-12-16T19:25",
  "arrivalTime": "2026-12-17T10:10",
  "duration": "9h 45m",
  "durationMinutes": 585,
  "stops": 1,
  "layovers": "DUB 1h 45m",
  "aircraft": "Airbus A321neo, Airbus A320neo",
  "overnight": true,
  "co2Kg": 428,
  "co2TypicalKg": 435,
  "co2DiffPercent": -2,
  "priceLevel": "typical",
  "typicalPrice": 300,
  "typicalPriceLow": 285,
  "typicalPriceHigh": 490,
  "flightsFound": 23,
  "baggagePolicyUrl": "http://www.aerlingus.com/help/help/baggageinformation/",
  "googleFlightsUrl": "https://www.google.com/travel/flights/booking?tfs=…",
  "legs": [
    { "flightNumber": "EI 108", "from": "JFK", "to": "DUB", "departureTime": "2026-12-16T19:25", "arrivalTime": "2026-12-17T07:00", "durationMinutes": 395, "aircraft": "Airbus A321neo", "legroom": "31 in" },
    { "flightNumber": "EI 156", "from": "DUB", "to": "LHR", "departureTime": "2026-12-17T08:45", "arrivalTime": "2026-12-17T10:10", "durationMinutes": 85, "aircraft": "Airbus A320neo", "legroom": "29 in" }
  ]
}
```

In price-calendar mode each day also carries `priceHistory` — the lowest fare for that search on each of the last ~60 days — and `priceVsTypicalPercent`.

The dataset has two ready views: **Flights** and **Price calendar**.

### Use it with AI agents

Connect the Actor as a tool in Claude, ChatGPT, Cursor or n8n through the Apify MCP server. Two fields — `from` and `to` — are enough; the answer is compact rows in seconds, ready for "find me the cheapest nonstop to Tokyo next month".

### Integrations

Google Sheets, Make, Zapier, n8n, Slack and email alerts, webhooks and the Apify API. Schedule a daily run with relative dates (`departureDate: 30`, `departureDateTo: 60`) and every run looks at the same window ahead.

### FAQ

**How fresh is the data?** Every run reads Google Flights live, at the moment you run it.

**Are prices per person?** Prices are the total for all travellers in the search, in the currency you choose. For a round trip the price is the round-trip fare.

**Can I search a month of dates?** Yes — fill `departureDateTo`. Up to 180 days per run, and many routes at once.

**What do I get for a round trip?** The outbound itineraries with their round-trip fares, and a link that opens each one in Google Flights with its return options.

**What if a route has no flights?** You get a free row with the reason instead of a flight, and the run goes on.

### Need data at scale?

Daily fare feeds for thousands of routes, a pipeline into your database, BI or CRM, or a scraper for another travel site — contact us.

# Actor input Schema

## `from` (type: `string`):

Departure airport, three-letter code: JFK, LHR, CDG. Several at once with commas — JFK, EWR, LGA — and every pair with "To" is searched.

## `to` (type: `string`):

Arrival airport, three-letter code. Several at once with commas: LHR, LGW.

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

A date like 2026-12-20, or a number of days from today like 30. Empty means 30 days from today — handy for scheduled price tracking.

## `departureDateTo` (type: `string`):

Search every day from the departure date up to this date — a whole month of fares in one run. A date like 2027-01-20 or days from today like 60. Empty means one day.

## `resultType` (type: `string`):

Every flight: all itineraries Google Flights shows for each route and day. Cheapest per day: one row per route and day with the lowest fare — a ready price calendar.

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

Fill it for a round trip: prices become round-trip fares. A date like 2026-12-30 or days from today. Empty means one-way.

## `stayDays` (type: `integer`):

Instead of a fixed return date: come back this many days after each departure. Works with the date range — for example every 7-day trip in March.

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

Seat class to price.

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

Limit the number of stops.

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

Only these airlines: two-character codes like BA, AA, DL — or an alliance: ONEWORLD, SKYTEAM, STAR_ALLIANCE. Empty means all airlines.

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

Travellers aged 12 and over.

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

Travellers aged 2 to 11.

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

Under 2, with their own seat.

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

Under 2, sitting on an adult's lap.

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

Many routes in one run, one per line: JFK-LHR, LAX-NRT, SFO-CDG. When filled, it is used instead of From and To.

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

Three-letter code: USD, EUR, GBP, CAD, AUD, INR and others Google Flights supports.

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

Two-letter country code Google Flights prices for: US, GB, DE, IN. Fares can differ by country.

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

Cap on rows for each route and day, best flights first.

## Actor input object example

```json
{
  "from": "JFK",
  "to": "LHR",
  "resultType": "flights",
  "cabinClass": "economy",
  "maxStops": "any",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "currency": "USD",
  "country": "US",
  "maxFlightsPerSearch": 100
}
```

# Actor output Schema

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

Every flight row of this run.

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

Date, price, price level and the usual price range.

# 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 = {
    "from": "JFK",
    "to": "LHR"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mastertools/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 = {
    "from": "JFK",
    "to": "LHR",
}

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

```

## MCP server setup

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