# Google Flights Scraper & Price Tracker - $2/1K Searches (`zhyou/google-flights-scraper`) Actor

$2 per 1,000 searches, all fares included. Track Google Flights prices: monitor mode returns only fares that are new or changed since the last run, with the previous price. Many routes x dates per run, Google's low/typical/high price level, airlines, flight numbers, stops, layovers, CO2.

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

## Pricing

from $2.00 / 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.

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 & Price Tracker

Get Google Flights fares for many routes and dates in one run, and track price changes on a schedule. **$2 per 1,000 searches**, with every fare of a search included. Built for fare monitoring, travel deal sites, price research and AI agents.

- **Every itinerary Google shows**, including the "Best" flights: price, airlines, flight numbers, departure and arrival times, duration, stops, layovers, aircraft, legroom and CO2.
- **Google's price insights** on every row: whether today's price is low, typical or high, and the typical price range for the route.
- **Monitor mode (price tracker)**: schedule the Actor and get only fares that are new or whose price changed since the last run, with the previous price. No diffing on your side.
- **Round trips with return flights**: optionally get the return options for the first N outbound flights, priced as Google prices the whole round trip.
- **Bulk**: many routes × many dates (plus "also search the next N days") in one run.
- **Pay per search, not per row**: $0.002 per search (one route on one date), however many itineraries it returns. On a busy route (30-40 itineraries) that is about $0.05-0.07 per 1,000 itineraries.

### What you get

One row per itinerary:

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "2026-12-10",
  "returnDate": null,
  "dateSpec": "2026-12-10",
  "tripType": "one-way",
  "direction": "outbound",
  "outboundFlightNumbers": null,
  "outboundDeparture": null,
  "cabinClass": "economy",
  "currency": "USD",
  "price": 205,
  "priceLevel": "typical",
  "lowestPrice": 205,
  "typicalPriceLow": 75,
  "typicalPriceHigh": 320,
  "rank": 1,
  "isBest": true,
  "airlines": ["American"],
  "airlineCodes": ["AA"],
  "flightNumbers": ["AA 1"],
  "departure": "2026-12-10T09:00",
  "arrival": "2026-12-10T12:19",
  "durationMinutes": 379,
  "stops": 0,
  "layovers": [],
  "legs": [
    {
      "from": "JFK", "to": "LAX",
      "departure": "2026-12-10T09:00", "arrival": "2026-12-10T12:19",
      "durationMinutes": 379, "airline": "American", "flightNumber": "AA 1",
      "aircraft": "Boeing 777", "legroom": "31 in", "co2Grams": 287199
    }
  ],
  "co2Grams": 287000,
  "typicalCo2Grams": 344000,
  "co2DiffPercent": -17,
  "googleFlightsUrl": "https://www.google.com/travel/flights/search?tfs=...",
  "scrapedAt": "2026-10-18T07:02:11+00:00"
}
```

In monitor mode each row also has `monitorStatus` (`new` or `changed`) and `previousPrice`.

`dateSpec` is the departure date as you entered it (`2026-12-10`, or `+30` for a relative date). For round trips with return flights, return rows have `direction: "return"`, the chosen outbound flight in `outboundFlightNumbers` and `outboundDeparture`, and the return flight's details in the usual fields. `price` on a return row is the total round-trip price for that outbound + return pair.

Times are local airport times. A connecting itinerary lists each flight in `legs` and each stop in `layovers` (with layover minutes and whether you change airports).

### How to use

1. Add routes as IATA codes, one per line: `JFK-LAX`, `LHR-NYC`, `SFO-NRT`. City codes such as `NYC`, `LON` and `TYO` cover all their airports.
2. Add one or more departure dates: `YYYY-MM-DD`, or `+N` for N days from the day of the run (e.g. `+30`). To find the cheapest day, set **Also search the following days**, e.g. 14 to search two weeks.
3. Optional: trip type, return after N days, return flights for the first N outbound options, cabin, passengers, stops, airlines or alliances (`AA`, `STAR_ALLIANCE`), currency, language, point-of-sale country.
4. Run, then download the dataset as JSON, CSV, Excel or via the API.

#### Return flights

A round-trip search lists outbound flights, each with the cheapest round-trip total. To see the return options, set **Return flights for the first N outbound options** (0-10). For each of the first N outbound itineraries (in Google's order) the Actor opens Google's return list for that outbound flight and adds one row per return itinerary, with the round-trip total as `price`. Each lookup is one more search. It is ignored for one-way trips.

#### Track fares over time

Turn on **Monitor mode**, pick a **Monitor key** (e.g. `nyc-la-december`) and schedule the Actor daily. The first run returns everything; later runs return only itineraries that are new or changed price.

- **Fixed dates** (`2026-12-10`) track one trip: the same flights on the same day, run after run.
- **Relative dates** (`+30`) track the price N days ahead, compared day to day: today's run looks at flights 30 days from today and compares each flight (same flight numbers and departure time) with the previous run's flights 30 days ahead of that run, even though the calendar date is different. A "changed" row means the fare for "this flight, 30 days out" moved. With **Also search the following days**, `+30` and 2 extra days are tracked as `+30`, `+31` and `+32`.

Return flights are tracked separately for each chosen outbound flight. Use a different key for each independent watch list, and don't run two runs with the same key at the same time (the later one would overwrite the other's baseline). Connect the dataset to email, Slack, Make, n8n or Zapier to get alerts.

#### Input example

```json
{
  "routes": ["JFK-LAX", "SFO-NRT"],
  "departureDates": ["2026-12-10"],
  "additionalDays": 6,
  "tripType": "round-trip",
  "returnAfterDays": 7,
  "returnFlightsFor": 2,
  "cabinClass": "economy",
  "adults": 1,
  "maxStops": "1",
  "currency": "USD",
  "monitorMode": true,
  "monitorKey": "winter-trips"
}
```

That is 2 routes × 7 dates = 14 searches, plus 2 return-flight lookups for each = 42 searches at most.

**Code examples:** runnable Python and Node.js scripts for this Actor (scheduled runs, CSV export, cost caps) are in [github.com/zhyouhh/apify-travel-and-app-data-examples](https://github.com/zhyouhh/apify-travel-and-app-data-examples).

### Pricing

**$0.002 per completed search** (one route on one date) = $2 per 1,000 searches, however many itineraries it returns, plus $0.00005 per run start. Each return-flight lookup counts as one search. Proxy and compute are included. A search or lookup that fails after retries is not charged.

Example: watching 10 routes × 14 dates once a day is 140 searches a day, about $8.40 a month. Set a maximum cost per run in the run options and the Actor stops when it is reached (return-flight lookups stop too).

### Good to know

- **Round trips**: by default you get the outbound list, each priced as the cheapest round trip with that outbound flight. Return flights are only fetched for the first N outbound options you ask for, not for every combination.
- **Missing prices**: some carriers (often low-cost ones) show no fare on Google Flights. Those itineraries are kept with `price: null`.
- **Price insights** (`priceLevel`, typical range, `priceHistory`) are only present when Google shows them for the search.
- Fares are what Google shows at scrape time for the chosen currency and point of sale; booking sites may differ.
- Proxy: US datacenter proxies work well and are the default. Switch to residential only if you see many failed searches.

### FAQ

**Is there an official Google Flights API?** No public one. This Actor reads the same results page you see in the browser.

**How many itineraries per search?** Everything Google's results page lists: usually 10-40 (33 for New York-Los Angeles). Google's full list behind "View more flights" can be longer (80+ on busy domestic routes); those extra itineraries are not included. In our New York-Los Angeles check all 48 extras had stops, took longer and none was cheaper than the cheapest fare returned here.

**Can I use it from an AI agent?** Yes. Call it through the Apify API or Apify MCP server with routes and dates; output is flat, predictable JSON.

This Actor is not affiliated with or endorsed by Google.

# Actor input Schema

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

Origin-destination pairs as IATA airport or city codes, one per line, e.g. JFK-LAX or NYC-LON.

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

One or more departure dates: YYYY-MM-DD, or +N for N days from the day the Actor runs (e.g. +30; handy for scheduled monitoring). Every route is searched on every date.

## `additionalDays` (type: `integer`):

Search each departure date plus this many following days, to find the cheapest day. 0 = only the listed dates.

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

Round trip lists outbound options priced as a round trip (Google's first results page). To also get return flights, set Return flights for.

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

Round trip only: return date = departure date + this many days.

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

For round trips, also fetch the return flights for the first N outbound itineraries (Google's order). Each costs one extra search. Ignored for one-way.

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

Cabin to search.

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

Number of adult passengers (12+). Up to 9 passengers in total.

## `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 sitting on an adult's lap.

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

