# Google Flights Scraper: flight prices by route and date (`leadharbor/google-flights-scraper`) Actor

Flight options and prices Google Flights shows for a route and date: airline, times, duration, stops, layovers. One-way or round trip, optional return flights. Plain HTTP, no login. Not affiliated with Google or any airline.

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

## Pricing

$0.50 / 1,000 flight row delivereds

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: flight prices by route and date

Google Flights scraper and flight price scraper. Give it routes and dates, get back one row per flight option that Google Flights shows: price, airline, flight numbers, departure and arrival times, duration, stops and layovers. One-way or round trip, with optional return flights. It reads Google's public flight results page with plain HTTP, logged out. No browser, no login, no cookies, no proxy. Use it from the Apify Console, the Apify API, schedules or integrations as a Google Flights API for price tracking, fare comparison and travel data. It is not an official Google API and is not affiliated with or endorsed by Google or any airline.

![Sample output: six Muscat to Dubai flight rows with airline, flight number, times, duration, stops and price](https://api.apify.com/v2/key-value-stores/ETfrhQo14MUgBgWeP/records/flights-sample-output.png?signature=vrQrDnG2P4P4n1kCyuTj)

### What you get

![What the Actor gives you: one row per flight, round trips, many routes in one run, pay per delivered row, and the limits](https://api.apify.com/v2/key-value-stores/ETfrhQo14MUgBgWeP/records/flights-what-you-get.png?signature=K0elauHeELxru8c7go8L)

For every flight option: the route and date you searched, the flight's own origin, destination, dates and times, duration in minutes, number of stops, layover airports and minutes, airline names, flight numbers, aircraft where Google shows it, the price and its currency, and a link to the same search on Google Flights. In our test on 22 Nov 2026, the 9 routes Google answered with flights returned between 16 and 178 options per search.

| Field | Meaning |
|---|---|
| `rowType` | `flight`, or a free status row: `no_flights`, `search_failed` |
| `searchFrom`, `searchTo`, `searchDepartureDate`, `searchReturnDate`, `tripType` | The search that produced the row. `tripType` is `one-way` or `round-trip` |
| `legType` | `outbound`, or `return` for a return flight (only with Include return flights) |
| `origin`, `destination`, `departureDate`, `departureTime`, `arrivalDate`, `arrivalTime` | The flight itself. Times are local airport times, `HH:MM` |
| `durationMin`, `stops` | Total duration in minutes and number of stops |
| `price`, `currency`, `priceAvailable`, `priceBasis` | Price as Google shows it (see "What the price means"). `price` is null and `priceAvailable` false when Google shows no price |
| `airlines`, `flightNumbers`, `legs`, `layovers` | Airline names, flight numbers in order, one entry per flight with airports, times, duration and aircraft, and the layovers between them |
| `isTopFlight` | `true` if Google listed the option in the group it shows first |
| `returnFlightsStatus` | With Include return flights, on outbound rows: `delivered`, `none` (Google lists no return options), `failed` (including `unreadable`: Google lists 3 or more return options and none could be read), or `skipped` |
| `outboundRowId`, `outboundFlightNumbers`, `outboundDepartureDate` | On return rows: the outbound row (its `rowId`) and flight they were looked up for |
| `billable` | `true` for a charged row. `false` on an outbound row whose return options could not be read: it is delivered and not charged |
| `cabin`, `passengers`, `searchUrl`, `scrapedAt`, `rowId`, `searchIndex` | What was asked, the Google Flights link for the search, when the row was read, a stable id, and the position of the search in your list |

### Example

Input:

```json
{
  "searches": [
    { "from": "MCT", "to": "DXB", "departureDate": "2027-01-15" },
    { "from": "LHR", "to": "JFK", "departureDate": "2027-01-15", "returnDate": "2027-01-22" }
  ],
  "adults": 1,
  "cabin": "economy",
  "currency": "USD",
  "maxResults": 20
}
```

One output row (shortened; read on 22 Nov 2026 for a flight on 2026-12-19, so the dates differ from the input above):

```json
{
  "rowType": "flight",
  "searchFrom": "MCT",
  "searchTo": "DXB",
  "tripType": "one-way",
  "legType": "outbound",
  "departureDate": "2026-12-19",
  "departureTime": "20:25",
  "arrivalTime": "21:35",
  "durationMin": 70,
  "stops": 0,
  "price": 112,
  "currency": "USD",
  "priceBasis": "one-way fare",
  "airlines": ["Oman Air"],
  "flightNumbers": ["WY611"]
}
```

### Input

| Field | Meaning |
|---|---|
| `searches` | The searches, up to 50. Each: `from` and `to` (3-letter IATA airport or city codes such as MCT, DXB, LHR, NYC), optional `departureDate` and optional `returnDate`, written `YYYY-MM-DD` |
| `departureDate` left out | The search uses the day 28 days after the day the run starts. The prefill does this on purpose so it never goes stale |
| `returnDate` | Left out: one-way. Given: round trip |
| `adults`, `children` | 1 to 9 adults, 0 to 8 children, at most 9 together. Infants are not supported |
| `cabin` | economy, premium_economy, business, first |
| `stops` | any, nonstop, max1, max2 (Google's stops filter) |
| `currency` | One of 38 currency codes, default USD |
| `maxResults` | Flight rows delivered per search, 1 to 500, default 50. For a one-way search this is also the most you pay for that search. With Include return flights it caps the outbound rows, and every outbound can add up to `returnOptionsPerOutbound` return rows, so the most a search can cost is `maxResults` x (1 + `returnOptionsPerOutbound`) rows |
| `sortBy` | `price` (default, cheapest first), `duration`, or `google` (Google's order) |
| `includeUnpriced` | Default off, see below |
| `includeReturnFlights`, `returnOptionsPerOutbound` | Round trips only, see below |
| `requestGapSeconds` | Pause between two requests to Google, 0.8 to 10 seconds, default 2 (see "Limits and honest caveats") |

Dates must be real calendar days from today up to 320 days ahead. "Today" is the current day in UTC, so a user far west of UTC may see their own local today refused as in the past. 320 days is a cautious limit set by the actor, not a number Google publishes (our checks on 22 Nov 2026 found Google still answering for the busy route London to New York at 330 days, while Muscat to Dubai had no flights listed even at 320 days); airlines open their schedules at different times, so a date inside the window can still have no flights. A search with a bad entry (a code that is not three letters, a past date, a return before the departure) becomes a free `search_failed` row with the reason, and the other searches still run. If no search is usable the run stops with an input error that names the field.

### What the price means

Google's prices are totals for all travellers in the search, not per person (on 22 Nov 2026 the cheapest MCT to DXB option was 112 USD for one adult and 223 USD for two, so about twice).

- **One-way search:** `price` is the one-way fare.
- **Round-trip search, default:** you get the outbound options. `price` is the round-trip total with the cheapest return Google lists for that outbound (`priceBasis` says so). In the 10 outbound options we checked against their return lists (one Apify run on 22 Nov 2026), the outbound price equalled the cheapest return option's total.
- **Round trip with Include return flights:** for each delivered outbound the actor makes one more request with that outbound chosen, and delivers up to `returnOptionsPerOutbound` return flights. Their `price` is the round-trip total with that outbound (`legType` is `return`, `outboundFlightNumbers` names the outbound). Each outbound and each return row is one charged flight row, and the run needs one more request per outbound, so keep `maxResults` small for round trips.

Prices are what Google Flights showed when the row was read. They are not an offer and not a promise that you can book at that price, and they can differ from what an airline or travel agency charges at booking time.

### Options without a price

Google lists some options without a price (21 of 91 on one DXB to BOM search we saved). By default these are left out: they are not delivered and not charged, and the run summary counts them in `droppedUnpriced`. Turn on `includeUnpriced` to get them with `priceAvailable: false` and `price: null`; they come after the priced rows when sorting by price and are charged like any other row. Options Google lists without complete times or flight numbers cannot be turned into a row and are left out too (`droppedIncomplete` in the summary).

### Searches with no flights, and searches that fail

- **No flights** is a valid answer. If Google lists no flights for the route and date (for example no service that day) or does not know a code, the search gets one free `no_flights` row with the reason. It is not an error and not charged. Before the actor accepts an answer as "no flights" it looks through the whole data block for flight-like entries; if it finds some in a place it does not read, the search is reported as `unreadable`. If Google changed its format in a way that hides the flights completely, that would still look like "no flights", so a run in which every search says "no flights" for routes that normally have flights deserves a look.
- **Retries.** Google's flight backend often answers a normal-looking page that contains an error instead of flights. We measured this on Apify on 22 Nov 2026: 18 of 43 requests in three first test runs, then in three runs of the same round-trip search with return flights, 28 of 49 requests at a 0.8 second gap, 15 of 37 at 2 seconds and 11 of 25 at 3 seconds. So expect roughly 4 in 10 requests to be answered with an error first. The actor retries such a request, and also 429, 5xx and other failed HTTP answers (but not a consent, CAPTCHA or 403 answer) and network errors, up to 4 more times with growing waits (about 1.5, 4, 9 and 15 seconds). In our four later test runs, 11 of 12 first searches succeeded within the retries; 1 of 12 failed after all 5 attempts (see the next point). The errors cluster: one route needed 5, 3, 5 (failed) and 3 attempts in those four runs.
- **A search that stays failed** (in one of our three gap test runs, one of three searches failed after all 5 attempts) gets one free `search_failed` row with `errorKind`, a plain-language `error` and `attempts`. A search that fails is reported as failed, not as "no flights". If every search of a run fails, the run itself ends as failed.
- **Refusals and a stop rule.** If Google answers with a cookie consent page, a CAPTCHA or a 403, the actor does not retry, sends no cookies and does not try to solve anything. A 429 is retried like other failures. When three searches (or return lookups) in a row still fail after all their retries, whatever the cause, the run stops asking: the remaining searches get free `search_failed` rows with `errorKind` `skipped_blocked`, and no further request is sent. A success resets the count. No retry starts after the 40 minute run time budget; a request that is already waiting for its gap or running can finish later, in the worst case about one request gap plus 45 seconds (we measured 50 seconds).

### Pricing

Pay per event: **$0.0005 per delivered flight row ($0.50 per 1,000)**, one event per row. No fee per run and none per search. Free rows (`no_flights`, `search_failed`), options left out for having no price, outbound rows whose return options could not be read (`billable: false`) and rows an earlier attempt of the same run already delivered are not charged. Rows are saved to the dataset first and charged afterwards, so a failed save is never charged. Set a maximum charge on the run and the actor delivers and charges only as many rows as the limit allows, never one more: it counts the rows left in your budget before every batch. Searches not read after that are marked `skipped_charge_limit`. If a run is restarted by the platform, rows already in the dataset are neither delivered nor charged again, and `maxResults` counts them, so a restart never delivers more than `maxResults` rows for a search (and `returnOptionsPerOutbound` return rows for an outbound). The Apify platform usage of the run is not billed on top.

### Limits and honest caveats

- **Google can change its page at any time.** The actor reads fixed positions in an undocumented data block of the page. It has three safety checks, and only these three. (0) Dropped options: if Google lists 3 or more options and every one of them is dropped (no price, or incomplete data), in the first request of a search or in a return lookup, the search (or that outbound's return lookup) is reported as a free `search_failed` row with `errorKind` `unreadable`, not as "no flights", and it counts toward the stop rule below. This also happens when a real answer has 3 or more options and none shows a price; turn on `includeUnpriced` to get those without a price. The price part of this check does not apply when `includeUnpriced` is on (options with incomplete times or flight numbers are still caught): if Google then moved the price field, the rows are delivered with `price: null` and charged like any other row, so watch `priceAvailable` in your data. (1) Shape: if the page or the flight lists do not have the expected shape, the search is reported as `unreadable` or `no_data_block`. (2) Durations: for every option, the minutes of its flights plus the minutes of its layovers must add up to the total duration Google gives. If that fails for more than 1 in 10 of the options of an answer, or if the minutes are missing for every option of a group (at least 3 options), the search is reported as `unreadable`. Answers with fewer than 3 options are not judged by this check. Nothing checks that prices, times or airline names are in the right place, and a few options with wrong durations (up to 1 in 10) are delivered and only counted in `durationMismatches` of the run summary. A Google change that keeps durations consistent and the shape intact would go unnoticed, so spot-check your data. The actor then needs an update; there is no uptime promise.
- **Prices and availability change** between runs and within a day.
- **Outbound options for round trips, return options only on request** (see above). Multi-city trips, flexible dates, price calendars and booking links are not covered.
- **Each row is a snapshot of the moment it was read.** No booking, no seat or fare-rule data, no baggage prices.
- **Where the request comes from matters.** Google shows different lists depending on the address of the request. The results are what Google shows to Apify's servers (US addresses in our tests), not to your browser at home: for MCT to DXB we got 15 options from a home address in Oman and 65 to 69 from Apify, and prices can differ too. The currency and two-adult checks in the evidence files were made from a home address, not from Apify.
- **Infants are not supported.** Children are searched as child passengers; we did not verify the child fares Google returns.
- **Currency.** Google priced in the requested currency for each of the 38 codes on the list when we checked on 22 Nov 2026 (38 of 38). If Google ever answers in another currency, each row says which, and the summary counts those rows (a code that is not on the list is refused).
- **Run time and the request gap.** Requests are spaced 2 seconds apart by default; `requestGapSeconds` sets it from 0.8 to 10. We measured Google's error answers on Apify on 22 Nov 2026 with round-trip searches that also look up return flights: at a 0.8 second gap 28 of 49 requests (57%), at 2 seconds 44 of 100 (44%, two runs), at 3 seconds 11 of 25 (44%, and one of three searches failed after all retries). A longer pause seems to help a little, 3 seconds no more than 2; these are small samples, so the pause does not remove the errors, it only makes them somewhat rarer. From one home address outside Apify, 45 requests at 2 seconds got no error answer, so the rate depends on where the request comes from. Return-flight lookups are about 1 request per outbound option, so a round trip with return flights takes many more requests than a one-way search: 119 rows (3 round-trip searches, 10 outbounds each, 3 returns each) took 4 minutes. A run stops reading new searches after 40 minutes and marks the rest `skipped_time_budget`; in return-flight mode the outbound options not yet looked up are left out (free).

### Data handling

The actor sends requests only to `www.google.com`, built from the airport codes, dates and options in your input. It takes no URL as input, so you cannot make it fetch another address. It sends no cookies, signs in nowhere, uses no proxy and no browser. It collects only the flight options Google shows publicly; it asks for and stores no personal data. Input and output stay in your Apify account. It is your responsibility to use the data in line with Google's terms and the law that applies to you.

### Not affiliated

This actor is an independent tool. It is not affiliated with, endorsed by or sponsored by Google or any airline. Google Flights is a Google product; airline and airport names belong to their owners.

# Actor input Schema

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

One entry per search: {"from": "MCT", "to": "DXB", "departureDate": "2027-01-15", "returnDate": "2027-01-22"}. from and to are 3-letter IATA airport or city codes (MCT, DXB, LHR, NYC). departureDate is optional: left out, the search uses the day 28 days after the run starts, so the prefill never goes stale. returnDate is optional: left out, the search is one-way. Dates are written YYYY-MM-DD, from today up to 320 days ahead. Up to 50 searches per run. A bad entry becomes a free search_failed row and the other searches still run.

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

Number of adult travellers, 1 to 9. Prices are Google's totals for all travellers together, not per person. Adults plus children are at most 9.

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

Number of child travellers, 0 to 8, searched as child passengers; the fares Google returns for children are not verified. Infants are not supported.

## `cabin` (type: `string`):

Cabin class asked for.

## `stops` (type: `string`):

Google's stops filter. Any: no filter. Nonstop: only flights without a stop. Up to 1 stop and up to 2 stops: Google's filters of that name.

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

Currency Google prices in. Each row carries the currency Google reported for its price; the run summary counts rows where it differs from this setting.

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

How many flight rows are delivered per search, 1 to 500, after sorting. Google lists from a few to a few hundred options for a route. You pay per delivered row. For a one-way search this is your cost cap per search; with Include return flights it caps the outbound rows and each outbound can add up to Return options per outbound return rows.

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

Which options are kept when there are more than Max flights per search, and the order they are delivered in. Price: cheapest first. Duration: shortest first. Google: Google's own order (its top group first).

## `includeUnpriced` (type: `boolean`):

Google lists some options with no price. Off: they are left out, not delivered and not charged. On: they are delivered with priceAvailable false and price null, after the priced ones, and charged like any other row. With this on, a Google change that hides every price is not caught as an unreadable answer: you receive rows with a null price, and they are charged.

## `includeReturnFlights` (type: `boolean`):

Only for searches with a returnDate. Off: you get the outbound options, each priced as the cheapest round trip Google lists for it. On: for every delivered outbound option the actor makes one more request with that outbound chosen and delivers up to Return options per outbound return flights, each priced as the round-trip total with that outbound. Every outbound and return row is charged as one flight row, and the run takes one extra request per outbound.

## `returnOptionsPerOutbound` (type: `integer`):

With Include return flights: how many return flights are delivered for each outbound, 1 to 10, by the Sort setting.

## `requestGapSeconds` (type: `number`):

Pause between two requests to Google, 0.8 to 10 seconds, default 2. In our test on 22 Nov 2026 Google answered with an error for 57% of requests at a 0.8 second pause and 44% at 2 or 3 seconds (small samples). The pause only makes errors somewhat rarer; failed requests are retried either way.

## Actor input object example

```json
{
  "searches": [
    {
      "from": "MCT",
      "to": "DXB"
    },
    {
      "from": "LHR",
      "to": "JFK"
    },
    {
      "from": "DXB",
      "to": "BOM"
    }
  ],
  "adults": 1,
  "children": 0,
  "cabin": "economy",
  "stops": "any",
  "currency": "USD",
  "maxResults": 20,
  "sortBy": "price",
  "includeUnpriced": false,
  "includeReturnFlights": false,
  "returnOptionsPerOutbound": 3,
  "requestGapSeconds": 2
}
```

# Actor output Schema

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

Table of flight rows and the free status rows.

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

Per search: status, attempts, rows delivered; and run totals: rows delivered and charged, options left out, failed and skipped searches, retries.

# 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": [
        {
            "from": "MCT",
            "to": "DXB"
        },
        {
            "from": "LHR",
            "to": "JFK"
        },
        {
            "from": "DXB",
            "to": "BOM"
        }
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("leadharbor/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": [
        {
            "from": "MCT",
            "to": "DXB",
        },
        {
            "from": "LHR",
            "to": "JFK",
        },
        {
            "from": "DXB",
            "to": "BOM",
        },
    ],
    "maxResults": 20,
}

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

```

## MCP server setup

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