# Google Flights Scraper — Fares, Multi-City & Price Calendar (`experthasan/google-flights-scraper`) Actor

Scrape Google Flights fares, schedules, multi-city itineraries and the cheapest-date price calendar. No API key, no headless browser.

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

## Pricing

from $10.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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Flights Scraper — Fares, Multi-City & Price Calendar

Pull live fares, schedules and cheapest-date data straight from Google Flights. No API key,
no Google Cloud project, no headless browser — the Actor talks to Google's own endpoints, so
searches are fast and cheap.

### What you get

| Action | What it returns |
| ------ | --------------- |
| **Flight search** | Every itinerary for a one-way or round-trip route: price, airlines, stop count, full segment list (airports, times, duration, aircraft type) and carbon emissions |
| **Multi-city search** | The same itinerary data across 2+ legs in a single trip |
| **Price calendar** | The cheapest fare for every departure date across a range — the Google Flights date grid |

Results land in the run's dataset and export to JSON, CSV, Excel, XML or via the API.

### Pricing

**$0.01 per search.** Flat. However many itineraries come back — 3 or 60 — one search is
one charge.

| You pay for | Price |
| ----------- | ----- |
| Flight search (one-way or round-trip) | **$0.01** |
| Multi-city search | **$0.02** |
| Price calendar range | **$0.03** |
| Actor start | $0.05 per 1,000 runs |

A typical search returns 20–40 itineraries, so this works out to about **$0.33 per 1,000
flights** — roughly 3× cheaper than per-result flight scrapers on Apify Store, and 20×
cheaper than other per-search Actors.

**Searches that return nothing are not charged.** Set a *maximum cost per run* in the run
options and the Actor stops cleanly the moment it gets there. Platform compute is included —
you are never billed separately for usage.

### Input

```json
{
  "action": "search",
  "searches": [
    { "origin": "JFK", "destination": "LAX", "date": "2026-09-10" },
    { "origin": "JFK", "destination": "LHR", "date": "2026-09-10", "returnDate": "2026-09-17" }
  ],
  "seat": "economy",
  "adults": 1,
  "currency": "USD"
}
```

Multi-city:

```json
{
  "action": "multi_city",
  "searches": [
    { "legs": [
      { "origin": "JFK", "destination": "LHR", "date": "2026-09-10" },
      { "origin": "LHR", "destination": "CDG", "date": "2026-09-14" },
      { "origin": "CDG", "destination": "JFK", "date": "2026-09-20" }
    ] }
  ]
}
```

Price calendar:

```json
{
  "action": "calendar",
  "searches": [
    { "origin": "JFK", "destination": "LAX", "startDate": "2026-09-01", "endDate": "2026-10-31" }
  ],
  "calendarTrip": "one-way"
}
```

| Field | Description |
| ----- | ----------- |
| `action` | `search`, `multi_city` or `calendar` |
| `searches` | One object per search. Batch them — one run with 50 searches beats 50 separate runs. |
| `seat` | `economy`, `premium-economy`, `business` or `first` |
| `adults` / `children` / `infantsInSeat` / `infantsOnLap` | Passenger counts |
| `maxStops` | Leave empty for any. `0` = nonstop only. |
| `currency` | ISO code for prices, e.g. `USD`, `EUR`, `GBP` |
| `tripDays` / `calendarTrip` | Calendar options — trip length and one-way vs round-trip |
| `proxyConfiguration` | Optional. Enable if you run many searches back to back. |
| `requestDelaySeconds` | Pause between Google requests (default 2) |

Any of the trip options can be set per search to override the global value.

### Output

One dataset item per itinerary:

```json
{
  "type": "flight",
  "trip": "one-way",
  "origin": "JFK",
  "destination": "LAX",
  "date": "2026-09-10",
  "price": 148,
  "currency": "USD",
  "airlines": ["JetBlue"],
  "stops": 0,
  "departure": "2026-09-10 08:15",
  "arrival": "2026-09-10 11:42",
  "duration": 387,
  "segments": [
    {
      "from_airport": { "code": "JFK", "name": "John F. Kennedy International" },
      "to_airport": { "code": "LAX", "name": "Los Angeles International" },
      "departure": "2026-09-10 08:15",
      "arrival": "2026-09-10 11:42",
      "duration_minutes": 387,
      "plane_type": "Airbus A321"
    }
  ],
  "carbon_emissions": { "emission_grams": 428000, "typical_on_route_grams": 455000 },
  "google_flights_url": "https://www.google.com/travel/flights?tfs=..."
}
```

