# Google Flights Scraper (`tidyharvest/google-flights-scraper`) Actor

Every Google Flights fare for any route and date: price, airlines, flight numbers, times, stops, layovers, aircraft and CO2. Round trip or one way, any cabin and currency, many routes per run, +N dates for scheduled tracking. From $0.60 per 1,000 flights.

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

## Pricing

from $0.60 / 1,000 flight scrapeds

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

Search **Google Flights** for any route and date and get every fare Google lists: price, airlines, flight numbers, times, stops, layovers, aircraft and CO2, plus Google's own **low / typical / high price verdict** and about **60 days of price history** for the trip. Round trips can list the **return flights** you can pair with each outbound. Clean rows for a spreadsheet, a price tracker or an alert.

### What you can do with it

- **Track fares on a schedule:** run the same route daily and watch the price move. Dates can be written `+30` (30 days from today) so a saved run never goes stale. Each run also saves Google's 60-day price history for the trip, so a new route has a chart on day one.
- **Know if a fare is a good one:** every row carries Google's verdict (`low`, `typical` or `high`) and the typical price range for the trip.
- **Pick the whole round trip:** set `returnFlightsForTop` and each of the best outbound flights comes with its return options, priced as the full trip.
- **Compare routes and dates in one run:** list several routes or dates under "More routes and dates".
- **Filter before you pay:** nonstop only, a price ceiling, departure and arrival time windows, layover length, connecting airports, bags included, chosen or excluded airlines, no basic economy, lower emissions. Filters and the result cap apply before you are charged.
- **Round trip or one way, any cabin, any currency**, adults, children and infants.

### Input

