# Google Flights Scraper — Prices & Carbon Emissions (`inexhaustible_glass/google-flights-scraper`) Actor

Search Google Flights: one-way, round-trip, multi-city. Real prices, airline/plane-type detail, and per-flight carbon-emission data. Deep filters: departure/arrival hour windows, layover duration, connecting airports, less-emissions-only. No API key, no browser.

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

## Pricing

from $4.00 / 1,000 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 — Prices, Schedules & Carbon Emissions

Search **Google Flights** for one-way, round-trip and multi-city itineraries — real-time prices, full per-leg detail (airline, airport, plane type, exact times), and **per-flight carbon-emission data**, which no other Google Flights Actor on Apify currently returns. No API key, no login, no headless browser — reads Google's own flight-search data directly, so it's fast and doesn't break when the search-results page gets a visual redesign.

> **Keywords:** google flights api, flight scraper, flight price tracker, carbon emissions flight data, round trip flight search, multi-city flights, flight price monitoring, travel data api.

### 🌟 Why this one

- **Carbon emissions on every flight** — `carbon_emission_grams` + `carbon_typical_on_route_grams` per result, so you can flag greener options. Not offered by the current top Google Flights Actors on Apify.
- **Plane type per leg** (e.g. "Boeing 737", "Airbus A350") — useful for seat-comfort or aircraft-based filtering, also not in competing Actors' output.
- **Deeper filters than any other Google Flights Actor here**: departure/arrival hour windows, min/max layover minutes, specific connecting airports, max total duration, less-emissions-only — on top of the usual price/stops/airline/cabin filters.
- **No browser** — talks to the same backend Google Flights' own web app uses, directly. Faster, cheaper to run, and nothing to time out waiting for a page to render.
- **Round-trip done honestly**: Google's own API only itemizes one direction at a time for round trips — rather than hand you a half-detailed row, this Actor runs outbound and return as two full searches and tags each row `leg_direction: outbound` / `return`, so every row has complete per-leg detail.

### 📥 Input

Quick search:

```json
{ "fromAirport": "DEL", "toAirport": "BOM", "date": "2026-12-01", "tripType": "one-way" }
```

Round-trip:

```json
{ "fromAirport": "JFK", "toAirport": "LHR", "date": "2026-12-01", "returnDate": "2026-12-08", "tripType": "round-trip", "adults": 2 }
```

Bulk / multi-city, via `flightSearches`:

```json
{
  "flightSearches": [
    { "fromAirport": "LAX", "toAirport": "JFK", "date": "2026-12-01", "tripType": "one-way" },
    { "tripType": "multi-city", "legs": [
        { "fromAirport": "CDG", "toAirport": "FCO", "date": "2026-12-01" },
        { "fromAirport": "FCO", "toAirport": "CDG", "date": "2026-12-08" }
    ]}
  ]
}
```

Full filter list (all optional): `maxStops`, `maxPrice`, `airlines`, `excludeBasicEconomy`, `lessEmissionsOnly`, `earliestDepartureHour`/`latestDepartureHour`, `earliestArrivalHour`/`latestArrivalHour`, `maxDurationMinutes`, `connectingAirports`, `minLayoverMinutes`/`maxLayoverMinutes`, `carryOnBags`/`checkedBags`, `hideSeparateAndSelfTransfer`, `currency`, `language`, `seatType`, `adults`/`children`/`infantsInSeat`/`infantsOnLap`, `maxResultsPerSearch`.

### 📤 Output (one row per flight option)

```json
{
  "success": true,
  "search_index": 0,
  "from_airport": "DEL",
  "to_airport": "BOM",
  "trip_type": "one-way",
  "leg_direction": "outbound",
  "price": 13740,
  "airlines": ["SpiceJet"],
  "stops": 0,
  "total_duration_minutes": 140,
  "carbon_emission_grams": 99000,
  "carbon_typical_on_route_grams": 100000,
  "legs": [{
    "from_airport_code": "DEL", "from_airport_name": "Indira Gandhi International Airport",
    "to_airport_code": "BOM", "to_airport_name": "Chhatrapati Shivaji Maharaj International Airport Mumbai",
    "departure": "2026-12-01 06:20", "arrival": "2026-12-01 08:40",
    "duration_minutes": 140, "plane_type": "Boeing 737"
  }]
}
```

A search that fails (bad airport code, no route found, etc.) produces one row with `success: false` and a real `error` message — it never silently returns nothing, and one bad search in a batch never stops the rest.

### 🎯 Use cases

- **Price monitoring** — schedule runs, track a route's price over time, alert on drops.
- **Travel apps / aggregators** — real-time pricing feed with full per-leg + carbon data.
- **Market & fare research** — bulk multi-route, multi-date comparison via `flightSearches`.
- **Sustainability-aware booking tools** — the only Actor here exposing real carbon-emission figures per flight.

### 🔌 Use this API from Claude / ChatGPT (MCP)

This Actor works out of the box with Apify's hosted MCP server — no extra setup on this Actor's side. Connect your AI client (Claude, ChatGPT, Cursor, etc.) to `https://mcp.apify.com` with your Apify token, then ask it to call this Actor by name:

```
inexhaustible_glass/google-flights-scraper
```

The MCP server exposes generic tools (`search-actors`, `fetch-actor-details`, `call-actor`, `get-dataset-items`) that work with any public Actor, this one included — your AI assistant can search for it, read its input schema, run it, and fetch the results, all through the same MCP connection.

### ❓ FAQ

**Does this need a Google account or API key?**
No — it reads Google Flights' own public flight-search data directly.

