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

Collects public Google Flights itinerary and optional expanded segment details without bypassing access controls.

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

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

Search public Google Flights itineraries by route, travel dates, cabin, and passenger count. The dataset contains one record per itinerary shown in the results.

### Input

- **origin / destination**: Airport codes or names; defaults to JFK and LAX.
- **departureDate**: Departure date in YYYY-MM-DD format.
- **returnDate**: Optional return date.
- **tripType**: One-way or round-trip search; defaults to round trip.
- **cabin**: Requested seating class; defaults to economy.
- **adults**: Number of adult passengers; defaults to 1.
- **queries / searches**: Multiple route searches. Structured searches can override the top-level route fields.
- **startUrls**: Public Google Flights URLs.
- **maxItems**: Maximum itineraries across the run; defaults to 25.
- **maxPages**: Maximum result-list snapshots per source; defaults to 3.
- **includeFlightDetails**: Open public itinerary details for flight numbers, aircraft, amenities, emissions, and related information; off by default.
- **maxFlightDetails**: Maximum itinerary detail panels to open; defaults to 5.
- **currency / country / language**: Display currency and regional language settings.
- **renderJavaScript**: Use browser rendering for public flight results; enabled by default. Structured route searches use the browser.

### Dataset

Each record represents one itinerary and can include:

- **Route and timing**: Origin and destination, departure/arrival times and dates, total duration, stops, connection airports, and layovers.
- **Airline and legs**: Airline, operating airline, flight numbers, aircraft, and segment details when available.
- **Price and fare**: `price` and `priceCurrency`, price scope, fare details, and baggage allowances.
- **Travel conditions**: Emissions estimate and comparison, contrail warming category, legroom, amenities, and delay notes.

Price and itinerary details reflect what Google Flights displays and may change. A displayed round-trip price does not mean the dataset contains a paired return itinerary record.

### Results and limits

maxItems caps itineraries across the run. maxPages bounds result-list snapshots. Additional flight information is available when includeFlightDetails is enabled.

Run output provides a dataset link, run counts, and run health information.

### Responsible use

This Actor reads public Google Flights information. Prices and availability can change. Follow Google's terms and applicable law when using the results. This independent Actor is not affiliated with or endorsed by Google.

# Actor input Schema

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

IATA code or airport name used with the route fields.

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

IATA code or airport name used with the route fields.

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

Departure date in YYYY-MM-DD format.

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

Optional return date in YYYY-MM-DD format. When supplied, price is labelled as a round-trip total only if Google says so.

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

Requested trip type for browser form searches.

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

Requested seating class for browser form searches.

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

Number of adult passengers.

## `queries` (type: `array`):

Route strings such as JFK-LAX 2026-10-17 2026-10-24.

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

Structured route searches. Each object may override the top-level route fields.

## `startUrls` (type: `array`):

Public Google Flights landing or search URLs. Only google.com/travel/flights URLs are accepted.

## `maxItems` (type: `integer`):

Maximum number of valid public itinerary records written to the dataset.

## `page` (type: `integer`):

Google Flights exposes a scrollable result list rather than numbered pages; this compatibility field remains fixed at 1. Use maxPages to bound browser scrolling.

## `maxPages` (type: `integer`):

Maximum result-list snapshots per source when browser rendering is active, including the initial list and subsequent bounded scrolls. Stops sooner when no new itinerary appears or maxItems is reached.

## `renderJavaScript` (type: `boolean`):

Use a normal Playwright Chromium page for public URL searches when direct HTML does not contain itinerary cards. Structured route searches always use the browser to submit the requested route.

## `includeFlightDetails` (type: `boolean`):

In the browser-rendered page, open a bounded number of public Flight details panels to collect per-leg flight number, aircraft, legroom, amenities, emissions, and contrail data when shown. Does not bypass access controls.

## `maxFlightDetails` (type: `integer`):

Maximum number of visible Flight details panels to expand when includeFlightDetails is enabled.

## `browserWaitMs` (type: `integer`):

Bounded wait for public results and details to render.

## `requestTimeoutSecs` (type: `integer`):

Maximum time for each direct or browser request.

## `maxRequestRetries` (type: `integer`):

Bounded retries for transient direct requests. Access-control responses are not retried or bypassed.

## `requestDelayMs` (type: `integer`):

Optional delay between sources.

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

Google Flights display currency code.

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

Two-letter Google country setting.

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

Google language setting.

## `acceptLanguage` (type: `string`):

Language preference sent with public Google Flights requests.

## `userAgent` (type: `string`):

Optional ordinary user-agent string. Browser stealth or fingerprint evasion is not used.

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

Accepted for Apify input compatibility. This Actor currently makes direct public requests and does not route traffic through this setting.

## Actor input object example

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "2026-10-17",
  "returnDate": "2026-10-24",
  "tripType": "round_trip",
  "cabin": "economy",
  "adults": 1,
  "maxItems": 25,
  "page": 1,
  "maxPages": 3,
  "renderJavaScript": true,
  "includeFlightDetails": false,
  "maxFlightDetails": 5,
  "browserWaitMs": 4000,
  "requestTimeoutSecs": 25,
  "maxRequestRetries": 1,
  "requestDelayMs": 1000,
  "currency": "USD",
  "country": "us",
  "language": "en",
  "acceptLanguage": "en-US,en;q=0.8"
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

## `outputCounts` (type: `string`):

No description

## `runHealth` (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 = {};

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

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

```

## MCP server setup

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