Calendar items are `{"type": "calendar_price", "date": ..., "price": ...}`. Failed searches
are written as `{"type": "error", ...}` items rather than killing the run, and are not charged.

### Common uses

- Track fares on your routes daily and alert when a price drops
- Find the cheapest departure date across a whole month before booking
- Feed live fare data into a travel site, comparison tool or booking assistant
- Benchmark competitor pricing on the routes you sell
- Give an AI travel agent real fares (this Actor supports agentic payments via x402 and Skyfire)

### Integrations

Run on a schedule, or wire the output to Google Sheets, Airtable, Slack, Make, Zapier, or your
own webhook. Everything is reachable through the [Apify API](https://docs.apify.com/api/v2)
and the JavaScript and Python clients.

### Notes and limits

- This is an **unofficial scraper**. Google occasionally changes its internal response layout;
  when a parse comes back empty the Actor logs it and moves on rather than failing the run.
- For round-trip searches Google returns outbound options priced as complete round-trips —
  the same behaviour as the first step on the Google Flights website.
- The **price calendar** uses an undocumented internal endpoint and is marked experimental.
  It is the most likely of the three actions to drift when Google changes something.
- Prices are what Google shows for the query as sent; they can move between the search and
  a booking attempt.
- Scrape only public data and use the output in line with Google's terms and applicable law.

### Support

Found a bug or need a field that is not extracted yet? Open an issue on the Actor's **Issues**
tab.

# Actor input Schema

## `action` (type: `string`):

What to run. Each action bills a different event — see the Pricing tab.

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

One object per search. Shape depends on the action.

**search** — `{ "origin": "JFK", "destination": "LAX", "date": "2026-09-10", "returnDate": "2026-09-17" }` (omit `returnDate` for one-way).

**multi\_city** — `{ "legs": [ { "origin": "JFK", "destination": "LHR", "date": "2026-09-10" }, { "origin": "LHR", "destination": "CDG", "date": "2026-09-14" } ] }` (2 or more legs).

**calendar** — `{ "origin": "JFK", "destination": "LAX", "startDate": "2026-09-01", "endDate": "2026-10-31" }`.

Any per-search key overrides the global option of the same name.

## `seat` (type: `string`):

Cabin to price. Business and first return far fewer itineraries than economy.

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

Number of adult passengers (age 12+).

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

Number of child passengers (age 2–11).

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

Infants under 2 travelling in their own seat.

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

Infants under 2 travelling on an adult's lap.

## `maxStops` (type: `integer`):

Leave empty for any number of stops. 0 = nonstop only.

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

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

## `tripDays` (type: `integer`):

Only used by the `calendar` action when `calendarTrip` is round-trip. Return date = departure + this many days.

## `calendarTrip` (type: `string`):

Only used by the `calendar` action.

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

Optional. Enable a proxy if you run many searches back to back and start seeing blocked responses.

## `requestDelaySeconds` (type: `integer`):

Seconds to wait between consecutive Google requests.

## Actor input object example

```json
{
  "action": "search",
  "searches": [
    {
      "origin": "JFK",
      "destination": "LAX",
      "date": "2026-09-10"
    }
  ],
  "seat": "economy",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "currency": "USD",
  "tripDays": 7,
  "calendarTrip": "one-way",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "requestDelaySeconds": 2
}
```

# Actor output Schema

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

One item per itinerary: price, currency, airlines, stop count, full segment list with airports, times, duration and aircraft type, plus carbon emissions and a Google Flights link.

## `priceCalendar` (type: `string`):

The same dataset opened on the calendar view — the cheapest fare for each departure date across the requested range.

# 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": [
        {
            "origin": "JFK",
            "destination": "LAX",
            "date": "2026-09-10"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("experthasan/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": [{
            "origin": "JFK",
            "destination": "LAX",
            "date": "2026-09-10",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("experthasan/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": [
    {
      "origin": "JFK",
      "destination": "LAX",
      "date": "2026-09-10"
    }
  ]
}' |
apify call experthasan/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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