# Google Flights Scraper — Fares, Routes & Times (`hipersoft/google-flights-scraper`) Actor

Scrape flight options from Google Flights by route and date: airline, flight number, departure and arrival times, duration, stops, layovers and price. One-way or round-trip, any cabin and currency. For travel and price monitoring.

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

## Pricing

from $0.002 / flight scraped

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?

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, Routes & Times

Scrape flight options from **Google Flights** in bulk by route and date. Give the scraper an origin, a destination and a departure date, and it returns one clean row per flight option: airline, flight number, departure and arrival times, duration, number of stops, layover airports and price. Works for one-way and round-trip searches, any cabin class and any currency.

Ideal for **fare monitoring**, **travel price alerts**, route research, travel-agency tooling, data journalism and building your own flight-deal dashboards.

### What it does

- Search any route by **airport / metro IATA code** (`JFK`, `LON`, `SIN`) or major city name.
- One-way or **round-trip** (add a return date).
- Choose **cabin class**: economy, premium economy, business or first.
- Prices in the **currency** you want (USD, EUR, GBP, SGD, …).
- Structured output ready for Excel, Google Sheets, a database or an API.

### Input

| Field | Description |
|-------|-------------|
| `origin` | Departure airport/city — IATA code (e.g. `JFK`, `LON`) or major city name. |
| `destination` | Arrival airport/city — IATA code or major city name. |
| `departDate` | Outbound date, `YYYY-MM-DD`. |
| `returnDate` | Optional return date for a round-trip; leave empty for one-way. |
| `adults` | Number of adult passengers (1–9). |
| `cabinClass` | `economy`, `premium-economy`, `business` or `first`. |
| `currency` | 3-letter currency code (default `USD`). |
| `maxItems` | Maximum flight options to return. |

#### Example input

```json
{
  "origin": "JFK",
  "destination": "LON",
  "departDate": "2026-10-15",
  "adults": 1,
  "cabinClass": "economy",
  "currency": "USD",
  "maxItems": 30
}
```

### Output

Each dataset item is one flight option:

```json
{
  "tripType": "one-way",
  "airline": "British Airways",
  "flightNumber": "BA 178",
  "origin": "JFK",
  "destination": "LHR",
  "departTime": "2026-10-15T07:50",
  "arriveTime": "2026-10-15T19:45",
  "duration": "6h 55m",
  "stops": 0,
  "layovers": [],
  "price": 295,
  "currency": "USD",
  "url": "https://www.google.com/travel/flights?tfs=..."
}
```

| Field | Description |
|-------|-------------|
| `tripType` | `one-way` or `round-trip`. |
| `airline` | Operating airline(s) for the itinerary. |
| `flightNumber` | Flight number(s) across all segments. |
| `origin` / `destination` | Airport IATA codes. |
| `departTime` / `arriveTime` | Local departure / arrival timestamps. |
| `duration` | Total travel time. |
| `stops` | Number of stops (0 = nonstop). |
| `layovers` | Layover airport codes, in order. |
| `price` | Total price for the itinerary. |
| `currency` | Price currency. |
| `url` | Link to the search on Google Flights. |

### Common uses

- **Price monitoring** — schedule the Actor daily and track fares over time for a route.
- **Deal alerts** — trigger a notification when a route drops below a threshold.
- **Route research** — compare airlines, stops and durations across a corridor.
- **Travel tooling** — feed structured fares into your own app or spreadsheet.

### Integrations & n8n

Results are stored in a standard Apify dataset, so you can export them to **JSON, CSV, Excel or the API**, push them to Google Sheets, or wire them into automations.

- **n8n**: use the Apify node (or an HTTP Request node against the Apify API) to run this Actor and pull the dataset into your workflow — for example, run a daily fare check and post the cheapest option to Slack or email.
- **Make / Zapier**: trigger runs and read results the same way.
- **API**: start a run and fetch `dataset/items` programmatically.

### FAQ

**Can I monitor a route over time?**
Yes. Schedule the Actor to run on a cron and each run appends the current fares to a dataset you can chart.

**Do city names work?**
Major city names are accepted, but a 3-letter IATA airport or metro code (e.g. `JFK`, `LON`, `SIN`) gives the most reliable results.

**One-way or round-trip?**
Both. Add a `returnDate` for round-trip; omit it for one-way.

**How am I charged?**
Per flight option returned (pay-per-result). You only pay for the flights you actually get.

**Does it work with n8n?**
Yes — see the Integrations section above.

***

Original clean-room implementation. Not affiliated with, endorsed by, or sponsored by Google. "Google Flights" is a trademark of Google LLC; this Actor is an independent tool that collects publicly available flight information.

# Actor input Schema

## `origin` (type: `string`):

Departure airport or city. Use a 3-letter IATA airport or metro code (e.g. "JFK", "LON", "NYC") for the most reliable results; major city names (e.g. "New York", "London") are also accepted.

## `destination` (type: `string`):

Arrival airport or city. Use a 3-letter IATA airport or metro code (e.g. "LHR", "LON") for the most reliable results; major city names are also accepted.

## `departDate` (type: `string`):

Outbound date in YYYY-MM-DD format (e.g. 2026-10-15).

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

Return date in YYYY-MM-DD format for a round-trip search. Leave empty for a one-way search.

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

Number of adult passengers (1-9). Affects the fares Google returns.

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

Cabin to search: economy, premium-economy, business or first.

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

3-letter currency code for prices (e.g. USD, EUR, GBP, SGD).

## `maxItems` (type: `integer`):

Maximum number of flight options to return for the route.

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

Proxy configuration. Leave the default — it is tuned for reliable results.

## Actor input object example

```json
{
  "origin": "JFK",
  "destination": "LON",
  "departDate": "2026-10-15",
  "adults": 1,
  "cabinClass": "economy",
  "currency": "USD",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

The scraped flight options as dataset items.

# 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 = {
    "origin": "JFK",
    "destination": "LON",
    "departDate": "2026-10-15"
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/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 = {
    "origin": "JFK",
    "destination": "LON",
    "departDate": "2026-10-15",
}

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

```

## MCP server setup

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