# Google Flights Scraper — Cheap Flights & Flight Price API (`prestilink/google-flights-scraper`) Actor

Google Flights API for cheap flights and flight prices on any route and dates: airlines, flight numbers, times, stops, layovers, aircraft, legroom, CO2 and Google's low/typical/high price verdict. One-way and round trips, every cabin, 60-day price history. No browser.

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

## Pricing

Pay per event

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 — Cheap Flights & Flight Price API

Get **cheap flights and flight prices from Google Flights for any route and any dates**: price, airline, flight numbers, departure and arrival times, duration, stops, layovers, aircraft, legroom, Wi-Fi and power, CO2 emissions, and Google's own verdict on whether prices are **low, typical or high** right now. One-way and round trips, every cabin class, up to 9 travellers.

No browser: the Actor reads Google Flights data directly, so a search takes about a second. **You only pay for searches that return flights.** Searches that fail or find nothing are never charged.

**A pay-as-you-go alternative to SerpApi's Google Flights API**: no monthly plan, you only pay for searches that return flights.

### Who uses it

- **Travel agencies, OTAs and metasearch**: live flight prices for every route you sell.
- **Flight price trackers and cheap flights sites**: run daily, compare with yesterday, publish the drops.
- **Travel apps and AI agents**: a simple flight price API without an airline contract.
- **Airlines and airports**: competitor prices, schedules and capacity on your routes.
- **Analysts and corporate travel**: price levels by route, season and booking window.

### What you get

| Data | Field |
|---|---|
| Total price for all travellers | `price`, `currency` |
| Airline and flight numbers | `airline`, `airlineCodes`, `flightNumbers` |
| Departure and arrival, local time | `departureAirport`, `departureTime`, `arrivalAirport`, `arrivalTime` |
| Duration and stops | `durationMinutes`, `duration`, `stops` |
| Layovers | `layovers[]` with airport, city, wait time and change of airport |
| Every flight of the trip | `segments[]` with flight number, aircraft, cabin, legroom, seat type, Wi-Fi, power, video, emissions |
| CO2 emissions | `emissionsKg`, `typicalEmissionsKg`, `emissionsDifferencePercent` |
| Google's price verdict for the search | `priceLevel` (low, typical, high), `typicalPriceLow`, `typicalPriceHigh` |
| "Best" flights flag | `isTopFlight` |
| Baggage policy links | `baggageInfoUrls` |
| Link to the flight on Google Flights | `googleFlightsUrl` (booking page for one-way and full round trips) |

With **Include price history**, each search also returns the **lowest price on each of the last 60 days**, to see whether to book now or wait. Google keeps this history for searches with one adult.

### How to use

1. Add one or more **routes**, one per line: `JFK-LAX`, `CDG-RAK`, or city codes that cover all airports of a city like `NYC-LON` or `PAR-TYO`.
2. Set the **departure date**. For a round trip, set a **return date** or a **trip length**.
3. Choose **travellers**, **cabin class**, **stops** and **airlines** if you want.
4. Run, then download the results as JSON, CSV or Excel, or get them through the API.

**Find the cheapest day to fly**: set **Number of departure dates** to 30 and the Actor searches 30 consecutive days in one run.

**Round trips**: Google prices a round trip on the outbound flight. Set **Return flights for the top N outbound flights** to also get the return options for the best outbound flights, each with the exact round-trip price.

You can also paste **Google Flights URLs**: the Actor reuses every filter you set on Google.

### Input example

```json
{
  "routes": ["JFK-LAX", "NYC-LON"],
  "departureDate": "2026-12-10",
  "returnDate": "2026-12-17",
  "returnFlightsFor": 3,
  "adults": 2,
  "cabinClass": "economy",
  "maxStops": "1",
  "currency": "USD",
  "includePriceHistory": true
}
```

### Output example

```json
{
  "type": "flight",
  "searchRoute": "JFK-LAX",
  "tripType": "one-way",
  "leg": "one-way",
  "departureDate": "2026-11-20",
  "position": 1,
  "price": 205,
  "currency": "USD",
  "priceLevel": "typical",
  "typicalPriceLow": 105,
  "typicalPriceHigh": 275,
  "isTopFlight": true,
  "airline": "American",
  "flightNumbers": ["AA 171"],
  "departureAirport": "JFK",
  "departureTime": "2026-11-20T06:00",
  "arrivalAirport": "LAX",
  "arrivalTime": "2026-11-20T09:22",
  "durationMinutes": 382,
  "duration": "6 hr 22 min",
  "stops": 0,
  "layovers": [],
  "segments": [
    {
      "flightNumber": "AA 171",
      "aircraft": "Boeing 787",
      "cabin": "economy",
      "legroom": "31 inches",
      "seat": "average",
      "amenities": ["paid Wi-Fi", "power and USB outlets", "on-demand video"],
      "emissionsKg": 274
    }
  ],
  "emissionsKg": 274,
  "typicalEmissionsKg": 343,
  "emissionsDifferencePercent": -20,
  "googleFlightsUrl": "https://www.google.com/travel/flights/booking?tfs=...",
  "status": "ok"
}
```