Maximum number of stops per direction.

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

Optional. Only show these airlines (2-letter IATA codes, e.g. AA, DL) or alliances (ONEWORLD, SKYTEAM, STAR_ALLIANCE).

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

ISO currency code, e.g. USD, EUR, GBP.

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

Google language code, e.g. en-US, de, es.

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

Optional 2-letter country code (Google's gl parameter). Fares can differ by country.

## `maxItinerariesPerSearch` (type: `integer`):

0 = all itineraries Google shows (usually 10-100).

## `monitorMode` (type: `boolean`):

Remembers fares between runs (per monitor key). Schedule the Actor and get only itineraries that are new or whose price changed, with previousPrice.

## `monitorKey` (type: `string`):

Name of the watch list. Use different keys for independent schedules.

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

Add Google's ~60-day lowest-price history for the route and date to every row.

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

How many searches run in parallel. Lower it if you see many failed searches.

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

Apify Proxy datacenter IPs in the US work well. Switch to residential only if you see many failures.

## Actor input object example

```json
{
  "routes": [
    "JFK-LAX"
  ],
  "departureDates": [
    "+30"
  ],
  "additionalDays": 0,
  "tripType": "one-way",
  "returnAfterDays": 7,
  "returnFlightsFor": 0,
  "cabinClass": "economy",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "maxStops": "any",
  "currency": "USD",
  "language": "en-US",
  "maxItinerariesPerSearch": 0,
  "monitorMode": false,
  "monitorKey": "default",
  "includePriceHistory": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `fares` (type: `string`):

One row per itinerary.

# 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"
    ],
    "departureDates": [
        "+30"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhyou/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"],
    "departureDates": ["+30"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("zhyou/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"
  ],
  "departureDates": [
    "+30"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  }
}' |
apify call zhyou/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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