# Google Flights Scraper: Prices, Itineraries & Date Ranges (`cprussin/google-flights-prices`) Actor

Google Flights prices and itineraries for any route: airlines, flight numbers, times, duration, stops, layovers and CO2 emissions. One-way or round trip, any cabin, or scan a date range for the cheapest day.

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

## Pricing

from $5.00 / 1,000 flight itineraries

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: Prices, Itineraries & Date Ranges

**Google Flights Scraper** exports flight prices and itineraries from Google Flights as clean JSON, CSV or Excel. Google has no public flights API (QPX Express was shut down in 2018), so this actor reads the same results the google.com/travel/flights website shows:

- ✅ **Prices** for any route and date, in any currency and point-of-sale country.
- ✅ **Itinerary details**: airlines, flight numbers, local departure/arrival times, total duration, stops, layover airports and layover times, aircraft and legroom per leg.
- ✅ **CO2 emissions** per itinerary and vs the typical emissions for the route, when Google shows them.
- ✅ **Best / cheapest flags**: `isBest` marks Google's "Top flights", `isCheapest` the lowest price of each search.
- ✅ **One-way or round trip**, 1–9 adults, economy, premium economy, business or first, and a nonstop / max-stops filter.
- ✅ **Date ranges** per route (price-calendar style): one search per departure day, with an optional fixed stay length for round trips.
- ✅ Handles Google's rate limits: new proxy IP on every blocked or failed request, direct fallback when the proxy is down, capped retry time.
- ✅ Fast and light: plain HTTP requests, no browser. Pay only for itineraries written to your dataset.

### Who uses Google Flights price data?

- **Travel startups and OTAs**: price benchmarks and route coverage without a GDS contract.
- **Fare alert and deal sites**: schedule daily runs and alert on price drops for watched routes.
- **Travel managers and agencies**: compare fares across dates, cabins and airlines before booking.
- **Airlines and airports**: monitor competitors' fares and schedules on shared routes.
- **Analysts, researchers and journalists**: track airfare trends and emissions over time.
- **AI agents**: give an LLM live flight prices through the Apify API or MCP server.

### How does the Google Flights price scraper work?

1. Add routes: origin and destination IATA codes and a date (or a date range).
2. Choose passengers, cabin, stops, currency and country.
3. The actor loads the Google Flights results page for each route and date and reads the itinerary data embedded in it (the same data the page renders).
4. You get one dataset item per itinerary, in Google's order: top flights first, then the other flights. Up to `maxItineraries` per search.

### How do I set up flight routes and dates?