Values in this example are illustrative.

### Pricing

Pay per event: a small fee per run, a fee per search that returns flights, and a fee per flight. Bigger Apify plans pay less. See the **Pricing** tab for exact prices on your plan.

Set a maximum cost per run in the run options and the Actor stops before going over it. **Max flights per search** also caps what each search costs.

### Good to know

- Prices are what Google Flights shows for your route, dates, travellers, cabin, currency and traveller country at the time of the run. The price is the total for all travellers.
- Times are local to each airport.
- Use IATA codes: 3 letters for airports (`LHR`) or cities (`LON`), 2 characters for airlines (`BA`). Google Flights shows flights up to about 11 months ahead.
- A search that finds no flights, for example a route with no service on that date, is not charged.

### Use it with

- **AI agents and MCP**: add this Actor as a tool through the Apify MCP server (Claude, Cursor, ChatGPT and other MCP clients), LangChain, LlamaIndex or CrewAI.
- **No-code automation**: n8n, Make and Zapier, for example a daily flight price drop alert to Telegram, Slack or email.
- **Spreadsheets and dashboards**: Google Sheets, Excel, Looker Studio.
- **Developers**: the Apify API, Python and JavaScript clients, webhooks and scheduled runs.

***

This Actor is not affiliated with, endorsed by, or sponsored by Google. Google Flights is a trademark of Google LLC.

# Actor input Schema

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

One route per line, origin-destination, with IATA airport codes (`JFK-LAX`, `CDG-RAK`) or city codes that cover every airport of a city (`NYC-LON`, `PAR-TYO`). Several airports: `JFK,EWR-LAX`.

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

YYYY-MM-DD, or relative like `+30` (30 days from today). Leave empty for 14 days from today.

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

Set it for a round trip (YYYY-MM-DD or `+37`). Leave empty for one-way.

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

Round trip of this many days, used when Return date is empty. 0 or empty means one-way.

## `datesToSearch` (type: `integer`):

Search this many consecutive departure dates, starting at the departure date, to find the cheapest day. Round trips keep the same trip length. Each date is one search.

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

Travellers aged 12 and over.

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

Aged 2 to 11.

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

Under 2, with their own seat.

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

Under 2, on an adult's lap. One per adult.

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

Cabin to price.

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

Maximum number of stops.

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

Only these airlines, by 2-character IATA code (`AA`, `BA`, `AF`, `EK`), or alliances: `ONEWORLD`, `SKYTEAM`, `STAR_ALLIANCE`. Leave empty for all.

## `excludeAirlines` (type: `array`):

Never these airlines or alliances, same codes as above.

## `returnFlightsFor` (type: `integer`):

Round trips only. Google prices round trips on the outbound flight; set this to also get the return flights for the N best outbound flights, each with the exact round-trip price. Each one is an extra search.

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

Keep at most this many flights from each search (Google usually lists 10 to 150).

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

Drop flights above this total price, in the selected currency.

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

Order of flights within each search.

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

Also save Google's price history for each search: the lowest price on each of the last 60 days, the price level and the typical price range. One extra item per search, free. Google only has it for searches with one adult.

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

Currency for all prices.

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

Language of airline, airport and aircraft names.

## `countryCode` (type: `string`):

Two-letter country code of the traveller, for example `us`, `gb`, `fr`. Prices can depend on it.

## `startUrls` (type: `array`):

Optional. Paste Google Flights search URLs (google.com/travel/flights/search?tfs=...) to reuse every filter you set on Google.

## Actor input object example

```json
{
  "routes": [
    "JFK-LAX"
  ],
  "departureDate": "+30",
  "datesToSearch": 1,
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "returnFlightsFor": 0,
  "maxResultsPerSearch": 100,
  "sortBy": "best",
  "includePriceHistory": false,
  "currency": "USD",
  "language": "en",
  "countryCode": "us"
}
```

# Actor output Schema

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

One item per flight option: price, airline, flight numbers, times, duration, stops, layovers, segments with aircraft and legroom, emissions, Google's price level, and a Google Flights link.

# 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-LAX"
    ],
    "departureDate": "+30"
};

// Run the Actor and wait for it to finish
const run = await client.actor("prestilink/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-LAX"],
    "departureDate": "+30",
}

# Run the Actor and wait for it to finish
run = client.actor("prestilink/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-LAX"
  ],
  "departureDate": "+30"
}' |
apify call prestilink/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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