| Field | What it does |
|---|---|
| `origin`, `destination` | Three-letter airport codes (SFO, LAX). |
| `departureDate`, `returnDate` | `YYYY-MM-DD`, or `+N` days from today. No return date = one way. |
| `searches` | More routes or dates; each item can set `origin`, `destination`, `departureDate`, `returnDate` (an empty `returnDate` means one way). |
| `adults`, `children`, `infantsInSeat`, `infantsOnLap` | Passengers (up to 9). |
| `cabinClass`, `currency`, `language` | Cabin, currency code, locale. |
| `maxStops`, `maxPrice`, `airlines`, `excludeAirlines`, `excludeBasicEconomy`, `hideSelfTransfer`, `lessEmissionsOnly` | Filters. `airlines` takes codes (UA, DL) or alliances (STAR_ALLIANCE, SKYTEAM, ONEWORLD). |
| `earliestDepartureHour`, `latestDepartureHour`, `earliestArrivalHour`, `latestArrivalHour` | Time windows, 0-23, local time. |
| `maxDurationMinutes`, `minLayoverMinutes`, `maxLayoverMinutes`, `connectingAirports` | Trip length and connection rules. |
| `carryOnBags`, `checkedBags` | Prices include this many bags per traveler. |
| `returnFlightsForTop`, `maxReturnOptions` | Round trips: list return flights for the top N outbound flights, cheapest first. |
| `sortBy` | `best` (Google's order), `price`, `duration`, `departure`, `arrival`. |
| `includePriceHistory` | Save the verdict and 60-day history as the `PRICE_HISTORY` record (on by default). |
| `maxResults` | Hard cap on flights returned and charged. |

Example:

```json
{ "origin": "SFO", "destination": "LAX", "departureDate": "+30", "returnDate": "+34", "maxStops": 0, "returnFlightsForTop": 5, "maxResults": 20 }
```

### Output

One item per flight option:

```json
{
  "rank": 1, "isCheapest": true, "isFastest": false, "category": "best",
  "price": 148, "currency": "USD", "priceLevel": "typical", "typicalPriceLow": 70, "typicalPriceHigh": 175,
  "airlines": ["Frontier"], "flightNumbers": ["F9 2858"],
  "origin": "SFO", "destination": "LAX",
  "departure": "2026-11-10T21:27", "arrival": "2026-11-10T22:54",
  "duration": "1h 27m", "durationMinutes": 87, "stops": 0, "layovers": [],
  "segments": [{ "flightNumber": "F9 2858", "aircraft": "Airbus A321neo", "from": "SFO", "to": "LAX", "legroom": "28 inches" }],
  "returnOptions": [{ "price": 148, "flightNumbers": ["F9 4593"], "departure": "2026-11-14T19:03", "arrival": "2026-11-14T20:25", "stops": 0 }],
  "carbonGrams": 53000, "carbonVsTypicalPercent": -43,
  "tripType": "round-trip", "searchReturnDate": "2026-11-14",
  "googleFlightsUrl": "https://www.google.com/travel/flights/search?..."
}
```

`category` is Google's own grouping ("best" or "other"). On a round trip, `price` is the price of the whole trip and each row describes the outbound flight; with `returnFlightsForTop`, `returnOptions` lists return flights, each `price` being the whole trip with that outbound. `googleFlightsUrl` opens the same search on Google Flights.

The `PRICE_HISTORY` record (key-value store) holds one entry per search: `priceLevel`, `typicalPrice`, `typicalPriceLow`/`High`, `cheapestPrice` and `history` (about 60 daily points of the cheapest price for that trip). Google does not always publish a verdict, for example when filters narrow the search; then the fields are empty.

### Compared with other Google Flights actors

Measured 2026-10-28, same searches, same hour:

| | This actor | lergassy/google-flights-scraper | johnvc/Google-Flights-Data-Scraper |
|---|---|---|---|
| SFO-LAX, round trip | 65 flights | 65 flights, all the same fares and times | 60 flights (earlier run) |
| JFK-LHR, round trip, one page | 84 flights | not run | 20 flights |
| Price per 1,000 flights | **$0.60-0.85** by plan | $0.70-1.00 | about $0.50-1.50 ($0.03 per page of up to 60) |
| Price verdict and typical range, layovers, return flights, direct Google link | yes | yes | no |
| 60-day price history saved per search | yes | no | no |

Where they still win: lergassy has a flexible-date price calendar, "anywhere" destination search, multi-city trips and booking options with seller links, and johnvc has booking options. This actor does not have those yet.

### Pricing

Pay per result: you are charged for each flight option returned (`flight-scraped`). A run that finds nothing fails instead of silently returning an empty dataset.

### Limits and notes

- Prices and availability change by the minute; check the fare with the airline or a travel site before you book.
- Returns what Google shows for the search: no booking links, no calendar view, no multi-city trips.
- Public data only. Not affiliated with Google.

### Feedback and requests

Missing a field or an option? Open an issue in the Issues tab and tell us what you need.

# Actor input Schema

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

Three-letter IATA code, e.g. SFO.

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

Three-letter IATA code, e.g. LAX.

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

YYYY-MM-DD, or +N for N days from today (+30 = a month out; keeps scheduled runs current).

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

Leave empty for one-way. Prices are then for the whole round trip.

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

Search several routes or dates in one run. Each object can set origin, destination, departureDate, returnDate; anything left out falls back to the fields above. When this list is filled, the fields above are only defaults.

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

No description

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

No description

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

No description

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

No description

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

No description

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

Three-letter code, e.g. USD, EUR, GBP.

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

Locale for airline and airport names, e.g. en-US, de-DE.

## `maxStops` (type: `integer`):

0 = nonstop only.

## `maxPrice` (type: `integer`):

Whole-trip price ceiling in the chosen currency.

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

Two-letter IATA codes (UA, DL) or alliances (STAR_ALLIANCE, SKYTEAM, ONEWORLD).

## `excludeAirlines` (type: `array`):

Two-letter IATA codes (NK, F9). Any trip using one of them is dropped.

## `excludeBasicEconomy` (type: `boolean`):

No description

## `maxDurationMinutes` (type: `integer`):

Total trip time ceiling; Google applies it.

## `earliestDepartureHour` (type: `integer`):

0-23, local time at the origin. Google applies it to the outbound flight.

## `latestDepartureHour` (type: `integer`):

0-23, local time at the origin.

## `earliestArrivalHour` (type: `integer`):

0-23, local time at the destination.

## `latestArrivalHour` (type: `integer`):

0-23, local time at the destination.

## `minLayoverMinutes` (type: `integer`):

Skip tight connections.

## `maxLayoverMinutes` (type: `integer`):

Skip long layovers.

## `connectingAirports` (type: `array`):

Three-letter airport codes.

## `lessEmissionsOnly` (type: `boolean`):

Google's own emissions flag.

## `carryOnBags` (type: `integer`):

Prices include this many carry-on bags per traveler (basic fares often charge for them).

## `checkedBags` (type: `integer`):

Prices include this many checked bags per traveler.

## `hideSelfTransfer` (type: `boolean`):

Leave out trips made of separate tickets.

## `returnFlightsForTop` (type: `integer`):

Round trips only. For each of the N best outbound flights (in your sort order), also list the return flights you could pair with it, priced as the whole trip. 0 = off. Adds about a second per flight.

## `maxReturnOptions` (type: `integer`):

Cheapest first.

## `includePriceHistory` (type: `boolean`):

Stored in the run's key-value store as PRICE_HISTORY: for each search, Google's low/typical/high verdict, the typical price range and about 60 days of the cheapest price for that trip.

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

No description

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

Hard cap on flights returned (and charged) across all searches.

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

Optional. Use if Google refuses direct requests.

## Actor input object example

```json
{
  "origin": "SFO",
  "destination": "LAX",
  "departureDate": "+30",
  "returnDate": "+34",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "cabinClass": "economy",
  "currency": "USD",
  "language": "en-US",
  "excludeBasicEconomy": false,
  "lessEmissionsOnly": false,
  "carryOnBags": 0,
  "checkedBags": 0,
  "hideSelfTransfer": false,
  "returnFlightsForTop": 0,
  "maxReturnOptions": 8,
  "includePriceHistory": true,
  "sortBy": "best",
  "maxResults": 25,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `flights` (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 = {
    "origin": "SFO",
    "destination": "LAX",
    "departureDate": "+30",
    "returnDate": "+34"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidyharvest/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": "SFO",
    "destination": "LAX",
    "departureDate": "+30",
    "returnDate": "+34",
}

# Run the Actor and wait for it to finish
run = client.actor("tidyharvest/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": "SFO",
  "destination": "LAX",
  "departureDate": "+30",
  "returnDate": "+34"
}' |
apify call tidyharvest/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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