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

Scrape Google Flights prices for any route and date: airlines, flight numbers, departure and arrival times, duration, stops and layovers, price, cabin and CO2 emissions. One-way or round trip, any currency. A flight price tracker and Google Flights API alternative.

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

## Pricing

from $1.00 / 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.

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

Scrape **Google Flights** prices for any route and date and export them as JSON, CSV or Excel. For each search the **Google Flights Scraper** saves every flight option Google lists: **airlines, flight numbers, departure and arrival airports and times, duration, stops and layovers, price**, cabin class and **CO2 emissions**. One-way or round trip, 1–9 adults, economy to first class, prices in any currency. Use it as a **flight price tracker**, to build **flight price history**, compare airlines on a route or feed travel apps, like a **Google Flights API**. No Google account or API key needed.

### ✨ Features

- 🗺️ **Many routes per run**: one search per route and date; airport codes (`JFK`), city codes (`NYC`, `LON`) or city names (`New York`).
- 💲 **Every row priced**: the price for all passengers in the currency you pick (USD, EUR, GBP, PLN...).
- 🔁 **One-way or round trip**: add a return date for round-trip prices.
- 🧭 **Full itinerary**: each leg with flight number, aircraft, legroom and times; layovers with airport and waiting time.
- 🌱 **Emissions**: CO2 of the flight, the typical CO2 for the route and the difference in %.
- ⭐ **Best flights flag**: `isBest` marks the flights Google shows at the top as "best".
- 📅 **Relative dates**: a departure date can be "30" (days from today), so a scheduled run never goes stale.

### 🛠️ How It Works

1. **Add your searches**: from, to and dates for each route.
2. **Pick the passengers, cabin class and currency.**
3. **Run the Scraper**, or schedule it daily as a flight price tracker, and download the flights as JSON, CSV or Excel.

### ⚙️ Input

| Field                      | What it does                                                                                                                         |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **Flight searches**        | One object per route: `from`, `to`, `departureDate` (YYYY-MM-DD or days from today; empty = 30 days from today), optional `returnDate`. Default JFK → LAX. |
| **Adults**                 | Passengers (1–9). Prices are the total for all of them. Default 1.                                                                 |
| **Cabin class**            | `economy`, `premium_economy`, `business` or `first`. Default economy.                                                               |
| **Currency**               | Three-letter code for the prices. Default USD.                                                                                       |
| **Max flights per search** | Flights saved per search. Default 50.                                                                                                |

`adults` and `cabin` can also be set inside a search to override the defaults.

```json
{
    "searches": [
        { "from": "JFK", "to": "LAX", "departureDate": "2026-12-03" },
        { "from": "London", "to": "Barcelona", "departureDate": "2026-12-10", "returnDate": "2026-12-17", "adults": 2 },
        { "from": "SFO", "to": "NRT", "departureDate": "30", "cabin": "business" }
    ],
    "currency": "USD",
    "maxItems": 50
}
```

#### How many flights per search?

Google Flights lists about **10–50 flight options per search** (about 22 on average in our tests over 12 routes), and the Actor saves all of them up to your limit. For a round trip, each row is an outbound flight with the **round-trip price**; Google picks the return flight after you choose the outbound one. A search with no flights (a route nobody flies on that date) is listed in the run's status message and costs nothing.

### 🔍 Use cases

- **Flight price tracker**: schedule a daily run for your routes and get the cheapest fares over time, like Google Flights price alerts but in your own sheet or database.
- **Flight price history**: store every run and chart how fares move as the date gets closer.
- **Airline and route research**: who flies a route, how often, nonstop or with which layovers, and at what price.
- **Travel apps and agents**: feed fresh flight options to a booking tool, chatbot or AI travel assistant.
- **Emissions reporting**: compare CO2 per itinerary for corporate travel policies.

### 💰 Pricing

Pay only for the flights you get. No monthly rental.

| Event           | Price                               | What you get                                  |
| --------------- | ----------------------------------- | --------------------------------------------- |
| **Flight**      | $0.001 per flight ($1 per 1,000)    | One flight option with all fields below       |
| **Actor start** | $0.00005 per run                    | Charged once when the run starts.             |

