# Google Flights Scraper — Fares, Schedules, Segments & CO2 (`trakk/google-flights-fares-scraper`) Actor

Scrape Google Flights for any route, no login. Fares, airlines, stops, full per-segment itineraries, layovers, aircraft, legroom, CO2 emissions vs typical, baggage, price history and booking links. One-way and round-trip, price per passenger, cabin and airline filters. Clean table, CSV/JSON.

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

## Pricing

from $0.75 / 1,000 google flights results

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 — Fares, Schedules, Segments & CO₂

Scrape **Google Flights** for any route and get back clean, structured data: fares, airlines, stops, full per-segment itineraries, layovers, aircraft, legroom, CO₂ emissions, baggage, price history and booking links. Works for **one-way and round-trip** searches, no login required.

### What you get

Every flight option is one row with:

- **Price** — total price, **price per passenger**, currency
- **Route** — origin / destination (codes + names), departure and arrival local times, trip type
- **Airlines** — airline names and codes, flight numbers, budget-carrier flag
- **Itinerary** — stop count, total duration, **per-segment details** (each leg: from/to, times, duration, airline, flight number, aircraft, legroom, CO₂), and **layovers** (airport + wait time)
- **CO₂** — grams, typical grams for the route, **difference vs typical** and a human label (e.g. “18% lower than typical”)
- **Price history** — the low/high of Google’s price trend for the route
- **Baggage & booking** — baggage policy links, carrier support links, booking token and a direct Google Flights URL
- Plus `cabin`, `passengers`, `resultCategory` (best vs other), `isCompleteItinerary`, and a stable `flightId`

### Input

```json
{
  "flightSearches": [
    { "origin": "JFK", "destination": "LAX", "departureDate": "2026-11-20", "returnDate": "2026-11-27" }
  ],
  "cabin": "economy",
  "flightSort": "best",
  "maxFlightResults": 50,
  "maxStops": 2,
  "adults": 1,
  "currency": "USD",
  "countryCode": "US",
  "language": "en-US"
}
```

- **flightSearches** — one or more routes. Add `returnDate` for round-trip; omit it for one-way.
- **cabin** — `economy`, `premium-economy`, `business`, `first`.
- **flightSort** — `best`, `cheapest`, `fastest`, `departure`, `arrival`.
- **maxStops** — `0` (nonstop), `1`, or `2`.
- **airlines** — optional filter by two-letter airline code (e.g. `DL`) or alliance (`ONEWORLD`, `SKYTEAM`, `STAR_ALLIANCE`).
- **adults / children / infantsInSeat / infantsOnLap** — up to 9 passengers total.
- **currency / countryCode / language** — localization for prices and results.

### Output

Results are written to the dataset, one row per flight option, and can be exported to **CSV, Excel, JSON or API**. The **Flights** table view shows the key columns (price, airlines, stops, duration, CO₂, booking link); the full field set is available in every row.

### Pricing

Pay per result — you are charged only for flight options actually saved to your dataset. Duplicates are never charged twice. See the Pricing tab for the current per-result price.

### Common uses

- **Fare monitoring** — track prices on routes over time (price + price history in every row).
- **Travel tools & agencies** — power search results with structured fares and full itineraries.
- **Sustainability** — compare CO₂ emissions across options with the typical-vs-actual label.
- **Market research** — airline coverage, nonstop availability and price levels by route.

# Actor input Schema

## `flightSearches` (type: `array`):

One-way or round-trip searches. Use three-letter airport or metro codes and YYYY-MM-DD dates.

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

Cabin class requested from Google Flights.

## `flightSort` (type: `string`):

Order saved flight cards by Google's best order, price, duration, departure, or arrival.

## `maxFlightResults` (type: `integer`):

Maximum saved options across the requested flight searches.

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

Allow nonstop only, at most one stop, or at most two stops.

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

Adult passengers; at least one is required.

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

Child passengers with their own seat.

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

Infants traveling in their own seat.

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

Lap infants; cannot exceed the number of adults.

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

Optional two-letter carrier codes, one per line.

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

Currency requested from Google Flights. Maps and Ads do not convert monetary values.

## `countryCode` (type: `string`):

Google market used for localized Flights and Maps results.

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

Language requested from Google Flights and Maps. Source names and user-written reviews can still remain in their original language.

## `maxConcurrency` (type: `integer`):

The default is tuned for the 1 GB performance target.

## `maxRetries` (type: `integer`):

Retries for temporary source, network, or throttling failures.

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

Maximum time allowed for one source request before retrying.

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

Residential country routing is used by default on Apify. Change this only when you understand the trade-off.

## Actor input object example

```json
{
  "flightSearches": [
    {
      "origin": "JFK",
      "destination": "LAX",
      "departureDate": "2030-09-15"
    }
  ],
  "cabin": "economy",
  "flightSort": "best",
  "maxFlightResults": 50,
  "maxStops": 2,
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "airlines": [],
  "currency": "USD",
  "countryCode": "US",
  "language": "en-US",
  "maxConcurrency": 16,
  "maxRetries": 3,
  "requestTimeoutSecs": 25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `flights` (type: `string`):

No description

## `maps` (type: `string`):

No description

## `ads` (type: `string`):

No description

## `contactsAndReviews` (type: `string`):

No description

## `runSummary` (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 = {
    "flightSearches": [
        {
            "origin": "JFK",
            "destination": "LAX",
            "departureDate": "2030-09-15"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("trakk/google-flights-fares-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 = { "flightSearches": [{
            "origin": "JFK",
            "destination": "LAX",
            "departureDate": "2030-09-15",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("trakk/google-flights-fares-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 '{
  "flightSearches": [
    {
      "origin": "JFK",
      "destination": "LAX",
      "departureDate": "2030-09-15"
    }
  ]
}' |
apify call trakk/google-flights-fares-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,trakk/google-flights-fares-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/3tTLKl76B43fIcYSh/builds/JONNnjRykuc8vKqeD/openapi.json
