# Google Flights Scraper API - Prices, Cheapest Day, Any Route (`victorrodi/google-flights-scraper-api`) Actor

Google Flights prices and schedules as JSON: airlines, flight numbers, times, stops, layovers, aircraft, CO2. Many routes and dates per run to find the cheapest day. One-way or round trip, any cabin, no browser.

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

## Pricing

from $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.
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 & API — prices, schedules and the cheapest day, no browser

**Get Google Flights results as clean JSON, CSV or Excel**: prices, airlines, flight numbers, departure and arrival times, duration, stops, layovers, aircraft, legroom and CO₂ — for one-way and round trips, any cabin, any currency. Search many routes and dates in one run to **find the cheapest day to fly**. No headless browser, so a search takes about 2 seconds.

✅ **Prices** (total for all passengers) in EUR, USD, GBP or any currency
✅ **Google's "best flights"** flagged, then all other itineraries sorted by price
✅ **Every leg**: flight number, airline, airports, local times, duration, aircraft, legroom
✅ **Stops and layovers** (airport and minutes)
✅ **CO₂ emissions** vs the typical emissions on the route
✅ **Many routes × many dates** in one run — price calendars and cheapest-day searches
✅ **One-way and round trips**, adults and children, economy to first class, nonstop filter
✅ A **Google Flights link** for every search, to open it and book

***

### 🚀 Why this Google Flights API is different

| | This Actor | Typical flight scrapers |
|---|---|---|
| Price | **$0.002 per flight** | $0.015–$0.03 per results page |
| Speed | ~2 s per search, no browser | 20–60 s with headless Chrome |
| Routes × dates in one run | **Yes** (up to 300 searches) | One search per run |
| Flight numbers, aircraft, legroom, CO₂ | **Yes** | Partial |
| Blocking handling | Retries, new IPs, **automatic residential fallback** | Fails on cloud IPs |
| Charged for empty searches | **Never** | Often |

***

### 💡 Use cases

- **Cheapest day to fly**: add 30 departure dates and compare the lowest price per day.
- **Fare tracking & alerts**: schedule a daily run on your routes and get notified when prices drop.
- **Travel agencies & startups**: power a flight search, a deal newsletter or a "cheap flights from X" page.
- **Corporate travel**: compare airlines, durations and CO₂ before booking.
- **Market research**: airline competition, nonstop coverage and pricing per route and season.
- **AI travel agents**: let Claude or ChatGPT fetch real fares through the Apify MCP server.

***

### 🛠️ How to scrape Google Flights (3 steps)

1. Enter **origin and destination codes** (LIS, LHR, JFK… or city codes like LON, PAR, NYC).
2. Add **departure dates** (and a trip length for round trips), passengers, cabin and stops.
3. **Click Start** and download the flights as **JSON, CSV, Excel** or use the API.

***

### 📥 Input example

```json
{
  "origins": ["LIS", "OPO"],
  "destinations": ["LON", "PAR"],
  "departureDates": ["2026-12-10", "2026-12-11", "2026-12-12"],
  "tripLengthDays": 7,
  "adults": 2,
  "cabin": "economy",
  "maxStops": "nonstop",
  "currency": "EUR",
  "maxResultsPerSearch": 10
}
```

### 📤 Output example (real search, Lisbon → London, one-way)

```json
{
  "origin": "LIS",
  "destination": "LHR",
  "departureDate": "2026-12-10",
  "returnDate": null,
  "tripType": "one-way",
  "cabin": "economy",
  "price": 64,
  "currency": "EUR",
  "isBest": true,
  "airlines": ["Iberia"],
  "departureTime": "2026-12-10T06:30",
  "arrivalTime": "2026-12-10T17:15",
  "durationMinutes": 645,
  "stops": 1,
  "layovers": [{ "airport": "MAD", "airportName": "Adolfo Suárez Madrid-Barajas Airport", "minutes": 415 }],
  "segments": [
    { "flightNumber": "IB540", "airline": "Iberia", "from": "LIS", "to": "MAD", "departure": "2026-12-10T06:30", "arrival": "2026-12-10T08:55", "durationMinutes": 85, "aircraft": "Airbus A321", "legroom": "29 in" }
  ],
  "emissionsKg": 166,
  "typicalEmissionsKg": 131,
  "googleFlightsUrl": "https://www.google.com/travel/flights/search?tfs=…"
}
```

The run's `RUN_SUMMARY` record also lists the **cheapest flight of every search** — a ready-made price calendar.