Examples: 1 search (about 22 flights) ≈ $0.022 · 100 routes ≈ $2.20 · a daily tracker for 10 routes ≈ $6.60 per month.

### 📊 Sample Output Data

```json
{
    "from": "JFK",
    "to": "LAX",
    "departureDate": "2026-11-20",
    "returnDate": null,
    "tripType": "one-way",
    "adults": 1,
    "cabin": "economy",
    "position": 1,
    "isBest": true,
    "airlines": ["American"],
    "flightNumbers": ["AA171"],
    "departureAirport": "JFK",
    "departureAirportName": "John F. Kennedy International Airport",
    "departureTime": "2026-11-20T06:00",
    "arrivalAirport": "LAX",
    "arrivalAirportName": "Los Angeles International Airport",
    "arrivalTime": "2026-11-20T09:22",
    "durationMinutes": 382,
    "stops": 0,
    "layovers": [],
    "price": 205,
    "currency": "USD",
    "emissionsKg": 274,
    "typicalEmissionsKg": 344,
    "emissionsDiffPercent": -20,
    "legs": [
        {
            "flightNumber": "AA171",
            "airline": "American",
            "departureAirport": "JFK",
            "departureTime": "2026-11-20T06:00",
            "arrivalAirport": "LAX",
            "arrivalTime": "2026-11-20T09:22",
            "durationMinutes": 382,
            "aircraft": "Boeing 787",
            "legroom": "31 in"
        }
    ],
    "googleFlightsUrl": "https://www.google.com/travel/flights?tfs=Gh4SCjIwMjYtMTEtMjBqBwgBEgNKRktyBwgBEgNMQVhAAUgBmAEC&hl=en&gl=us&curr=USD"
}
```

- Times are local airport times (`YYYY-MM-DDTHH:MM`).
- `fromPlace` / `toPlace` show the city Google matched when you typed a city name.
- `layovers` list the connecting airport, its city and the wait in minutes.

### ❓ FAQ

**Is there a Google Flights API?** Google has no public Google Flights API. This Actor works like one: send searches through the Apify API and get structured JSON flights back.

**Can I track flight prices over time?** Yes. Save the input as a Task, schedule it daily and use relative dates (e.g. `"departureDate": "30"`) so the searches move with the calendar.

**Are prices per person?** No, `price` is the total for all adults in the search, in the currency you chose.

**Can I search by city instead of airport?** Yes. Use a city code like `NYC` or `LON`, or type the city name; flights from all of its airports are included.

**What about a date in the past?** That search is skipped and named in the status message; the other searches still run.

# Actor input Schema

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

One object per route: <code>from</code> and <code>to</code> (airport code like JFK, city code like NYC or LON, or a city name like "New York"), <code>departureDate</code> (YYYY-MM-DD, or a number of days from today like 30; empty = 30 days from today) and an optional <code>returnDate</code> for a round trip. <code>adults</code> and <code>cabin</code> can be set per search and override the fields below.

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

Number of adult passengers (1-9). Prices are the total for all passengers.

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

Cabin class to price.

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

Three-letter currency code for the prices, e.g. USD, EUR, GBP, PLN.

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

How many flights to save for each search. A search usually lists 10-50 flights.

## Actor input object example

```json
{
  "searches": [
    {
      "from": "JFK",
      "to": "LAX",
      "departureDate": "2026-12-03"
    },
    {
      "from": "London",
      "to": "Barcelona",
      "departureDate": "2026-12-10",
      "returnDate": "2026-12-17",
      "adults": 2
    }
  ],
  "adults": 1,
  "cabin": "economy",
  "currency": "USD",
  "maxItems": 50
}
```

# Actor output Schema

## `results` (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 = {
    "searches": [
        {
            "from": "JFK",
            "to": "LAX"
        }
    ],
    "currency": "USD",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/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": [{
            "from": "JFK",
            "to": "LAX",
        }],
    "currency": "USD",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/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": [
    {
      "from": "JFK",
      "to": "LAX"
    }
  ],
  "currency": "USD",
  "maxItems": 50
}' |
apify call piotrv1001/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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