| Field                | Description                                                            | Example                                                    |
| -------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------- |
| `routes`             | List of routes (see below)                                             | `[{"origin": "JFK", "destination": "LHR", "date": "+30"}]` |
| `adults`             | Adult passengers, 1–9. Prices are the total for all passengers         | `2`                                                        |
| `cabinClass`         | `economy`, `premiumEconomy`, `business` or `first`                     | `"business"`                                               |
| `maxStops`           | `any`, `0` (nonstop), `1` or `2`                                       | `"0"`                                                      |
| `maxItineraries`     | Max itineraries per route and date (Google lists up to ~30 per search) | `10`                                                       |
| `currency`           | ISO currency code                                                      | `"EUR"`                                                    |
| `country`            | Point-of-sale country (Google's `gl`)                                  | `"DE"`                                                     |
| `language`           | Interface language (`hl`) for airport and airline names                | `"en"`                                                     |
| `proxyConfiguration` | Apify Proxy (on by default; datacenter is enough)                      | `{ "useApifyProxy": true }`                                |

Each route has:

- `origin`, `destination`: 3-letter IATA airport or city codes (`JFK`, `LHR`, `NYC`, `LON`).
- `date`: `YYYY-MM-DD`, or `+N` for N days from today (handy for scheduled runs). Default `+30`.
- `returnDate`: for a round trip on one date.
- `dateFrom` + `dateTo`: search every departure day in the range (up to 180 days), instead of `date`.
- `stayDays`: round trip returning N days after each departure date; works with ranges.

A route can also be a string: `"JFK-LHR 2026-11-15"` or `"JFK-LHR 2026-11-15 2026-11-22"` (round trip).

Example: the cheapest week-long round trip from LA to Tokyo departing any day in the first week of December, nonstop only.

```json
{
  "routes": [
    {
      "origin": "LAX",
      "destination": "NRT",
      "dateFrom": "2026-12-01",
      "dateTo": "2026-12-07",
      "stayDays": 7
    }
  ],
  "maxStops": "0",
  "maxItineraries": 3
}
```

### What data do you get for each flight?

```json
{
  "route": "JFK-LHR",
  "origin": "JFK",
  "destination": "LHR",
  "tripType": "oneWay",
  "departureDate": "2026-11-15",
  "returnDate": null,
  "adults": 1,
  "cabinClass": "economy",
  "price": 291,
  "currency": "USD",
  "isBest": false,
  "isCheapest": true,
  "rank": 6,
  "airlines": ["Icelandair"],
  "flightNumbers": ["FI614", "FI450"],
  "departureAirport": "JFK",
  "arrivalAirport": "LHR",
  "departureTime": "2026-11-15T19:25",
  "arrivalTime": "2026-11-16T10:50",
  "durationMinutes": 625,
  "duration": "10h 25m",
  "stops": 1,
  "layoverAirports": ["KEF"],
  "layovers": [
    {
      "airport": "KEF",
      "airportName": "Keflavík International Airport",
      "city": "Reykjavík",
      "durationMinutes": 85
    }
  ],
  "legs": [
    {
      "flightNumber": "FI614",
      "airline": "Icelandair",
      "airlineCode": "FI",
      "from": "JFK",
      "fromName": "John F. Kennedy International Airport",
      "to": "KEF",
      "toName": "Keflavík International Airport",
      "departureTime": "2026-11-15T19:25",
      "arrivalTime": "2026-11-16T06:10",
      "durationMinutes": 345,
      "aircraft": "Boeing 737MAX 9 Passenger",
      "legroom": "30 in"
    }
  ],
  "emissionsKg": 466,
  "typicalEmissionsKg": 431,
  "emissionsDiffPercent": 8,
  "searchUrl": "https://www.google.com/travel/flights/search?tfs=GhoSCjIwMjYtMTEtMTVqBRIDSkZLcgUSA0xIUkABSAGYAQI%3D&hl=en&gl=us&curr=USD",
  "scrapedAt": "2026-09-30T20:00:00.000Z"
}
```

- Times are **local airport times** (`YYYY-MM-DDTHH:mm`, no time zone), like on the website.
- `price` is the total for all passengers. For round trips it's the **round-trip** price, and the itinerary fields describe the **outbound** flights (as on Google's first results page).
- `rank` is the position in Google's list for that search. `searchUrl` opens the same search in a browser.
- Emission fields are `null` when Google has no estimate for that flight.

### How much does it cost to scrape Google Flights prices?

Pay-per-event, only for itineraries written to your dataset:

| Event            | Price      |
| ---------------- | ---------- |
| Flight itinerary | **$0.005** |

That's **$5 per 1,000 itineraries**. The default input (one route, 10 itineraries) costs $0.05. A 30-day price calendar with the 3 best itineraries per day is 90 itineraries, $0.45. Searches that return no flights are free. If you set a **maximum cost per run**, the actor stops cleanly when it reaches it.

### Tips for tracking Google Flights prices

- **Cheapest day to fly:** use `dateFrom`/`dateTo` with `maxItineraries: 1–3`, then sort by `price` or filter `isCheapest: true`.
- **Price tracking:** schedule the actor daily with relative dates (`"+30"`, `"+60"`) and compare prices over time, or send new results to Google Sheets, Slack or a webhook with Apify integrations.
- **City codes** (`NYC`, `LON`, `PAR`, `TYO`) search all airports of a city at once.
- **Lower cost per search:** Google puts its recommended "top flights" first, so a small `maxItineraries` still gets the most relevant options.

