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

Scrapes Google Flights for any origin/destination. Extracts airline, flight numbers, airports, departure/arrival times, duration, stops, price, cabin class, booking site, emissions, aircraft, and more.

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

## Pricing

from $1.99 / 1,000 google flights scraper 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Flights Scraper

Scrapes Google Flights for any origin/destination. Extracts airline, flight numbers, airports, departure/arrival times, duration, stops, price, cabin class, booking site, emissions, aircraft, and more.

### What this Actor collects

The Actor converts Google Flights results into one clean JSON record per itinerary option, including route and segments, airlines and flight numbers, departure and arrival times, duration, stops, cabin, fare, emissions, aircraft, and booking metadata when available.

- Uses the input limits and filters below to control the crawl.
- Stores source-backed fields defined by the 52-field dataset schema.
- Omits optional fields when the source does not expose a value instead of writing nulls or fabricated placeholders.

### Use cases

- Fare and route monitoring
- Travel research
- Schedule comparison

### Input

Provide input in JSON. Fields marked required must be supplied. The Default / example column shows a schema default when one exists; otherwise it shows a documented prefill or fixture value.

| Field | Type | Required | Default / example | Description |
| --- | --- | :---: | --- | --- |
| `departure` | string | Yes | `"JFK"` | Departure airport IATA code (e.g. JFK, LAX, ORD) |
| `arrival` | string | Yes | `"LAX"` | Arrival airport IATA code (e.g. LAX, SFO, LHR) |
| `departureDate` | string | Yes | `"2026-09-15"` | Departure date in YYYY-MM-DD format |
| `returnDate` | string | No | — | Return date in YYYY-MM-DD format (required for round-trip) |
| `tripType` | string | No | `"one-way"` | Type of trip |
| `passengers` | integer | No | `1` | Number of passengers |
| `cabinClass` | string | No | `"economy"` | Cabin class preference |
| `maxItems` | integer | No | `20` | Maximum number of flight results to scrape |
| `gl` | string | No | `"us"` | Two-letter Google country code used to localize results |
| `hl` | string | No | `"en"` | Google interface language code |
| `proxyConfiguration` | object | No | `{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]}` | Proxy configuration for the scraper |

#### Example input

```json
{
  "departure": "JFK",
  "arrival": "LAX",
  "departureDate": "2026-09-15",
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "tripType": "one-way",
  "passengers": 1,
  "cabinClass": "economy",
  "gl": "us"
}
```

### Output

The default dataset contains one item per flight itinerary or fare option. The following are the most useful fields; aircraft, emissions, amenities, booking, and return-trip fields depend on the itinerary and source response.

| Field | Type | Description |
| --- | --- | --- |
| `position` | integer | Position |
| `airline` | string | Airline |
| `flightNumber` | string | Flight Number |
| `origin` | string | Origin |
| `destination` | string | Destination |
| `departureTime` | string | Departure Time |
| `arrivalTime` | string | Arrival Time |
| `duration` | string | Duration |
| `stops` | string | Stops |
| `price` | string | Price |
| `emissions` | string | Emissions |
| `baggage` | string | Baggage Allowance |
| `departureDate` | string | Departure Date |
| `scrapedAt` | string | Scraped At |
| `type` | string | Type |
| `title` | string | Title |

<details>
<summary>All 52 declared dataset fields</summary>

`type`, `resultType`, `position`, `title`, `airline`, `airlines`, `airlineCode`, `airlineLogo`, `flightNumber`, `flightNumbers`
`flightId`, `origin`, `originCode`, `destination`, `destinationCode`, `departureAt`, `departureAtRaw`, `departureTime`, `arrivalAt`, `arrivalAtRaw`
`arrivalTime`, `duration`, `durationMinutes`, `stops`, `stopsNumeric`, `stopAirports`, `layoverDurations`, `price`, `originalPrice`, `priceNumeric`
`currency`, `emissions`, `emissionsGrams`, `cabin`, `cabinClass`, `travelClass`, `baggage`, `passengers`, `tripType`, `departure`
`arrival`, `departureDate`, `returnDate`, `searchQuery`, `query`, `searchUrl`, `url`, `link`, `bookingSite`, `bookingSiteUrl`
`scrapedAt`, `searchMetadata`

</details>

#### Example dataset item

This compact example is taken from local Actor storage. Long text and nested collections are shortened for documentation only.

```json
{
  "position": 1,
  "airline": "JetBlue",
  "flightNumber": "B6323",
  "origin": "JFK",
  "destination": "LAX",
  "departureTime": "8:05 AM",
  "arrivalTime": "11:08 AM",
  "duration": "6 hr 3 min",
  "stops": "Nonstop",
  "price": "$184",
  "emissions": "418 kg CO2e",
  "baggage": "1 carry-on bag included. 0 checked bags included. Learn more about baggage allowance"
}
```

### Related Actors

- [Google About This Result Scraper](https://apify.com/searchapi/google-about-this-result-scraper)
- [Google AI Overview Scraper](https://apify.com/searchapi/google-ai-overview-scraper)
- [Google Autocomplete Scraper](https://apify.com/searchapi/google-autocomplete-scraper)

# Actor input Schema

## `departure` (type: `string`):

Departure airport IATA code (e.g. JFK, LAX, ORD)

## `arrival` (type: `string`):

Arrival airport IATA code (e.g. LAX, SFO, LHR)

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

Departure date in YYYY-MM-DD format

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

Return date in YYYY-MM-DD format (required for round-trip)

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

Type of trip

## `passengers` (type: `integer`):

Number of passengers

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

Cabin class preference

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

Maximum number of flight results to scrape

## `gl` (type: `string`):

Two-letter Google country code used to localize results

## `hl` (type: `string`):

Google interface language code

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

Proxy configuration for the scraper

## Actor input object example

```json
{
  "departure": "JFK",
  "arrival": "LAX",
  "departureDate": "2026-09-15",
  "tripType": "one-way",
  "passengers": 1,
  "cabinClass": "economy",
  "maxItems": 20,
  "gl": "us",
  "hl": "en",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Structured Google Travel flight itineraries with route, schedule, airline, price, stops, emissions, baggage, and search provenance.

## `debugHtml` (type: `string`):

HTML snapshot retained when flight extraction needs diagnostic context.

## `calendarState` (type: `string`):

PNG screenshot captured while resolving flight calendar state.

# 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 = {
    "departure": "JFK",
    "arrival": "LAX",
    "departureDate": "2026-09-15",
    "tripType": "one-way",
    "passengers": 1,
    "cabinClass": "economy",
    "maxItems": 20,
    "gl": "us",
    "hl": "en",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/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 = {
    "departure": "JFK",
    "arrival": "LAX",
    "departureDate": "2026-09-15",
    "tripType": "one-way",
    "passengers": 1,
    "cabinClass": "economy",
    "maxItems": 20,
    "gl": "us",
    "hl": "en",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/google-flights-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "departure": "JFK",
  "arrival": "LAX",
  "departureDate": "2026-09-15",
  "tripType": "one-way",
  "passengers": 1,
  "cabinClass": "economy",
  "maxItems": 20,
  "gl": "us",
  "hl": "en",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call searchapi/google-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=searchapi/google-flights-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/T1cLaLgbTlUxI80OC/builds/H4rmpguzTRM9wnkW0/openapi.json
