# Google Flights Scraper API 💰$10/1k searches (`flyingnimbus/google-flights-scraper`) Actor

Flight prices and schedules from Google Flights for many routes and dates at once: airlines, flight numbers, times, stops, aircraft, emissions. One-way and round trip. Pay per search; failed or empty searches are free.

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

## Pricing

$10.00 / 1,000 flight search with results

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

Collects flight prices and schedules from Google Flights for any routes and dates. You get one dataset row per search, containing every flight Google shows for it: price, airline, flight numbers, departure and arrival times, duration, stops and layovers, aircraft, legroom, amenities and CO2 emissions.

#### Why this one

- **Many routes in one run.** Every origin is combined with every destination and every date, so `["YYZ","JFK"] × ["LAX","MIA"] × 2 dates` gives 8 searches.
- **Round trips.** Set a `returnDate`, or set `tripLengthDays` to get "N days later" for each departure date. Round-trip results pair an outbound with a return and give the total price.
- **Fast.** No browser is involved. In our tests, 24 searches (355 flights) finished in under 10 seconds.
- **You only pay for results.** Failed searches, unknown airport codes and searches with no results are returned with a status flag and are **not charged**.

#### Input

| Field | Example | Notes |
|---|---|---|
| `origins` | `["YYZ"]` | IATA codes |
| `destinations` | `["LAX","JFK"]` | IATA codes |
| `departureDates` | `["2026-12-10"]` | YYYY-MM-DD |
| `returnDate` | `2026-12-17` | Optional: makes the search a round trip |
| `tripLengthDays` | `7` | Optional: return N days after each departure |
| `adults`, `children` | `1`, `0` | |
| `cabinClass` | `economy` | `economy`, `premium_economy`, `business`, `first` |
| `maxStops` | `any` | `any`, `nonstop`, `max_1`, `max_2` |
| `sortBy` | `best` | `best`, `cheapest`, `duration`, `departure_time`, `arrival_time`, `emissions` |
| `currency` / `country` / `language` | `USD` / `US` / `en` | |
| `roundTripOptions` | `3` | Number of outbound flights to pair with returns (1–10) |

#### Output (one row per search)

```json
{
  "origin": "YYZ", "destination": "LAX", "departureDate": "2026-11-10", "tripType": "one_way",
  "status": "ok", "resultCount": 9, "cheapestPrice": 224, "currency": "USD",
  "flights": [{
    "price": 224, "duration": 334, "stops": 0, "primary_airline": "Air Canada",
    "co2_emissions_g": 300000, "emissions_tag": "lower",
    "legs": [{"airlineCode": "AC", "flight_number": "789", "departureAirportCode": "YYZ", "arrivalAirportCode": "LAX",
              "departure_datetime": "2026-11-10T14:05:00", "arrival_datetime": "2026-11-10T16:39:00",
              "aircraft": "Airbus A321", "legroom": "31 inches"}]
  }]
}
```

For round trips, each item in `flights` is `{ "price": total, "outbound": {...}, "return": {...} }`.

`status` is `ok`, `no_results` (not charged) or `failed` (not charged, includes `error`).

#### Pricing

Pay per event: you are charged once per search that returns flights, no matter how many flights it contains. There is no start fee.

#### Notes and limits

- The scraper returns the itineraries Google shows on the results page. Usually that is 5–30 per search; Google shows fewer for some premium-cabin or child/infant searches.
- Prices are whatever Google displays at the time of the run. They are not a booking quote.
- Built on the open-source [`fli`](https://github.com/punitarani/fli) library (MIT).

### More actors by flyingnimbus

All pay-per-event and fast. Failed or empty runs are free:

- [Google Trends](https://apify.com/flyingnimbus/google-trends-scraper)
- [Google Hotels](https://apify.com/flyingnimbus/google-hotels-scraper)
- [AI Search Visibility Tracker](https://apify.com/flyingnimbus/ai-search-visibility-tracker)
- [Google Ads Transparency](https://apify.com/flyingnimbus/google-ads-transparency-scraper)
- [Google Jobs](https://apify.com/flyingnimbus/google-jobs-scraper)
- [Google Shopping](https://apify.com/flyingnimbus/google-shopping-scraper)
- [Career Site Jobs](https://apify.com/flyingnimbus/career-site-jobs-scraper)
- [YouTube Search](https://apify.com/flyingnimbus/youtube-search-intelligence-scraper)
- [Hacker News](https://apify.com/flyingnimbus/hackernews-intelligence-scraper)

# Actor input Schema

## `origins` (type: `array`):

IATA airport codes, e.g. YYZ, JFK. Every origin is combined with every destination and date.

## `destinations` (type: `array`):

IATA airport codes, e.g. LAX, LHR.

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

One or more dates, YYYY-MM-DD.

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

Optional, YYYY-MM-DD. Makes it a round trip.

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

Optional. Round trip returning N days after each departure date (overrides Return date).

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

Number of adult passengers.

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

Number of children.

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

Seat class.

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

Maximum stops.

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

Result ordering.

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

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

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

Market country code (gl), e.g. US, CA.

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

Interface language (hl).

## `maxResultsPerSearch` (type: `integer`):

Cap on flights returned per search.

## `roundTripOptions` (type: `integer`):

For round trips: how many outbound flights to price with return options (1-10). Each costs one extra page fetch.

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

How many searches run at once.

## `maxRetries` (type: `integer`):

Retries per search on a fresh proxy session.

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

Apify Proxy recommended.

## Actor input object example

```json
{
  "origins": [
    "YYZ"
  ],
  "destinations": [
    "LAX"
  ],
  "departureDates": [
    "2026-12-10"
  ],
  "adults": 1,
  "children": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "sortBy": "best",
  "currency": "USD",
  "country": "US",
  "language": "en",
  "maxResultsPerSearch": 50,
  "roundTripOptions": 3,
  "maxConcurrency": 3,
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per search with all flights found.

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

No description

# 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 = {
    "origins": [
        "YYZ"
    ],
    "destinations": [
        "LAX"
    ],
    "departureDates": [
        "2026-12-10"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("flyingnimbus/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 = {
    "origins": ["YYZ"],
    "destinations": ["LAX"],
    "departureDates": ["2026-12-10"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("flyingnimbus/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 '{
  "origins": [
    "YYZ"
  ],
  "destinations": [
    "LAX"
  ],
  "departureDates": [
    "2026-12-10"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call flyingnimbus/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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