***

### ⚙️ Input parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `origins` | array | `["LIS"]` | IATA codes, one per line: LIS, OPO, LHR, or city codes like LON, PAR, NYC. Every origin is searched to every destination. |
| `destinations` | array | `["LHR"]` | IATA codes, one per line: LHR, CDG, JFK, or city codes like LON, PAR, NYC. |
| `departureDates` | array | — | One date per line, YYYY-MM-DD. Add several dates to find the cheapest day. Past dates are skipped; empty = 30 days from today. |
| `tripLengthDays` | integer | `0` | 0 = one-way. Otherwise the return flight is this many days after each departure date. |
| `adults` | integer | `1` | Passengers aged 12+. Prices are totals for all passengers. |
| `children` | integer | `0` | Passengers aged 2-11. |
| `cabin` | string | `"economy"` | Travel class. Values: `economy`, `premium-economy`, `business`, `first`. |
| `maxStops` | string | `"any"` | Maximum number of stops. Values: `any`, `nonstop`, `1`, `2`. |
| `currency` | string | `"EUR"` | ISO currency code: EUR, USD, GBP, BRL… |
| `language` | string | `"en"` | Language of airline and airport names, e.g. en, pt, fr, de. |
| `maxResultsPerSearch` | integer | `20` | Google's best flights come first, then the cheapest. Lower it to control cost. |
| `onlyBestFlights` | boolean | `false` | Keep only the itineraries Google ranks as best (price, duration and stops balanced). |
| `proxyConfiguration`, `maxRetries` | object, integer | Apify Proxy, auto | Proxy and retries; the defaults work for most runs. |

### 📋 Output fields

| Field | Type | Description |
|---|---|---|
| `origin` | string | Origin airport/city code |
| `destination` | string | Destination airport/city code |
| `departureDate` | string | Outbound date |
| `returnDate` | string | Return date (round trips) |
| `tripType` | string | one-way or round-trip |
| `cabin` | string | Cabin class |
| `price` | integer/number | Total price for all passengers |
| `currency` | string | Currency of the price |
| `isBest` | boolean | Listed by Google among the best flights |
| `airlines` | array | Airlines of the itinerary |
| `departureTime` | string | Local departure time |
| `arrivalTime` | string | Local arrival time |
| `durationMinutes` | integer | Total travel time |
| `stops` | integer | Number of stops |
| `layovers` | array | Layover airports and minutes |
| `segments` | array | Flights: number, airline, airports, times, aircraft, legroom |
| `emissionsKg` | integer | CO2 emissions per passenger (kg) |
| `typicalEmissionsKg` | integer | Typical CO2 on this route (kg) |
| `googleFlightsUrl` | string | Open the search on Google Flights to book |

Export as JSON, CSV, Excel, XML or HTML, or read it through the API.

***

### 💰 Pricing — pay per flight returned

| What you run | Flights | Cost (free plan) |
|---|---|---|
| 1 route, 1 date, top 10 | 10 | $0.02 |
| 1 route, 30 dates, top 5 (cheapest-day search) | 150 | $0.30 |
| 10 routes daily, top 20 | 200/day | $0.40/day |

Higher Apify plans pay less: $0.0017 (Bronze), $0.0014 (Silver), $0.001 (Gold and above). Platform usage and proxies are **included**. Lower `maxResultsPerSearch` to control cost; searches without flights are never charged.

***

### 🔌 API & integrations

**Python**

```python
from apify_client import ApifyClient  # pip install "apify-client>=3"

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("victorrodi/google-flights-scraper-api").call(
    run_input={"origins": ["LIS"], "destinations": ["JFK"], "departureDates": ["2026-12-10"], "maxResultsPerSearch": 5}
)
for f in client.dataset(run.default_dataset_id).iterate_items():
    print(f["price"], f["currency"], f["airlines"], f["departureTime"], f["stops"])
```

