# Google Flights Scraper – All Flights, Prices & Price Insights (`brii3343/google-flights-scraper`) Actor

Scrape all Google Flights results for any route and date: prices, airlines, flight numbers, times, stops, layovers, bags, emissions and booking links, plus price insights (low/typical/high, 60-day price history). Round trips, date ranges, filters. No proxy needed.

- **URL**: https://apify.com/brii3343/google-flights-scraper.md
- **Developed by:** [Brian Gastaldelli](https://apify.com/brii3343) (community)
- **Categories:** Travel, Automation, E-commerce
- **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

### Google Flights Scraper — all flights, prices, bags and price insights

Type routes and dates and get **every flight Google Flights shows**, not only the first page: price, airlines, flight numbers, departure and arrival times, duration, stops and layovers, aircraft, legroom, operating carrier, codeshares, **included carry-on and checked bags**, CO₂ emissions and a booking link. Each search also returns Google's **price insights**: lowest price, whether prices are low, typical or high, the typical price range, the best time to book and **60 days of price history**. Round trips, date ranges, business class, families, airline and stop filters, any currency and language.

#### Why this Actor

- **All the flights.** Google Flights lists 50-300 flights for a busy route and day; you get all of them (the same number Google shows after *View more flights*), with top flights marked.
- **Checked against Google.** In our tests 43 flights out of 43 had the same times, airlines, stops, emissions and price as the Google Flights page, including business round trips in EUR and a family with a child.
- **Price insights for every search**: price level, typical range and price history, the data behind Google's "Prices are currently low" box. Ideal for fare alerts.
- **Scheduled runs never break.** Dates can be a number of days from today (`30` = in 30 days), and a date range keeps the same length of stay for every day.
- **Round trips done right.** Google shows round trips as outbound flights with the round-trip total. Ask for the return options of the first N outbound flights and get them with their total price and a booking link.
- **Fast and cheap.** 40 searches worldwide with 5,428 flights in 56 seconds. No proxy needed.
- **Pay only for results.** Invalid routes, past dates and searches without flights come back with a clear status and **are not charged**. Flights that Google lists without a price are included for free.

#### Use cases

- **Fare tracking and price alerts**: run every day and compare with `priceLevel`, `typicalPriceRange` and `priceHistory`.
- **Cheapest day to fly**: search every day of a range and sort by `lowestPrice`.
- **Travel sites, newsletters and deal pages**: fill your pages with real schedules, prices and booking links.
- **Airline and airport analysis**: who flies a route, how often, with which aircraft, codeshares and emissions.
- **Corporate travel and budgeting**: typical fares for the routes your team flies.
- **AI agents and LLM pipelines**: give your assistant live flight data in clean JSON.

#### Input

| Field | Description |
|---|---|
| Routes | One per line: `JFK-LAX`, `NYC-LON` (all airports of a city), `JFK,EWR-MIA` (several airports). |
| Departure date | `YYYY-MM-DD` or a number of days from today (`30`). |
| Last departure date | Optional: one search per day up to this date (max 91 days). |
| Return date | Optional: round trips. With a date range the length of stay stays the same. |
| Adults, children | Prices are the total for all passengers. |
| Cabin class, stops, airlines | Economy, premium economy, business, first; nonstop, 1 or 2 stops; IATA codes (`DL`, `BA`) or `STAR_ALLIANCE`, `SKYTEAM`, `ONEWORLD`. |
| Max flights per search | Default 100; `0` = all. Saved in Google's order (top flights first). |
| Return flights for the first N outbound flights | Round trips only: the return options of the first N outbound flights, with the round-trip total. |
| Currency, language, country | `USD`, `EUR`, `GBP`, `INR`…; Google language (`en`, `de`, `it`…) and country. |
| Google Flights links | Search links copied from google.com/travel/flights, with all your filters. |

Example input:

```json
{
  "routes": ["NYC-LON", "SFO-SEA"],
  "departureDate": "30",
  "departureDateTo": "36",
  "returnDate": "37",
  "adults": 2,
  "maxStops": "1",
  "currency": "USD",
  "maxFlightsPerSearch": 50,
  "returnFlightsForTop": 2
}
```

#### Output

One `search` row per search, followed by its `flight` rows. Real output (NYC-LON, one-way, price history cut):

```json
{
  "type": "search",
  "route": "NYC-LON",
  "origin": "NYC",
  "destination": "LON",
  "departureDate": "2026-11-13",
  "returnDate": null,
  "tripType": "one-way",
  "adults": 1,
  "children": 0,
  "cabinClass": "economy",
  "leg": "outbound",
  "currency": "USD",
  "flightsFound": 300,
  "lowestPrice": 270,
  "priceLevel": "typical",
  "typicalPriceRange": { "low": 165, "high": 270 },
  "bestTimeToBook": null,
  "priceHistory": [{ "date": "2026-07-30", "price": 197 }, { "date": "2026-07-31", "price": 197 }],
  "googleFlightsUrl": "https://www.google.com/travel/flights/search?tfs=GhoSCjIwMjYtMTEtMTNqBRIDTllDcgUSA0xPTkIBAUgBmAEC&hl=en&gl=us&curr=USD",
  "scrapedAt": "2026-09-29T04:49:04.823Z"
}
```

```json
{
  "type": "flight",
  "route": "NYC-LON",
  "departureDate": "2026-11-13",
  "tripType": "one-way",
  "leg": "outbound",
  "rank": 4,
  "isTopFlight": false,
  "price": 270,
  "airlines": ["American", "British Airways"],
  "airlineCode": null,
  "codeshareAirlines": [],
  "carryOnBags": 1,
  "checkedBags": null,
  "flightNumbers": ["AA 4347", "BA 98"],
  "departureAirport": "LGA",
  "arrivalAirport": "LHR",
  "departureTime": "2026-11-13T08:20",
  "arrivalTime": "2026-11-14T10:30",
  "durationMinutes": 1270,
  "stops": 1,
  "layovers": [
    { "airport": "YYZ", "airportName": "Toronto Pearson International Airport", "city": "Toronto", "durationMinutes": 741, "changeOfAirport": false }
  ],
  "segments": [
    {
      "flightNumber": "AA 4347",
      "airline": "American",
      "airlineCode": "AA",
      "operatedBy": "Republic Airways as American Eagle",
      "codeshares": [],
      "aircraft": "Embraer 170",
      "departureAirport": "LGA",
      "departureAirportName": "LaGuardia Airport",
      "arrivalAirport": "YYZ",
      "arrivalAirportName": "Toronto Pearson International Airport",
      "departureTime": "2026-11-13T08:20",
      "arrivalTime": "2026-11-13T10:04",
      "durationMinutes": 104,
      "legroom": "30 inches",
      "emissionsKg": 114
    },
    {
      "flightNumber": "BA 98",
      "airline": "British Airways",
      "airlineCode": "BA",
      "operatedBy": null,
      "codeshares": [],
      "aircraft": "Airbus A350",
      "departureAirport": "YYZ",
      "departureAirportName": "Toronto Pearson International Airport",
      "arrivalAirport": "LHR",
      "arrivalAirportName": "Heathrow Airport",
      "departureTime": "2026-11-13T22:25",
      "arrivalTime": "2026-11-14T10:30",
      "durationMinutes": 425,
      "legroom": "31 inches",
      "emissionsKg": 320
    }
  ],
  "emissions": { "kg": 433, "typicalKg": 431, "differencePercent": 0 },
  "currency": "USD",
  "priceIsRoundTripTotal": false,
  "googleFlightsUrl": "https://www.google.com/travel/flights/booking?tfs=GlwSCjIwMjYtMTEtMTMiIAoDTEdBEgoyMDI2LTExLTEzGgNZWVoqAkFBMgQ0MzQ3Ih4KA1lZWhIKMjAyNi0xMS0xMxoDTEhSKgJCQTICOThqBRIDTllDcgUSA0xPTkIBAUgBmAEC&hl=en&gl=us&curr=USD",
  "scrapedAt": "2026-09-29T04:49:04.825Z"
}
```

- Times are **local times** of each airport (`arrivalTime` can be earlier than `departureTime` when you fly west across the date line).
- `googleFlightsUrl` of a one-way flight opens its booking page on Google Flights (airline and travel-agency prices); for a round trip it opens the return flights for that outbound flight.
- With *Return flights for the first N outbound flights*, each outbound flight adds a `search` row with `leg: "return"` and `outboundFlightNumbers`, followed by its return `flight` rows (price = round-trip total, link = booking page).

Rows with `type: "status"` explain what went wrong, and are not charged:

| Status | Meaning |
|---|---|
| `no_flights` | Google Flights has no flights for this search (check codes, dates, stops and airlines) |
| `invalid_search` | Google refused the search (date out of range or unknown code) |
| `invalid_route`, `invalid_url`, `invalid_input` | The route, the link or the dates in the input are not valid |
| `too_many_searches` | Routes × days above the limit of one run (split it) |
| `unsupported` | Multi-city links and searches with infants are not supported yet |
| `error` | Google did not answer after every retry (rare); try again later |

#### Honest limits

- **Prices are Google's prices** at the moment of the run, for all passengers together; round-trip prices are the round-trip total. Prices converted from another currency can differ by 1 unit from the page because of the exchange rate.
- **About 1 flight in 6 has no price** (`price: null`): Google itself shows *Price unavailable* for them (often small or local airlines). They are included free of charge.
- **Bags** are the bags included in the fare for all passengers, as Google shows them; Google knows them mostly for flights sold in the US, elsewhere they are often `null`. `emissions` are for all passengers too.
- **Multi-city trips and infants** are not supported yet.
- `bestTimeToBook` and `priceHistory` come from Google's price insights and are missing for some routes.

#### Pricing

Pay per event: **$3 per 1,000 searches** (`search`, one per results page: each route and day, and each list of return flights) and **$0.10 per 1,000 flights** (`flight`). A search with 100 flights costs $0.013; the first 10 flights of a route cost $0.004. Status rows and flights without a price are free.

#### Tips

- For daily fare tracking, use a number of days as the date (`30`) and schedule the Actor: the dates move with the calendar.
- To find the cheapest day, set *Last departure date* and set *Max flights per search* to `10`: the search row already has `lowestPrice` and `priceLevel`.
- City codes (`NYC`, `LON`, `PAR`, `TYO`) search all the airports of the city, as on Google.

#### Other Actors by the same author

- [Google Hotels Scraper](https://apify.com/brii3343/google-hotels-scraper): hotel prices from every booking site.
- [Google Trends API](https://apify.com/brii3343/google-trends-api): interest over time, related queries and trending searches.

# Actor input Schema

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

One route per line, as two airport or city codes: <code>JFK-LAX</code>, <code>NYC-LON</code> (all airports of a city), <code>JFK,EWR-MIA</code> (several airports). Each route is searched on every departure date.

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

YYYY-MM-DD, or a number of days from today (for example <code>30</code>) so that scheduled runs never expire.

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

Search every day from the departure date to this date (up to 91 days), to find the cheapest days. Each day is a separate search. YYYY-MM-DD or days from today.

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

Leave empty for one-way flights. With a return date you get round trips: prices are the total for the round trip. With a date range, the length of stay stays the same for every day.

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

Prices are the total for all passengers.

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

Children aged 2-11. Searches with infants are not supported yet.

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

Travel class of the search.

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

Maximum number of stops per direction.

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

Only these airlines, as 2-character IATA codes (<code>DL</code>, <code>BA</code>) or an alliance: <code>STAR_ALLIANCE</code>, <code>SKYTEAM</code>, <code>ONEWORLD</code>.

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

Google Flights usually has 50-150 flights per route and day; 0 = all of them. They are saved in Google's order (top flights first).

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

Round trips only. Google shows round trips as outbound flights with the total price; with N > 0 you also get the return options (and their total prices) for the first N outbound flights. Each outbound flight is one more search.

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

3-letter code: USD, EUR, GBP, INR…

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

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

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

2-letter country code of the Google Flights site (us, gb, de, in…). Prices can differ by country.

## `googleFlightsUrls` (type: `array`):

Search links copied from google.com/travel/flights (they contain <code>tfs=</code>), with all your filters. You get all the flights of that search, not only the first ones.

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

Not needed: the scraper connects directly and switches to Apify Proxy by itself if Google slows it down.

## Actor input object example

```json
{
  "routes": [
    "JFK-LAX",
    "LHR-CDG"
  ],
  "departureDate": "30",
  "adults": 1,
  "children": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "maxFlightsPerSearch": 20,
  "returnFlightsForTop": 0,
  "currency": "USD",
  "language": "en",
  "country": "us"
}
```

# Actor output Schema

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

One row per search (lowest price, price level, typical range, price history) and one row per flight (price, times, flight numbers, stops, layovers, aircraft, emissions).

# 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 = {
    "routes": [
        "JFK-LAX",
        "LHR-CDG"
    ],
    "departureDate": "30",
    "maxFlightsPerSearch": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("brii3343/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 = {
    "routes": [
        "JFK-LAX",
        "LHR-CDG",
    ],
    "departureDate": "30",
    "maxFlightsPerSearch": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("brii3343/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 '{
  "routes": [
    "JFK-LAX",
    "LHR-CDG"
  ],
  "departureDate": "30",
  "maxFlightsPerSearch": 20
}' |
apify call brii3343/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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