# Google Flights Scraper - Prices, Airlines & Times (`dataspace/google-flights-scraper`) Actor

Get all Google Flights results for any route and date: prices, airlines, flight numbers, times, stops, layovers, aircraft, CO2 and price level (low/typical/high). One way, round trip, several airports, relative dates for price tracking.

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

## Pricing

from $0.50 / 1,000 flight 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

Get **all Google Flights results** for any route and date — not only the first 20. For every flight option: **price**, airline, **flight numbers**, departure and arrival times, duration, **stops and layovers**, every leg with **aircraft and legroom**, **CO₂ emissions**, and Google's **price level** (low / typical / high) with the typical price range. Optional **price history** for the last ~60 days.

One way, round trip, several airports at once, flexible dates and **relative dates** (`+30` = in 30 days) for scheduled price tracking. No browser, no Google API key, no login.

### What can you do with it?

- **Fare monitoring & alerts** — schedule daily runs with relative dates and watch prices and the price level change.
- **Travel apps, agents and AI assistants** — feed real flight options into your product through the Apify API or MCP.
- **Route & market research** — compare airlines, schedules, stops and prices across routes and dates.
- **Corporate travel & cost analysis** — find the cheapest and fastest options for many trips in one run.
- **Sustainability reporting** — CO₂ emissions per flight and per leg, compared with the typical value for the route.

### What data do you get?

One result per flight option:

| Field | Example |
|---|---|
| `price`, `currency` | 183, USD (total for all passengers; round-trip total for round trips) |
| `priceLevel`, `typicalPriceLow`, `typicalPriceHigh` | typical, 160, 255 — Google's price insight for the search |
| `airline`, `airlineCodes`, `flightNumbers` | Air Serbia, \["JU"], \["JU423", "JU356"] |
| `departureAirport`, `departureTime`, `arrivalAirport`, `arrivalTime` | IST, 2026-11-20T16:40, BER, 2026-11-20T20:00 (local times) |
| `durationMinutes`, `durationText`, `stops` | 320, 5h 20m, 1 |
| `layovers` | airport, city, layover duration, change of airport |
| `legs` | every flight segment: flight number, operator, times, aircraft, legroom, codeshares, CO₂ |
| `co2EmissionsKg`, `typicalCo2EmissionsKg`, `co2DiffPercent` | 212, 190, +12 |
| `isBestFlight`, `rank` | in Google's "Best flights", position in the results |
| `googleFlightsUrl` | link to the same search on Google Flights |

With **Add price insights per search** you also get one result per search: cheapest price, typical price range, price level and the **price history** of the last ~60 days.

#### Example output (real result, shortened)

```json
{
  "origin": "IST",
  "destination": "BER",
  "departureDate": "2026-11-20",
  "returnDate": "2026-11-27",
  "tripType": "ROUND_TRIP",
  "price": 183,
  "currency": "USD",
  "priceLevel": "typical",
  "typicalPriceLow": 160,
  "typicalPriceHigh": 255,
  "airline": "Air Serbia",
  "flightNumbers": ["JU423", "JU356"],
  "departureTime": "2026-11-20T16:40",
  "arrivalTime": "2026-11-20T20:00",
  "durationText": "5h 20m",
  "stops": 1,
  "layovers": [{ "airport": "BEG", "city": "Belgrade", "durationMinutes": 105, "changeOfAirport": false }],
  "legs": [
    { "flightNumber": "JU423", "departureAirport": "IST", "arrivalAirport": "BEG", "aircraft": "Embraer 190", "legroom": "31 inches" },
    { "flightNumber": "JU356", "departureAirport": "BEG", "arrivalAirport": "BER", "aircraft": "Airbus A319", "legroom": "30 inches" }
  ],
  "co2EmissionsKg": 212,
  "co2DiffPercent": 12
}
```

### How to use

1. Add one search per line: `FROM-TO DEPARTURE [RETURN]` with IATA airport or city codes:
   - `JFK-LHR 2026-11-20` — one way
   - `IST-BER 2026-11-20 2026-11-27` — round trip
   - `JFK,EWR-LHR,LGW 2026-11-20` — several airports at once
   - `NYC-PAR +30 +37` — relative dates (departure in 30 days, return after 37 days)
2. Set passengers, cabin class, stops, airlines and currency.
3. Click **Start** and export as JSON, CSV, Excel, or via API.

#### Example input

```json
{
  "searches": ["JFK-LHR +30", "IST-BER 2026-11-20 2026-11-27"],
  "flexibleDays": 2,
  "adults": 2,
  "cabinClass": "ECONOMY",
  "maxStops": "1",
  "airlines": ["STAR_ALLIANCE"],
  "currency": "EUR",
  "sortBy": "price",
  "includePriceInsights": true
}
```

### Pricing