**JavaScript / Node.js**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('victorrodi/google-flights-scraper-api').call({
  origins: ['NYC'], destinations: ['LON'], departureDates: ['2026-12-10'], tripLengthDays: 7,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((f) => `${f.price} ${f.currency} ${f.airlines.join('/')}`));
```

**cURL**

```bash
curl -X POST "https://api.apify.com/v2/acts/victorrodi~google-flights-scraper-api/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"origins": ["LIS"], "destinations": ["LHR"], "departureDates": ["2026-12-10"], "maxResultsPerSearch": 5}'
```

Also works with **Make, Zapier, n8n, Google Sheets, Slack** and **MCP / AI agents**: *"Find the cheapest nonstop flight from Lisbon to Paris next Friday with the Google Flights scraper."*

***

#### 🤖 Use it from AI agents (Claude, ChatGPT, Cursor…)

This Actor is available to AI assistants through the **[Apify MCP server](https://mcp.apify.com)**. Add the server to Claude Desktop, Claude Code, Cursor or any MCP client, then simply ask:

> *"Find the cheapest nonstop flight from Lisbon to London on December 10 with Google Flights."*

> *"Compare round-trip prices from New York to Paris for each day of the first week of December."*

The clean, flat output is designed to be read directly by LLMs.

***

### 🛡️ Reliability

- Requests are paced and retried with a **new IP** and exponential backoff.
- If the site keeps blocking, the Actor **switches to residential IPs automatically**.
- One failing item never stops the run, and you are never charged for it.
- Every run writes a `RUN_SUMMARY` record (results, failures, retries, blocks).
- Measured on a real run: **8/8 searches** answered with **0 blocks**.
- Past departure dates in saved tasks move forward automatically, so schedules never break.

More examples and docs for all our Actors: **[Vicshock/trendpulse-scrapers](https://github.com/Vicshock/trendpulse-scrapers)**.

***

### 📌 Tips

- City codes (LON, PAR, NYC, MIL) search all airports of the city at once.
- For the cheapest day, add many `departureDates` and keep `maxResultsPerSearch` low (1–5), then read `RUN_SUMMARY.cheapest`.
- Round-trip prices are totals for both directions; the itinerary shown is the outbound flight.
- Prices change constantly; schedule the Actor to track them over time.

### ❓ FAQ

**Is there an official Google Flights API?** No — Google closed the QPX Express API in 2018. This Actor reads the public Google Flights results.

**Can I book through it?** It returns the data and a Google Flights link for each search; booking happens on Google Flights or the airline site.

**Which currencies and languages?** Any currency supported by Google Flights (EUR, USD, GBP, BRL, CHF…) and language for names (en, pt, fr, de…).

**Is it legal?** The Actor reads publicly displayed flight offers — no personal data. Make sure your use respects Google's terms and the laws that apply to you.

### 💬 Support

Missing a field or found an issue? Open an issue in the **Issues** tab — it is answered fast.

# Actor input Schema

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

IATA codes, one per line: LIS, OPO, LHR, or city codes like LON, PAR, NYC. Every origin is searched to every destination.

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

IATA codes, one per line: LHR, CDG, JFK, or city codes like LON, PAR, NYC.

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

One date per line, YYYY-MM-DD. Add several dates to find the cheapest day. Past dates are skipped; empty = 30 days from today.

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

0 = one-way. Otherwise the return flight is this many days after each departure date.

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

Passengers aged 12+. Prices are totals for all passengers.

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

Passengers aged 2-11.

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

Travel class.

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

Maximum number of stops.

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

ISO currency code: EUR, USD, GBP, BRL…

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

Language of airline and airport names, e.g. en, pt, fr, de.

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

Google's best flights come first, then the cheapest. Lower it to control cost.

## `onlyBestFlights` (type: `boolean`):

Keep only the itineraries Google ranks as best (price, duration and stops balanced).

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

Apify Proxy is used by default; the Actor switches to residential IPs automatically if Google starts blocking.

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

Retries per search with a new IP and backoff.

## `debugLog` (type: `boolean`):

Log every request (for troubleshooting).

## Actor input object example

```json
{
  "origins": [
    "LIS"
  ],
  "destinations": [
    "LHR",
    "PAR"
  ],
  "departureDates": [],
  "tripLengthDays": 0,
  "adults": 1,
  "children": 0,
  "cabin": "economy",
  "maxStops": "any",
  "currency": "EUR",
  "language": "en",
  "maxResultsPerSearch": 20,
  "onlyBestFlights": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxRetries": 5,
  "debugLog": false
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "origins": [
        "LIS"
    ],
    "destinations": [
        "LHR",
        "PAR"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("victorrodi/google-flights-scraper-api").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": ["LIS"],
    "destinations": [
        "LHR",
        "PAR",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,victorrodi/google-flights-scraper-api"
        }
    }
}
```

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/P0XrFIVzJ3ESJL8d0/builds/wg35kVGyE10aL7Hp8/openapi.json
