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

Scrape flight fares from Google Flights for any routes and dates: price, airlines, departure and arrival times, duration, stops and layovers, flight numbers, aircraft, legroom and CO2. One-way or round trip, any cabin and currency. From $1 per 1,000 flights.

- **URL**: https://apify.com/tacps126/google-flights.md
- **Developed by:** [Tapaswai Choudhary](https://apify.com/tacps126) (community)
- **Categories:** Travel, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 flights

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?

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

Get **flight fares from Google Flights** for any routes and dates as a clean dataset: **price**, airlines, departure and arrival times, **total duration**, **stops and layovers** (airport and minutes), every leg's **flight number**, aircraft and legroom, plus **CO2 emissions** against the typical flight. One-way or round trip, economy to first, any currency. Export to JSON, CSV or Excel, send to Google Sheets, or call it as an API.

**Built for** travel startups and agencies comparing fares, analysts tracking airfare by route and season, corporate travel teams, and deal hunters building fare calendars.

### Why this scraper

- **Many routes at once.** Every origin to every destination on every date you list.
- **Fare calendars.** List 30 dates and get the fares for each day.
- **Round trips.** Set a trip length in days; prices are for the whole trip.
- **Any cabin and currency.** Economy, premium economy, business or first; USD, EUR, INR and more.
- **Flight details.** Flight numbers, aircraft, legroom, layover airports and times.
- **Best flights marked.** Google's "best" options flagged.

### How to use it

1. Add **From**, **To** (airport codes or cities) and **Departure dates** (`2026-12-15`, or `+30` for 30 days from today, which keeps scheduled runs current).
2. Optionally set a round trip length, cabin, max stops and currency.
3. Press **Start**. Download results from the **Output** tab, or connect an integration.

```json
{
  "origins": ["JFK", "EWR"],
  "destinations": ["LHR", "CDG"],
  "departureDates": ["2026-12-15", "2026-12-16"],
  "tripLengthDays": 7,
  "cabin": "economy",
  "maxStops": 1,
  "currency": "USD"
}
```

### What you get

| Field | Description |
|-------|-------------|
| `price`, `currency`, `best` | Fare and currency; `best` marks Google's best options |
| `airlines` | Airlines on the itinerary |
| `from`, `to`, `departure`, `arrival` | Airports and local times (`2026-12-15T11:55`) |
| `durationMinutes`, `stops`, `layovers` | Total time, number of stops, `[{airport, airportName, city, minutes}]` |
| `legs` | `[{flightNumber, airline, from, to, departure, arrival, durationMinutes, aircraft, legroom}]` |
| `co2Kg`, `typicalCo2Kg` | Estimated emissions and the typical value for the route |
| `route`, `departureDate`, `returnDate`, `tripType`, `cabin` | What was searched |

Example (shortened):

```json
{
  "route": "JFK-LHR",
  "price": 349,
  "currency": "USD",
  "airlines": ["Delta"],
  "departure": "2026-12-15T11:55",
  "arrival": "2026-12-16T07:05",
  "durationMinutes": 850,
  "stops": 1,
  "layovers": [{ "airport": "MSP", "city": "Minneapolis", "minutes": 180 }],
  "legs": [
    { "flightNumber": "DL 2414", "from": "JFK", "to": "MSP", "aircraft": "Airbus A220-100 Passenger" },
    { "flightNumber": "DL 10", "from": "MSP", "to": "LHR", "aircraft": "Airbus A330-900neo" }
  ],
  "co2Kg": 667
}
```

### Pricing

Pay per result: about **$1 per 1,000 flight options** (lower on higher Apify plans) plus a small start fee. Filtered flights are free. See the **Pricing** tab for exact rates, and set a maximum charge per run to cap spend.

On Apify's **free plan** each run returns up to 100 flights. Any paid Apify plan removes the limit.

### FAQ

**How many options per search?** About 15 to 25, the list Google Flights shows for a route and date.

**Round-trip return flights?** Round-trip searches return the outbound options with the price of the whole trip.

**Booking links?** Not yet. Open an issue if you need them.

**Is it legal?** The Actor collects publicly shown fares. You're responsible for how you use the data under the laws that apply to you.

### Support

A route that returns nothing or a missing field? Open an issue on the **Issues** tab with your input and what you expected.

# Actor input Schema

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

Airport codes or cities to fly from (for example `JFK`, `New York`).

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

Airport codes or cities to fly to. Every origin is searched to every destination.

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

Dates as YYYY-MM-DD, or +N for N days from today (keeps scheduled runs current). Every route is searched on every date, handy for fare calendars.

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

For round trips, days between departure and return. 0 means one way. Round-trip prices are for the whole trip.

## `cabin` (type: `string`):

Cabin class.

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

Leave out flights with more stops than this (0 = nonstop only).

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

Three-letter currency code for prices (for example USD, EUR, INR).

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

Language for airport and airline names (two-letter code).

## `countryCode` (type: `string`):

Two-letter code of the country you search from; fares can differ by point of sale.

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

Maximum number of flight options to return in total.

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

Keep the default setting for reliable results.

## `debug` (type: `boolean`):

More detail in the run log.

## Actor input object example

```json
{
  "origins": [
    "JFK"
  ],
  "destinations": [
    "LHR"
  ],
  "departureDates": [
    "+30"
  ],
  "tripLengthDays": 0,
  "cabin": "economy",
  "currency": "USD",
  "language": "en",
  "countryCode": "us",
  "maxItems": 500,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debug": false
}
```

# Actor output Schema

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

The produced items (default 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 = {
    "origins": [
        "JFK"
    ],
    "destinations": [
        "LHR"
    ],
    "departureDates": [
        "+30"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tacps126/google-flights").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": ["JFK"],
    "destinations": ["LHR"],
    "departureDates": ["+30"],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tacps126/google-flights"
        }
    }
}
```

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/INaZw5sfnYmpkOvoT/builds/EKBmhZa6Qqy4ih42D/openapi.json