Pay per result: **$0.50 per 1,000 results (one result = one flight option or one price-insights summary)**, plus a tiny start fee of $0.00005 per run. Platform usage (compute and proxies) is included — you are not charged anything else. Use *Max flights per search* or *Max price* to get only what you need.

| Example | Cost |
|---|---|
| one route search (~100 options) | $0.05 |
| daily tracking of 10 routes for a month | $~15 |

Set a maximum cost for a run and the Actor stops when it is reached.

### Tips

- **Round trips:** the results are the departing flights, each with the **total round-trip price**, like on Google Flights.
- **Prices depend on the point of sale** — set *Country* (e.g. `gb`, `de`, `tr`) to see local prices.
- **City codes** like `NYC`, `LON`, `PAR`, `IST` search all airports of the city.
- **Flexible dates:** *Also search the next N days* runs the same search for the following days, perfect for finding the cheapest day.
- For daily price tracking, create a **Schedule** in Apify Console with relative dates (`+30`).

### FAQ

**Is this legal?** The Actor collects publicly available flight information that Google shows to any visitor, without logging in. Please use the data responsibly and in line with applicable laws and Google's terms.

**Can I book flights with it?** No — it collects search results. Use `googleFlightsUrl` to open the same search on Google Flights.

**Missing a feature?** Open an issue on the Issues tab — feedback is welcome and new features are added regularly.

**Like it?** If this Actor saves you time, please leave a review on the Reviews tab — it helps others find it. Found a problem? Open an issue and it will be fixed quickly.

### Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by or sponsored by Google LLC. Google and Google Flights are trademarks of their respective owners and are mentioned only to describe the publicly available data source. It collects only publicly available flight information (schedules, prices, emissions) that Google shows to any visitor — without logging in, without solving CAPTCHAs and without collecting personal data. You are responsible for making sure that your use of the data complies with applicable laws (including copyright and data protection laws such as GDPR) and with the terms of the source website.

# Actor input Schema

## `searches` (type: `array`):

One search per line: <code>FROM-TO DEPARTURE \[RETURN]</code> with IATA airport or city codes.<br>Examples: <code>JFK-LHR 2026-11-20</code> (one way), <code>IST-BER 2026-11-20 2026-11-27</code> (round trip), <code>JFK,EWR-LHR,LGW 2026-11-20</code> (several airports), <code>NYC-PAR +30 +37</code> (dates relative to today: in 30 days, back after 37 days — great for scheduled price tracking).

## `flexibleDays` (type: `integer`):

Flexible dates: 3 = also search departures 1, 2 and 3 days later (return dates move with them). Each extra day is one more search.

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

Number of adult passengers (12+). Prices are the total for all passengers.

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

Number of children aged 2-11.

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

Infants under 2 with their own seat.

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

Infants under 2 on an adult's lap (one per adult).

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

Cabin class to search.

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

Maximum number of stops (layovers) per direction.

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

Only flights of these airlines: 2-letter IATA codes (<code>BA</code>, <code>TK</code>, <code>LH</code>) or alliances <code>STAR_ALLIANCE</code>, <code>ONEWORLD</code>, <code>SKYTEAM</code>. Leave empty for all.

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

Skip flights more expensive than this (in the selected currency, total for all passengers).

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

Order of results within each search.

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

Google often lists 100-300 options for busy routes. Every option is returned, not only the first page.

## `includePriceInsights` (type: `boolean`):

Adds one extra result per search with the cheapest price, Google's typical price range, the price level (low / typical / high) and the price history of the last ~60 days.

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

Currency for all prices.

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

Two-letter country code of the searcher (e.g. us, gb, de, tr). Prices can differ by country.

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

Google language code for airport and airline names (e.g. en, de, fr, tr).

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

Requests switch to a fresh proxy IP automatically if Google blocks them.

## Actor input object example

```json
{
  "searches": [
    "JFK-LHR +30",
    "IST-BER +45 +52"
  ],
  "flexibleDays": 0,
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "cabinClass": "ECONOMY",
  "maxStops": "",
  "sortBy": "best",
  "maxResultsPerSearch": 50,
  "includePriceInsights": false,
  "currency": "USD",
  "country": "us",
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `flights` (type: `string`):

One item per flight option: price, airline, flight numbers, times, duration, stops, layovers, legs, aircraft and CO2.

## `priceInsights` (type: `string`):

One item per search (if enabled): cheapest price, typical price range, price level and ~60-day price history.

## `allFields` (type: `string`):

Every result with all fields, including legs, layovers and price history.

# 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 = {
    "searches": [
        "JFK-LHR +30",
        "IST-BER +45 +52"
    ],
    "maxResultsPerSearch": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataspace/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 = {
    "searches": [
        "JFK-LHR +30",
        "IST-BER +45 +52",
    ],
    "maxResultsPerSearch": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("dataspace/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 '{
  "searches": [
    "JFK-LHR +30",
    "IST-BER +45 +52"
  ],
  "maxResultsPerSearch": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call dataspace/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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