**How accurate are the prices?**
They're the live prices Google Flights itself returns at request time — same source data a user would see in their browser, fetched directly instead of through a rendered page.

**What about booking links?**
Every result includes `google_flights_search_url` — a one-click deep link back to this exact search (route + date) on Google Flights itself, so you can jump straight to booking. A per-airline resolved checkout link isn't available (Google's booking-redirect tokens aren't exposed by the underlying open-source library), but that's also true of every other Google Flights Actor on Apify — none resolve to an airline's own checkout page.

**Why does round-trip return two rows per option instead of one combined itinerary row?**
Because that's honestly how much detail Google's own backend gives back in one step — see "Why this one" above. Each row is still fully real, fully detailed, just tagged by direction.

**Does multi-city always work?**
It works for most route combinations (verified on LAX↔JFK↔LAX, for example), but a small number of specific route/date combos can fail to parse on Google's side. When that happens you get one honest `success: false` row with the real error — never fake or guessed data.

### ⚖️ Notes

Reads Google Flights' own publicly-accessible flight-search data. No login, scraping of personal accounts, or private data involved.

# Actor input Schema

## `fromAirport` (type: `string`):

Three-letter IATA airport code.

## `toAirport` (type: `string`):

Three-letter IATA airport code.

## `date` (type: `string`):

YYYY-MM-DD.

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

One-way needs date; round-trip also needs returnDate (expanded into two full one-way searches internally).

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

YYYY-MM-DD. Required if trip type is round-trip.

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

For bulk runs or multi-city itineraries. Each item: {fromAirport, toAirport, date, tripType, returnDate} for one-way/round-trip, or {tripType:'multi-city', legs:\[{fromAirport,toAirport,date}, ...]} for multi-city. Per-search filters (maxStops, airlines, etc.) override the Advanced defaults below just for that search.

## `seatType` (type: `string`):

Cabin class for the search.

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

Number of adult passengers.

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

Number of child passengers.

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

Number of infants with their own seat.

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

Number of infants travelling on a lap.

## `maxResultsPerSearch` (type: `integer`):

Caps how many flight results are pushed per search (Google itself may return fewer).

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

0 = nonstop only. Leave blank for no limit.

## `maxPrice` (type: `integer`):

In the selected currency. Leave blank for no limit.

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

Only include these airlines (IATA codes). Leave empty for all airlines.

## `excludeBasicEconomy` (type: `boolean`):

Remove basic economy fares from results.

## `lessEmissionsOnly` (type: `boolean`):

Only include flights Google flags as lower-emissions for the route.

## `earliestDepartureHour` (type: `integer`):

Only include flights departing at or after this local hour.

## `latestDepartureHour` (type: `integer`):

Only include flights departing at or before this local hour.

## `earliestArrivalHour` (type: `integer`):

Only include flights arriving at or after this local hour.

## `latestArrivalHour` (type: `integer`):

Only include flights arriving at or before this local hour.

## `maxDurationMinutes` (type: `integer`):

Only include flights whose total journey duration is at or under this many minutes.

## `connectingAirports` (type: `array`):

Only allow connections through these airports (IATA codes). Leave empty for any.

## `minLayoverMinutes` (type: `integer`):

Only include flights whose layover(s) are at least this many minutes.

## `maxLayoverMinutes` (type: `integer`):

Only include flights whose layover(s) are at most this many minutes.

## `carryOnBags` (type: `integer`):

Number of carry-on bags to include in the price estimate.

## `checkedBags` (type: `integer`):

Number of checked bags to include in the price estimate.

## `hideSeparateAndSelfTransfer` (type: `boolean`):

Remove separate-ticket and self-transfer itineraries from results.

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

ISO currency code for prices. Leave blank to let Google decide.

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

Language code for result text. Leave blank to let Google decide.

## Actor input object example

```json
{
  "fromAirport": "DEL",
  "toAirport": "BOM",
  "date": "2026-12-01",
  "tripType": "one-way",
  "flightSearches": [
    {
      "fromAirport": "LAX",
      "toAirport": "JFK",
      "date": "2026-12-01",
      "tripType": "one-way"
    },
    {
      "tripType": "multi-city",
      "legs": [
        {
          "fromAirport": "CDG",
          "toAirport": "FCO",
          "date": "2026-12-01"
        },
        {
          "fromAirport": "FCO",
          "toAirport": "CDG",
          "date": "2026-12-08"
        }
      ]
    }
  ],
  "seatType": "economy",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "maxResultsPerSearch": 50,
  "excludeBasicEconomy": false,
  "lessEmissionsOnly": false,
  "carryOnBags": 0,
  "checkedBags": 0,
  "hideSeparateAndSelfTransfer": false
}
```

# Actor output Schema

## `flights` (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 = {
    "fromAirport": "DEL",
    "toAirport": "BOM",
    "date": "2026-12-01",
    "tripType": "one-way",
    "seatType": "economy",
    "adults": 1,
    "children": 0,
    "maxResultsPerSearch": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("inexhaustible_glass/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 = {
    "fromAirport": "DEL",
    "toAirport": "BOM",
    "date": "2026-12-01",
    "tripType": "one-way",
    "seatType": "economy",
    "adults": 1,
    "children": 0,
    "maxResultsPerSearch": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("inexhaustible_glass/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 '{
  "fromAirport": "DEL",
  "toAirport": "BOM",
  "date": "2026-12-01",
  "tripType": "one-way",
  "seatType": "economy",
  "adults": 1,
  "children": 0,
  "maxResultsPerSearch": 50
}' |
apify call inexhaustible_glass/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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