# Google Flights Scraper (`logical_vivacity/google-flights-scraper`) Actor

- **URL**: https://apify.com/logical\_vivacity/google-flights-scraper.md
- **Developed by:** [Logical Vivacity](https://apify.com/logical_vivacity) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 — Fares, Schedules, Stops & Airlines

**Every flight on a route, with the fare and the details that decide whether it's worth it.**

Give it a route and a date — `JFK-LIS 2026-11-12` — or two dates for a round trip. This Actor returns every itinerary Google Flights shows: the fare, the airlines, every flight number, departure and arrival times, stops and layovers (city, length, whether you change airport), total duration, aircraft, legroom and CO₂. Put as many routes in one run as you like.

Each route also gets a **summary row**: the lowest, median and highest fare, the cheapest itinerary, the cheapest nonstop, the fastest, and every airline flying it.

**You pay per itinerary returned.** Routes with no flights, invalid lines and searches that fail cost you nothing.

***

### Try it in 30 seconds

Put these in **Routes**, leave everything else alone, hit Start:

```
JFK-LIS 2026-11-12
SFO-NRT 2026-12-05 2026-12-19
```

One way to Lisbon, and a round trip to Tokyo — one table out, with a summary row for each.

***

### Writing routes

One per line, 3-letter airport codes:

| Line | Means |
|---|---|
| `JFK-LIS 2026-11-12` | One way |
| `JFK-LIS 2026-11-12 2026-11-20` | Round trip (also `2026-11-12/2026-11-20`) |
| `JFK,EWR-LHR 2026-12-01` | From either New York airport |
| `LHR-CDG,ORY 2026-11-20` | To either Paris airport |
| `JFK to LIS 2026-11-12` | `to` works as well as `-` |

A line that doesn't parse comes back as `invalid_input` with a message saying how to fix it — and isn't charged.

***

### What you get per itinerary

A real row — JFK to Lisbon, 12 November, one adult, in USD:

```jsonc
{
  "route": "JFK-LIS 2026-11-12",
  "tripType": "one_way",
  "position": 1,
  "price": 292,
  "currency": "USD",
  "airlines": ["LEVEL", "Vueling"],
  "stops": 1,
  "totalDurationMinutes": 730,
  "departureTime": "2026-11-12T23:45",
  "arrivalTime": "2026-11-13T16:55",
  "legs": [
    { "flightNumber": "LL 2628", "airline": "LEVEL", "from": "JFK", "to": "BCN",
      "departureTime": "2026-11-12T23:45", "arrivalTime": "2026-11-13T13:10", "durationMinutes": 445 },
    { "flightNumber": "VY 1148", "airline": "Vueling", "from": "BCN", "to": "LIS",
      "departureTime": "2026-11-13T15:50", "arrivalTime": "2026-11-13T16:55", "durationMinutes": 125,
      "legroom": "29 inches" }
  ],
  "layovers": [
    { "airport": "BCN", "city": "Barcelona", "durationMinutes": 160, "changeOfAirport": false }
  ],
  "co2TypicalGrams": 486000,
  "isCheapest": true,
  "googleFlightsUrl": "https://www.google.com/travel/flights/search?tfs=…",
  "status": "ok"
}
```

**Round trips** carry the return too — `returnLegs`, `returnLayovers`, `returnDepartureTime`, `returnArrivalTime`, `returnStops` — and the `price` is the **whole trip**, both ways.

#### The summary row

A real one, from the same route priced in euros — 121 itineraries found:

```jsonc
{
  "rowType": "summary",
  "route": "JFK-LIS 2026-11-12",
  "itinerariesFound": 121,
  "currency": "EUR",
  "lowestPrice": 255, "medianPrice": 421, "highestPrice": 2349,
  "cheapest":        { "price": 255, "airlines": ["LEVEL", "Vueling"], "stops": 1, "flightNumbers": ["LL 2628", "VY 1148"] },
  "cheapestNonstop": { "price": 352, "airlines": ["Tap Air Portugal"], "stops": 0, "flightNumbers": ["TP 210"] },
  "fastest":         { "price": 405, "airlines": ["Delta"], "stops": 0 },
  "nonstopCount": 2,
  "airlinesServing": ["Aer Lingus", "Air Europa", "Air France", "…"]
}
```

The cheapest nonstop costs €97 more than the cheapest one-stop — that's the trade-off in one row.

***

### Who uses this

**Fare trackers and deal newsletters** — the same routes every day, summary rows only, and you have a price history to alert on.

**Travel agencies and corporate travel** — every option on a client's route in one table, filtered by cabin and stops, in their currency.

**Airline and airport analysts** — who flies a route, how many nonstops, how fares spread across carriers and dates.

**Travel apps and AI travel agents** — structured itineraries with flight numbers and times, ready to show or reason over.

**Researchers** — fares and emissions across routes and seasons, collected on a schedule.

***

### What makes it different

**The real airline names.** Airline codes get reassigned. Code "LL" belonged to Miami Air International, which closed in 2020; today it's LEVEL. Many tools still name it from an old table. This Actor takes the name from Google Flights' own listing, so the row says who you'd actually fly.

**Round trips as complete itineraries.** Outbound and return together, with the fare for the whole trip. Many tools return only the outbound and a price you can't pair with a flight home.

**Many routes, one run.** One route per line, with each line checked. A typo fails that line with an explanation; the other routes still run.

**A summary row per route.** Cheapest, cheapest nonstop, fastest and the median — the answer, not just the data.

**Every leg and layover.** Flight numbers, times, aircraft, legroom, layover city and length, and a flag when a connection means changing airports.

***

### Settings that matter

| Setting | What it does |
|---|---|
| **Routes** | One per line — `ORIGIN-DESTINATION DATE`, plus a return date for a round trip |
| **Adults / Children** | The fare covers the whole party |
| **Cabin** | Economy, premium economy, business or first |
| **Stops** | Any, nonstop only, 1 or fewer, 2 or fewer |
| **Currency** | 30 currencies |
| **Order** | Google's "best", cheapest, shortest, departure or arrival time (one-way) |
| **Maximum itineraries per route** | Default 50 |
| **Include a summary row** | On by default. One row per route, charged once |

Connection handling, pacing, retries and blocking are managed for you — there's nothing to configure and no proxy to set up.

### Automate it

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~google-flights-scraper/runs?token=YOUR_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{ "routes": ["JFK-LIS 2026-11-12", "JFK-LIS 2026-11-19", "JFK-LIS 2026-11-26"],
        "cabinClass": "economy", "maxStops": "oneStop",
        "currency": "USD", "maxResultsPerRoute": 20 }'
```

Works with Make, Zapier, n8n, Google Sheets and the Apify API, and as an MCP tool for AI agents. Put the same route on several dates and the summary rows are a fare calendar.

### Row statuses

| `status` | Meaning |
|---|---|
| `ok` | An itinerary (or a summary) was returned — charged |
| `not_found` | No flights match this route, date and filters — not charged |
| `invalid_input` | The line couldn't be read, or the date is in the past — not charged |
| `error` | Temporarily unreachable — retry that route; not charged |

### FAQ

**Can I search by city instead of airport?**
Use the airport codes, comma-separated, for a city with several airports: `JFK,EWR,LGA-LHR,LGW 2026-12-01`.

**How many round-trip itineraries do I get?**
Round trips are priced per outbound choice. This Actor opens the cheapest outbound options and returns every return flight that pairs with each, as complete itineraries sorted by total price.

**Are the fares live?**
Yes. Each run fetches current fares for the dates you set. Fares move constantly, so every row records when it was captured.

**Why is a fare sometimes missing?**
Google Flights occasionally lists a flight without a bookable fare. It's still returned, with an empty price, rather than dropped.

**Do I need a Google account or API key?**
No.

***

### Terms of Use

This Actor collects publicly available information shown on Google Flights — fares and schedules that anyone can see without signing in.

You are responsible for using the results lawfully and in line with the applicable terms and regulations in your jurisdiction, including rules on competition, consumer protection and the reuse of commercial data.

Fares change continuously and differ by market, device and account. The data is provided without warranty of accuracy, completeness or fitness for a particular purpose — confirm the final fare with the airline or booking site before relying on it. This Actor is not affiliated with, endorsed by, or sponsored by Google or any airline.

***

*Missing a field or a filter you need?* Open an issue on the Actor's Issues tab.

# Actor input Schema

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

One per line: ORIGIN-DESTINATION DATE, using 3-letter airport codes. Add a second date for a round trip. Several airports on one side are allowed, separated by commas.

JFK-LIS 2026-11-12 — one way
JFK-LIS 2026-11-12 2026-11-20 — round trip
JFK,EWR-LHR 2026-12-01 — either New York airport

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

Fares are for the whole party.

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

Passengers aged 2 to 11. Fares shown cover everyone travelling.

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

The cabin to price. Premium cabins often have far fewer options on a route.

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

Limit connections. Nonstop only can return nothing on routes no airline flies direct.

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

Every fare in the results is quoted in this currency.

## `sortBy` (type: `string`):

How one-way results are ranked. Round trips always come cheapest first.

## `maxResultsPerRoute` (type: `integer`):

A busy route has 100+ options. 50 covers everything a traveller would realistically consider.

## `includeSummary` (type: `boolean`):

One extra row per route, charged once: the lowest, median and highest fare, the cheapest itinerary, the cheapest nonstop, the fastest, and every airline serving the route. Built from every itinerary found, not only the ones returned — the row a fare tracker wants.

## Actor input object example

```json
{
  "routes": [
    "JFK-LIS 2026-11-12",
    "SFO-NRT 2026-12-05 2026-12-19"
  ],
  "adults": 1,
  "children": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "currency": "USD",
  "sortBy": "best",
  "maxResultsPerRoute": 50,
  "includeSummary": true
}
```

# Actor output Schema

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

Every itinerary found, with fare, airlines, times, stops and legs.

## `overview` (type: `string`):

The same rows as a spreadsheet-style table, with the most useful columns first.

# 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-LIS 2026-11-12",
        "SFO-NRT 2026-12-05 2026-12-19"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("logical_vivacity/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-LIS 2026-11-12",
        "SFO-NRT 2026-12-05 2026-12-19",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("logical_vivacity/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-LIS 2026-11-12",
    "SFO-NRT 2026-12-05 2026-12-19"
  ]
}' |
apify call logical_vivacity/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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