# Google Flights Scraper: Prices, Airlines, Stops & CO2 (`ksvan/google-flights-scraper`) Actor

Flight prices from Google Flights for any route and dates: price, airlines, flight numbers, times, stops, layovers, aircraft, legroom, CO2 and Google's price level. One-way or round trip, any cabin, scan many dates at once. Fast HTTP, no browser.

- **URL**: https://apify.com/ksvan/google-flights-scraper.md
- **Developed by:** [K.S. Van](https://apify.com/ksvan) (community)
- **Categories:** Travel, AI, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 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: Prices, Airlines, Stops & CO2

Get **flight prices from Google Flights** for any route and dates. Each flight option comes with the **price**, airlines, **flight numbers**, departure and arrival times, duration, **stops and layovers**, aircraft type, **legroom**, CO2 emissions and Google's **price level** for the route (low, typical or high, with the typical price range). One-way or round trip, economy to first class, several passengers, and **many dates in one run** to find the cheapest day to fly. Fast HTTP requests, no browser.

### What you get

| Field | Details |
|---|---|
| Price | Total price in USD for all passengers (whole trip for round trips) |
| Flight | Airlines, flight numbers, departure and arrival time, total duration |
| Stops | Number of stops, layover airports and layover length |
| Segments | Every leg with aircraft, legroom, times and CO2 |
| Labels | `isBest` (Google's top flights), `isCheapest` for the search |
| Price insights | `priceLevel` (low / typical / high), typical price range, optional 60-day price history |
| Emissions | CO2 of the flight, typical CO2 for the route, % difference |

### Use cases

- **Fare monitoring and alerts**: run daily on your routes and catch drops when `priceLevel` turns "low".
- **Cheapest day to fly**: scan 7-60 departure dates at once with **Days to scan**.
- **Travel deal newsletters and apps**: compare many origins and destinations in one run.
- **Airline and route analysis**: who flies a route, how often, nonstop share, aircraft and legroom.
- **Corporate travel and CO2 reporting**: emissions per flight and per route.
- **AI travel agents**: live flight data through the Apify MCP server.

### Input example

```json
{
  "origins": ["JFK"],
  "destinations": ["LAX", "LON"],
  "departureDate": "2026-11-20",
  "returnDate": "",
  "daysToScan": 3,
  "adults": 1,
  "cabinClass": "economy",
  "maxStops": "any",
  "maxFlightsPerSearch": 40
}
```

Codes can be airports (`JFK`, `LHR`, `CDG`) or cities covering all their airports (`NYC`, `LON`, `PAR`, `TYO`).

### Output example

```json
{
  "origin": "JFK",
  "destination": "LON",
  "departureDate": "2026-11-21",
  "tripType": "one_way",
  "cabinClass": "economy",
  "currency": "USD",
  "price": 323,
  "isBest": false,
  "isCheapest": true,
  "airlines": ["Aer Lingus"],
  "from": "JFK",
  "to": "LHR",
  "departure": "2026-11-21 17:00",
  "arrival": "2026-11-22 08:05",
  "durationMinutes": 605,
  "stops": 1,
  "layovers": [{"airport": "DUB", "airportName": "Dublin Airport", "city": "Dublin", "durationMinutes": 130}],
  "co2Grams": 395000,
  "co2TypicalGrams": 433000,
  "co2DiffPercent": -9,
  "segments": [
    {"airline": "Aer Lingus", "flightNumber": "EI 104", "from": "JFK", "to": "DUB", "departure": "2026-11-21 17:00", "arrival": "2026-11-22 04:30", "durationMinutes": 390, "aircraft": "Airbus A330", "legroom": "31 inches"},
    {"airline": "Aer Lingus", "flightNumber": "EI 152", "from": "DUB", "to": "LHR", "departure": "2026-11-22 06:40", "arrival": "2026-11-22 08:05", "durationMinutes": 85, "aircraft": "Airbus A320neo", "legroom": "29 inches"}
  ],
  "priceLevel": "high",
  "typicalPriceLow": 170,
  "typicalPriceHigh": 300,
  "url": "https://www.google.com/travel/flights/search?tfs=..."
}
```

### Pricing

**$0.001 per flight option** ($1 per 1,000 flights), no start fee. Searches that return nothing are free. A typical route and date returns 20-35 options, so one search costs about $0.03. Set **Max flights per search** to 1-5 if you only need the best and cheapest options.

### Tips

- **Round trips**: the price is for the whole trip and the rows are the outbound flights Google offers with it, exactly like the first screen of Google Flights.
- **Several origins and destinations** are combined: 2 origins x 3 destinations x 7 days = 42 searches.
- Times are local times at each airport. Durations are in minutes.
- `priceLevel` and the typical range come from Google's price insights and are missing for some routes.

### FAQ

**Which currency are prices in?** US dollars, as shown on Google Flights in the US.

**Can I book through the data?** The `url` opens the same search on Google Flights, where you can pick the flight and see booking options.

**How fresh are the prices?** Live: every run searches Google Flights at that moment.

# Actor input Schema

## `origins` (type: `array`):

3-letter IATA airport codes (JFK, LHR) or city codes for all airports of a city (NYC, LON, PAR). Several origins = every combination with the destinations.

## `destinations` (type: `array`):

3-letter IATA airport or city codes.

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

YYYY-MM-DD. Empty = 30 days from today.

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

YYYY-MM-DD. Empty = one-way. For round trips, prices are for the whole trip and the flights listed are the outbound options.

## `daysToScan` (type: `integer`):

Search this many consecutive departure dates (the return date moves with it). Use 7-30 to find the cheapest day to fly.

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

Adult passengers. Prices are totals for all passengers.

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

Child passengers.

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

Travel class.

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

Maximum number of stops.

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

Google lists up to about 100 flights per route and date. Set 1-5 to get only the best and cheapest options.

## `includePriceHistory` (type: `boolean`):

Add Google's 60-day price history of the route (when available) to every row.

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

Parallel searches.

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

Apify Proxy (datacenter) works well.

## Actor input object example

```json
{
  "origins": [
    "JFK"
  ],
  "destinations": [
    "LAX",
    "LON"
  ],
  "departureDate": "",
  "returnDate": "",
  "daysToScan": 1,
  "adults": 1,
  "children": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "maxFlightsPerSearch": 50,
  "includePriceHistory": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One record per flight option.

# 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 = {
    "origins": [
        "JFK"
    ],
    "destinations": [
        "LAX",
        "LON"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ksvan/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 = {
    "origins": ["JFK"],
    "destinations": [
        "LAX",
        "LON",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("ksvan/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 '{
  "origins": [
    "JFK"
  ],
  "destinations": [
    "LAX",
    "LON"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call ksvan/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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