# Google Flights Scraper & API - Flight Prices & Cheap Flights (`kalilfagundes.w/google-flights-scraper`) Actor

\[Limited Launch Offer $1/1K] Scrape Google Flights for many routes and dates: flight prices, airlines, flight numbers, stops, layovers, aircraft, CO2, round trips and a calendar of the cheapest flights per day. Airfare data, fast, no browser.

- **URL**: https://apify.com/kalilfagundes.w/google-flights-scraper.md
- **Developed by:** [Scrape With Me](https://apify.com/kalilfagundes.w) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 90.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 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, Round Trips, Cheapest Dates

Scrape **Google Flights** for many routes and dates in one run: **price**, **airlines and flight numbers**, **stops and layovers**, **departure/arrival times**, **duration**, **aircraft**, **legroom**, **CO2 emissions** - for **one-way** or **round-trip** searches - plus a **cheapest-dates calendar** (the lowest price for every day in a range). No browser, no API key.

### Why this one

- **Fast.** It talks to Google Flights' own data endpoints: ~100 flights in about a second; a 2-month price calendar in under a second.
- **Many routes x many dates** in one run - ideal for fare monitoring and travel research.
- **Airport or city codes.** `NYC-LON` searches the configured New York and London airports at once; `JFK,EWR-LHR` mixes airports. Invalid routes are skipped with a warning while valid routes continue.
- **Round trips done right.** Each row is a full itinerary (outbound + return) with the round-trip total.
- **Rich filters**: cabin, stops, airlines, sort order, currency, language.

### Input examples

Flights for two dates:

```json
{ "routes": ["JFK-LHR"], "departureDates": ["2026-11-20", "2026-11-27"], "maxFlightsPerSearch": 20 }
```

Round trips, prices in BRL:

```json
{ "routes": ["GRU-LIS"], "departureDates": ["2026-11-20"], "tripType": "round-trip", "returnAfterDays": 7, "currency": "BRL" }
```

Cheapest-price calendar, business class, nonstop, selected airlines:

```json
{ "routes": ["JFK-LHR"], "mode": "cheapest-dates", "dateFrom": "2026-11-01", "dateTo": "2026-12-31", "cabin": "business", "maxStops": "nonstop", "airlines": ["BA", "AA", "VS"], "currency": "EUR" }
```

### Output examples

The existing `routes` array accepts single airports, supported metro codes, or comma-separated codes on either side:

```json
{ "routes": ["NYC-LON", "JFK,EWR-LHR,LGW", "JFK-ZZZ"], "maxFlightsPerSearch": 10 }
```

This runs the first two routes and reports the invalid third route in warnings and the `OUTPUT.skippedRoutes`
summary. If no valid routes remain, input validation fails. A successful search that returns no flights is an
empty result. Comma lists are airport alternatives in one search, including round trips and the cheapest-dates
calendar; duplicates within each endpoint are removed. Output `route`, `origin` and `destination` retain the
normalized input codes, while flight legs identify the actual airports.

Supported metro codes: `NYC`, `LON`, `PAR`, `TYO`, `CHI`, `WAS`, `MIL`, `ROM`, `MOW`, `SAO`, `RIO`, `BUH`, `STO`,
`OSA`, `SEL`, `BJS`, `BUE`, `YTO`, `YMQ`, `JKT`. These use a fixed airport mapping rather than live city lookup;
use explicit airport lists for other cities or to choose a different set. An unknown or empty code in a comma
list invalidates that route.

A one-way flight (shortened):

```json
{
  "type": "flight",
  "route": "JFK-LHR",
  "departureDate": "2026-11-20",
  "position": 1,
  "price": 325,
  "currency": "USD",
  "airlines": ["American Airlines"],
  "stops": 0,
  "durationMinutes": 420,
  "departure": "2026-11-20T10:10:00",
  "arrival": "2026-11-20T22:10:00",
  "legs": [{ "airlineCode": "AA", "flightNumber": "142", "from": "JFK", "to": "LHR", "aircraft": "Boeing 777", "legroom": "31 in" }],
  "layovers": [],
  "co2EmissionsG": 512000
}
```

A round-trip row has `price` (round-trip total), `returnDate`, and `outbound` / `return` objects with the same flight fields. A calendar row has `departureDate`, `returnDate` (round trips) and `price`.

### Run it on a schedule and connect it to your tools

**Schedule:** in Apify Console open *Schedules → Create*, pick this actor and your input, and set it to run
every Monday at 07:00 (your time zone) for a fresh dataset on a fixed day. Each run returns the full, current result set as a new dataset.

**Integrations** (Actor → *Integrations* tab, no code):

- **Google Sheets** — append every run's rows to a sheet.
- **Make, Zapier, n8n** — start the actor from a scenario/zap/workflow and use the rows in the next steps.
- **Webhook** — get a POST to your endpoint when a run succeeds, then download the dataset.
- **Slack / email** — notify your team when a scheduled run finishes.

**AI agents (MCP)** — Claude, ChatGPT, Cursor, VS Code or any MCP client can run it as a tool: add the Apify MCP
server `https://mcp.apify.com?actors=kalilfagundes.w/google-flights-scraper` (sign in with your Apify account) and ask for the data in
plain language. The agent fills the input from the input schema and reads the dataset back.

**API** — call it from your code (`pip install apify-client` / `npm i apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("kalilfagundes.w/google-flights-scraper").call(run_input={
    "routes": [
        "GRU-LIS",
        "JFK-LAX"
    ],
    "departureDates": [
        "2026-11-20",
        "2026-12-04"
    ],
    "tripType": "round-trip",
    "returnAfterDays": 7,
    "currency": "BRL",
    "maxFlightsPerSearch": 5,
    "maxItems": 40
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('kalilfagundes.w/google-flights-scraper').call({
  "routes": [
    "GRU-LIS",
    "JFK-LAX"
  ],
  "departureDates": [
    "2026-11-20",
    "2026-12-04"
  ],
  "tripType": "round-trip",
  "returnAfterDays": 7,
  "currency": "BRL",
  "maxFlightsPerSearch": 5,
  "maxItems": 40
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Pricing

Pay per event, platform usage included: `flight` per flight or itinerary row, `date-price` per calendar row (see the **Pricing** tab).

### Limitations

- Prices are Google Flights' displayed prices for the passengers, cabin and currency chosen; they change constantly.
- Round trips pair the top outbound options (`roundTripOutboundOptions`) with their return flights; each option is one more request.
- Google Flights shows about 11 months ahead.

### Related actors

- [Google Hotels Scraper & API - Hotel Prices & Price Calendar](https://apify.com/kalilfagundes.w/google-hotels-scraper)
- [Walmart Product Search Scraper - Prices, Ratings, Sellers](https://apify.com/kalilfagundes.w/walmart-scraper)
- [Poshmark Sold Listings Scraper - Mercari, Depop & Grailed](https://apify.com/kalilfagundes.w/resale-sold-comps-scraper)

### Feedback

If this actor saves you time, a quick rating on its Store page helps other people find it. Something not working? Open an issue in the **Issues** tab and it gets fixed fast.

# Actor input Schema

## `routes` (type: `array`):

Origin-destination pairs, one per line, e.g. JFK-LHR or GRU-LIS. Airport codes, supported city codes (NYC, LON, PAR, TYO...) and comma lists on either side (JFK,EWR-LHR,LGW) all work in both modes. Invalid routes are skipped with a warning and listed in OUTPUT.skippedRoutes; at least one valid route is required.

## `mode` (type: `string`):

Flights: every flight for each route and departure date. Calendar: the lowest price for every day between From and To.

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

YYYY-MM-DD, one per line (flights mode). Empty = 30 days from today.

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

One-way or round trip.

## `returnAfterDays` (type: `integer`):

Length of stay for round trips.

## `dateFrom` (type: `string`):

Calendar mode: first departure date. Empty = tomorrow.

## `dateTo` (type: `string`):

Calendar mode: last departure date. Empty = 60 days after From.

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

Number of adult passengers.

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

Cabin class.

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

Maximum number of stops.

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

Only these airlines (IATA codes, e.g. AA, LA, TP). Empty = all.

## `sortBy` (type: `string`):

Order of flights in flights mode.

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

3-letter currency code (USD, EUR, BRL...).

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

Keep the first N flights of each route and date.

## `roundTripOutboundOptions` (type: `integer`):

How many outbound flights to pair with return flights (each adds one request).

## `maxItems` (type: `integer`):

Stop after this many rows in the whole run. 0 = no limit.

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

Language of airport/airline names.

## `country` (type: `string`):

Two-letter country of the Google storefront.

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

Requests start direct; this proxy is used only if Google refuses one.

## Actor input object example

```json
{
  "routes": [
    "JFK-LHR"
  ],
  "mode": "flights",
  "departureDates": [],
  "tripType": "one-way",
  "returnAfterDays": 7,
  "adults": 1,
  "cabin": "economy",
  "maxStops": "any",
  "sortBy": "best",
  "currency": "USD",
  "maxFlightsPerSearch": 20,
  "roundTripOutboundOptions": 3,
  "maxItems": 500,
  "language": "en",
  "country": "us",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

OUTPUT record: found / saved per route and date, errors, proxy use.

# 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 = {
    "routes": [
        "JFK-LHR"
    ],
    "departureDates": [],
    "maxFlightsPerSearch": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kalilfagundes.w/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 = {
    "routes": ["JFK-LHR"],
    "departureDates": [],
    "maxFlightsPerSearch": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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