# Google Flights Scraper – Prices, Dates, Routes, CO2 (`rt-solutions/google-flights-scraper`) Actor

Flight prices and schedules from Google Flights for any route and date: airlines, flight numbers, times, stops and layovers, aircraft, legroom, CO2 emissions. One way or round trip, cabin, passengers, nonstop filter, date ranges for price tracking. No login.

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

## Pricing

from $0.08 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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, Dates, Routes, CO2

Get **flight prices and schedules from Google Flights** for any route and date: airlines, flight numbers, departure and arrival times, duration, stops and layovers, aircraft, legroom, codeshares and CO2 emissions. One way or round trip, any cabin, any number of passengers, nonstop filter, 30 currencies. Compare **many routes × many dates in one run** to track prices day by day.

No Google account, no API key.

### Why this one

| | This Actor |
|---|---|
| Routes × dates | Several origins, destinations and date ranges (`2026-12-01..2026-12-14`) in one run |
| Round trip | Fixed return date or "return N days after departure" for every date |
| Details | Every leg: flight number, aircraft, legroom, codeshares, CO2; layover airport and duration |
| Accuracy | Same prices, times and order as the Google Flights page (checked side by side) |
| Reliability | New IP and retry on any error or incomplete page; nothing to solve, no failed runs on bad input |
| Price | **$0.20 per 1,000 flights**, $0.08–0.10 on paid plans; searches with no flights are free |

### Input examples

One way, one date:

```json
{ "origins": ["JFK"], "destinations": ["LHR"], "departureDates": ["2026-12-03"] }
```

Price tracking: 2 weeks of 7‑day round trips from 2 cities, in euros:

```json
{ "origins": ["Paris", "Lyon"], "destinations": ["NYC"], "departureDates": ["2026-12-01..2026-12-14"], "tripLengthDays": 7, "currency": "EUR" }
```

Business class, 2 adults, nonstop only:

```json
{ "origins": ["CDG"], "destinations": ["JFK"], "departureDates": ["2026-12-10"], "cabinClass": "business", "adults": 2, "stops": "nonstop" }
```

### Output example

```json
{
  "origin": "JFK", "destination": "LHR", "departureDate": "2026-12-03", "returnDate": "2026-12-10", "tripType": "round_trip",
  "rank": 1, "bucket": "top", "price": 711, "currency": "EUR",
  "airlines": ["American"],
  "departure": "2026-12-03T18:25", "arrival": "2026-12-04T06:20", "durationMinutes": 415, "stops": 0, "layovers": [],
  "co2Kg": 421, "typicalCo2Kg": 427, "co2VsTypicalPercent": -1,
  "legs": [{ "flightNumber": "AA 100", "aircraft": "Boeing 777", "legroom": "31 inches", "operatedAlsoAs": ["IB 4218", "AY 3772", "BA 1511"],
             "departureAirport": "JFK", "arrivalAirport": "LHR", "departure": "2026-12-03T18:25", "arrival": "2026-12-04T06:20", "durationMinutes": 415, "co2Kg": 421 }],
  "googleFlightsUrl": "https://www.google.com/travel/flights?q=…"
}
```

- `price` is the total for all passengers. For round trips it is the round‑trip price shown for the outbound flight (as on Google Flights).
- `bucket`: `top` = Google's "Top flights", `other` = the other options. `rank` keeps Google's order.

### Use cases

- **Fare tracking**: schedule a daily run over a date range and watch the cheapest price per route.
- **Travel agencies & OTAs**: compare carriers, schedules and prices across many routes.
- **Airline & airport analysts**: frequencies, aircraft, codeshares and emissions by route.
- **Corporate travel**: cheapest nonstop options for recurring trips.

### Pricing

**$0.20 per 1,000 flights** on the free plan, **$0.10** on Starter and **$0.08** on higher plans. Searches with no flights, flights shown without a price ("price unavailable") and errors are not charged.

### Good to know

- Use airport codes (`JFK`) or city codes (`NYC`, `PAR`, `LON` = all airports of the city) for full control; city names (`New York`) also work for basic searches (premium economy and the 1‑stop filter need codes).
- Dates must be in the future (`YYYY-MM-DD`). Invalid or past dates are reported, not charged.
- Google shows about 10–30 options per search; that is what you get.
- Prices are Google's at the time of the run and can change minutes later.

### Related scrapers

- [Google Trends Scraper](https://apify.com/rt-solutions/google-trends-scraper)
- [Google News Scraper](https://apify.com/rt-solutions/google-news-scraper)
- [Semrush Website Traffic Scraper](https://apify.com/rt-solutions/semrush-website-traffic-scraper)

# Actor input Schema

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

Airport codes (JFK, LHR) or city names (New York, Paris). Several = every combination is searched.

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

Airport codes or city names.

## `departureDates` (type: `array`):

YYYY-MM-DD, one per line, or a range like 2026-12-01..2026-12-14 to compare prices day by day.

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

YYYY-MM-DD. Leave empty for one way.

## `tripLengthDays` (type: `integer`):

Round trip of N days for every departure date (handy with a date range). 0 = one way.

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

Prices are the total for all passengers.

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

Children aged 2–11.

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

Travel class.

## `stops` (type: `string`):

Filter on the number of stops.

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

Currency of the prices.

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

Language code for airport and airline names (en, fr, de…).

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

0 = all flights Google shows (usually 10–30).

## `maxSearches` (type: `integer`):

Safety cap on routes × dates.

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

Searches run at the same time.

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

Default Apify Proxy works; residential is used automatically only if needed.

## Actor input object example

```json
{
  "origins": [
    "JFK"
  ],
  "destinations": [
    "LHR"
  ],
  "departureDates": [
    "2026-12-03"
  ],
  "tripLengthDays": 0,
  "adults": 1,
  "children": 0,
  "cabinClass": "economy",
  "stops": "any",
  "currency": "USD",
  "language": "en",
  "maxFlightsPerSearch": 0,
  "maxSearches": 200,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per flight option: price, airlines, times, stops, layovers, legs, CO2.

## `overview` (type: `string`):

Main fields per flight.

# 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": [
        "LHR"
    ],
    "departureDates": [
        "2026-12-03"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rt-solutions/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": ["LHR"],
    "departureDates": ["2026-12-03"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("rt-solutions/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": [
    "LHR"
  ],
  "departureDates": [
    "2026-12-03"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call rt-solutions/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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