# Google Flights Scraper: Prices, Schedules & Fare History (`sam_i_am_not/google-flights-scraper`) Actor

Google Flights prices and schedules for any route: one-way or round-trip, any cabin and passenger mix, flexible date ranges, Google's price insights and 60-day fare history. No browser, from $0.002 per search.

- **URL**: https://apify.com/sam_i_am_not/google-flights-scraper.md
- **Developed by:** [Andrew Van De Poel](https://apify.com/sam_i_am_not) (community)
- **Categories:** Travel, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 94.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 flight searches

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, schedules and fare history

**Get Google Flights prices and schedules for any route as JSON, CSV or Excel. Search one-way or round-trip in any cabin with any passenger mix, see every flight option with legs, layovers, aircraft and CO2, plus Google's price insight and 60-day fare history. Search ranges of dates to find the cheapest day to fly.** It doesn't use a browser, so each search takes a few seconds and costs from $0.0015.

Built for **travel startups and agencies** comparing fares, **deal sites and newsletters** spotting cheap dates, **analysts** tracking airfare on routes over time, and **AI agents** planning trips.

### What you get

| | |
|---|---|
| **Every flight option** | price (total for all passengers), airlines, flight numbers, departure and arrival times (local), total duration, stops |
| **Each leg** | flight number, airline, airports, times, duration, aircraft, legroom |
| **Layovers** | airport, city and minutes for every stop |
| **Emissions** | estimated kg CO2 and % versus the route's typical flight |
| **Price insight** | Google's "prices are currently low / typical / high", the typical price, and the typical range |
| **Fare history** | the daily lowest price Google tracked for that search over about 60 days |

Search options:

- one-way or round-trip, optionally with the **return flights** for the outbound options you care about
- economy, premium economy, business or first
- adults, children and infants
- nonstop only, or a maximum number of stops
- specific airlines only (by airline code, e.g. DL, UA)
- any currency and point-of-sale country
- flexible date ranges of up to 62 days

### How to use it

1. Add **routes** as airport codes, one per line: `JFK-LAX`, `SFO-NRT`, `LHR-CDG`.
2. Pick a **departure date**. Add a **return date** for a round trip.
3. Optionally set the cabin, passengers and stops.
4. Click **Start**, then download from the Output tab.

**Get both directions of a round trip:** set a return date and **"Return flights for the first N outbound options"**. Each outbound option you expand adds its return flights as rows with `direction: "return"`. Their price is the round-trip total for that pairing, and `outboundFlightNumbers` says which outbound they belong to.

**Find the cheapest day to fly:** set **"Flexible dates: search every day until"** and choose **Output → Cheapest per search**. You get one row per date with the cheapest and cheapest nonstop fare. Sort by `departureDate` and you have a price calendar. For round trips over a range of dates, set **Trip length (days)** instead of a return date.

#### Input example

```json
{
    "routes": ["ORD-DEN"],
    "departureDate": "2026-12-13",
    "departureDateTo": "2026-12-27",
    "tripLengthDays": 4,
    "output": "cheapest"
}
```

Dates also accept relative values like `"30 days"`, which is handy for scheduled runs.

### Output examples

**Every flight** (default), one row per option. Real output:

```json
{
    "route": "SEA-SFO",
    "departureDate": "2026-11-28",
    "tripType": "one-way",
    "cabinClass": "economy",
    "currency": "USD",
    "rank": 1,
    "isBest": true,
    "price": 220,
    "airlines": ["Frontier"],
    "flightNumbers": ["F9 1178", "F9 4593"],
    "departureTime": "2026-11-28T13:52",
    "arrivalTime": "2026-11-28T20:25",
    "durationMinutes": 393,
    "stops": 1,
    "layovers": [{ "airport": "LAX", "airportName": "Los Angeles International Airport", "city": "Los Angeles", "durationMinutes": 131 }],
    "legs": [
        { "flightNumber": "F9 1178", "departureAirport": "SEA", "arrivalAirport": "LAX", "departureTime": "2026-11-28T13:52", "arrivalTime": "2026-11-28T16:37", "durationMinutes": 165, "aircraft": "Airbus A320neo", "legroom": "28 inches" },
        { "flightNumber": "F9 4593", "departureAirport": "LAX", "arrivalAirport": "SFO", "departureTime": "2026-11-28T18:48", "arrivalTime": "2026-11-28T20:25", "durationMinutes": 97, "aircraft": "Airbus A321neo", "legroom": "28 inches" }
    ],
    "emissionsKg": 170,
    "emissionsVsTypicalPercent": -6,
    "priceLevel": "high",
    "typicalPrice": 94,
    "typicalPriceLow": 65,
    "typicalPriceHigh": 200,
    "sourceUrl": "https://www.google.com/travel/flights/search?tfs=GhoSCjIwMjYtMTEtMjhqBRIDU0VBcgUSA1NGT0IBAUgBmAEC&hl=en&gl=US&curr=USD",
    "scrapedAt": "2026-10-24T22:44:57.353Z"
}
```

**Cheapest per search**, one row per route and date. Real output, with the history shortened:

```json
{
    "route": "ORD-DEN",
    "departureDate": "2026-12-13",
    "returnDate": "2026-12-17",
    "tripType": "round-trip",
    "currency": "USD",
    "flightsFound": 17,
    "cheapestPrice": 110,
    "cheapestAirlines": ["Frontier"],
    "cheapestFlightNumbers": ["F9 1483"],
    "cheapestDepartureTime": "2026-12-13T07:25",
    "cheapestStops": 0,
    "cheapestNonstopPrice": 110,
    "fastestDurationMinutes": 166,
    "priceLevel": "low",
    "typicalPrice": 171,
    "typicalPriceLow": 115,
    "typicalPriceHigh": 325,
    "priceHistory": [{ "date": "2026-10-22", "price": 83 }, { "date": "2026-10-23", "price": 94 }, { "date": "2026-10-24", "price": 110 }],
    "sourceUrl": "https://www.google.com/travel/flights/search?tfs=…",
    "scrapedAt": "2026-10-24T22:45:07.035Z"
}
```

### Pricing

You pay per **search**: one route on one departure date (plus return date), with every flight option or the cheapest summary included.

| Apify plan | Price per search | 1,000 searches |
|---|---|---|
| Free | $0.004 | $4.00 |
| Starter (Bronze) | $0.002 | $2.00 |
| Scale and above | $0.0015 | $1.50 |

**Example:** a 30-day price calendar for one route is 30 searches, about $0.06 on Starter. A round trip with return flights for its 3 best outbound options is 4 searches.

- Searches that find no flights (e.g. a mistyped airport code) aren't charged.
- Proxies and platform usage are included.
- Set **Max cost per run** in the run options, and the scraper stops cleanly when it gets there.

### Good to know

- **Prices are totals.** They cover all passengers, and the whole trip for round trips, in the currency you choose, as Google shows them.
- **Round trips list outbound options priced as round trips,** like Google's first results page. Turn on return flights to get the return options for the outbound flights you choose. Each expanded outbound counts as one more search.
- **Times are local** at each airport and have no time zone, exactly as on the ticket.
- **Results are Google's results.** Airlines that don't share their fares with Google Flights won't appear.
- **Multi-city trips aren't supported yet.** Google loads those results differently.

### Use with AI agents (MCP)

This Actor works as a tool through the [Apify MCP server](https://mcp.apify.com) in Claude, ChatGPT, Cursor and other MCP clients. Every input field has a plain-English description. An agent call for "cheapest week to fly to Denver in December" looks like this:

```json
{ "routes": ["ORD-DEN"], "departureDate": "2026-12-01", "departureDateTo": "2026-12-31", "tripLengthDays": 4, "output": "cheapest" }
```

Cheapest-per-search output is compact, a few KB per date including price history, so it fits comfortably in an agent's context.

### FAQ

**How fresh are the prices?** Every run searches Google Flights live. Fares change often, so schedule runs (daily or hourly) to track a route.

**What do priceLevel and typicalPrice mean?** They're Google's own price insight: how today's cheapest fare compares with what this trip usually costs. `typicalPriceLow` and `typicalPriceHigh` are the typical range.

**What is priceHistory?** It's the daily lowest price Google tracked for that exact search over roughly the last 60 days, the data behind the "View price history" chart on Google Flights. Google doesn't have it for every search.

**Why is the cheapest flight not ranked 1?** `rank` follows Google's order, which puts its "best" flights (balancing price, duration and stops) first. Sort by `price` for the cheapest.

**Can I use city codes like NYC?** Use airport codes (JFK, EWR, LGA). To cover a city, add one route per airport.

**Is this allowed?** The scraper reads the same public search results anyone sees on google.com/travel/flights without logging in, and doesn't book anything. You're responsible for using the data in line with applicable laws and Google's terms. This Actor isn't affiliated with or endorsed by Google.

**Does the Actor send anything back to the developer?** At the end of each run it sends us a small usage record: how many of each billable event the run was charged, the prices it was charged at, your pricing tier, whether your plan is paid, and a one-way hash of your user ID. That's how we see which Actors are worth maintaining, because Apify doesn't share this with developers. Your input, your results and your account details are never sent.

**Something broke or looks wrong?** Open an issue on the Issues tab. Issues get a response within 48 hours.

# Changelog

This Actor's version history is a separate document: https://apify.com/sam_i_am_not/google-flights-scraper/changelog.md

# Actor input Schema

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

One route per line as two 3-letter airport codes: origin-destination, e.g. "JFK-LAX". Each route is searched for every departure date.

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

Date to fly out (local date at the origin airport), or a relative date like "30 days" from today. Google sells about 11 months ahead.

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

Optional. Set it for a round trip; prices are then round-trip totals. Leave empty for one-way.

## `returnFlights` (type: `integer`):

Round trips only. Google prices round trips as outbound options; set this to also fetch the matching return flights for the first N outbound options (in Google's order). Each expanded outbound counts as one more search. With output "Cheapest per search", the cheapest outbound is expanded so the row has the full cheapest itinerary.

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

Seat class to price.

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

Passengers aged 12 and over. Prices are the total for all passengers.

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

Passengers aged 2 to 11.

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

Under 2, with their own seat.

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

Under 2, on an adult's lap (at most one per adult).

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

Limit the number of stops.

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

Optional. Only show flights by these airlines, as 2-character airline codes (e.g. DL, UA, AA, B6, BA). Leave empty for all airlines.

## `departureDateTo` (type: `string`):

Optional. Searches every departure date from the departure date to this date (up to 62 days), one search per date per route. Use with output "Cheapest per search" to get a price calendar. For round trips over a range, set Trip length instead of Return date.

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

Optional. For round trips over a date range: return this many days after each departure date.

## `output` (type: `string`):

"Every flight" returns one row per flight option (about 15-35 per search). "Cheapest per search" returns one row per route and date with the cheapest and cheapest nonstop price, Google's price insight and 60-day price history: ideal for price calendars and monitoring.

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

Keep only the first N flights of each search in Google's order (best first). 0 = all.

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

Three-letter currency code for prices, e.g. USD, EUR, GBP, JPY.

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

Two-letter country Google prices the search from, e.g. US, GB, DE. Fares can differ by country.

## `maxConcurrency` (type: `integer`):

How many searches run in parallel.

## Actor input object example

```json
{
  "routes": [
    "JFK-LAX",
    "SFO-NRT",
    "LHR-CDG"
  ],
  "departureDate": "2026-12-10",
  "returnDate": "2026-12-17",
  "returnFlights": 0,
  "cabinClass": "economy",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "maxStops": "any",
  "airlines": [
    "DL",
    "AA"
  ],
  "output": "flights",
  "maxFlightsPerSearch": 0,
  "currency": "USD",
  "country": "US",
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Flights (one row per option) or cheapest-per-search rows, depending on the Output setting.

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

Counts of succeeded and failed searches, failure reasons, warnings and charged events.

# 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 days"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sam_i_am_not/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 days",
}

# Run the Actor and wait for it to finish
run = client.actor("sam_i_am_not/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 days"
}' |
apify call sam_i_am_not/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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