### Google Flights scraper FAQ

**Is this an official Google API?** No. It reads the public results that google.com/travel/flights shows. Prices match what you see in the browser for the same search, country and currency.

**Why do prices differ from my browser?** Fares change constantly, and Google shows different prices by point-of-sale country and currency. Set `country` and `currency` to match your browser.

**Why at most ~30 itineraries per search?** That's what Google's results page lists before you click "View more flights". Use `maxStops` or date ranges to explore more options.

**Can I get the return flights of a round trip?** Not yet. Round trips return the outbound options with the total round-trip price. Search the return leg as a separate one-way route if you need its flights.

**Do I need a proxy?** Google occasionally rate-limits single IPs. Apify Proxy (datacenter) is enabled by default, and the actor switches IP automatically when a request is blocked.

**Can I use it through the API or with AI agents?** Yes. Call it through the Apify API, the Apify MCP server or any Apify integration.

**Disclaimer:** This actor is not affiliated with, endorsed by or sponsored by Google. Google Flights is a trademark of Google LLC. You are responsible for complying with Google's terms when using the data.

### Related actors

- [aliexpress-scraper](https://apify.com/cprussin/aliexpress-scraper): AliExpress product search results, prices and buyer reviews.
- [google-trends](https://apify.com/cprussin/google-trends): Google Trends interest over time, regions, related queries and trending searches.
- [eventbrite-events](https://apify.com/cprussin/eventbrite-events): Eventbrite events by city, category and date, with venues, organizers and prices.

# Actor input Schema

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

Flights to search. Each route has <code>origin</code> and <code>destination</code> (IATA airport or city codes, e.g. JFK, LHR, NYC) and a <code>date</code> or a <code>dateFrom</code>/<code>dateTo</code> range (one search per day). Dates: YYYY-MM-DD or <code>+N</code> days from today. Round trips: add <code>returnDate</code> or <code>stayDays</code> (nights; works with ranges). Shorthand like <code>"JFK-LHR 2026-11-15"</code> works too.

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

Number of adult passengers (1-9). Prices are the total for all passengers.

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

Seat class to price.

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

Only return itineraries with at most this many stops.

## `maxItineraries` (type: `integer`):

Stop after this many itineraries for each route and date (Google's order: best flights first, then the rest). Google's results page lists up to ~30 itineraries per search. Each itinerary is one result.

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

ISO currency code for prices, e.g. USD, EUR, GBP, JPY.

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

Point-of-sale country (gl), e.g. US, GB, DE. Prices and availability can differ by country.

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

Interface language (hl), e.g. en, de, fr. Affects airport and airline names.

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

Apify Proxy (datacenter is enough). The actor switches to a new IP whenever Google blocks or rate-limits a request, and falls back to direct requests if the proxy keeps failing.

## Actor input object example

```json
{
  "routes": [
    {
      "origin": "JFK",
      "destination": "LHR",
      "date": "+30"
    }
  ],
  "adults": 1,
  "cabinClass": "economy",
  "maxStops": "any",
  "maxItineraries": 10,
  "currency": "USD",
  "country": "US",
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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 = {
    "routes": [
        {
            "origin": "JFK",
            "destination": "LHR",
            "date": "+30"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cprussin/google-flights-prices").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": [{
            "origin": "JFK",
            "destination": "LHR",
            "date": "+30",
        }],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("cprussin/google-flights-prices").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": [
    {
      "origin": "JFK",
      "destination": "LHR",
      "date": "+30"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call cprussin/google-flights-prices --silent --output-dataset

```

## MCP server setup

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

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/XM4NDcJQB4yTcbN4P/builds/9uJSeysuaugPzwixp/openapi.json
