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

$0.1 per 1k. Search and scrape Google flights and export full details including prices, booking links and more.

- **URL**: https://apify.com/curious\_coder/google-flights-scraper.md
- **Developed by:** [Curious Coder](https://apify.com/curious_coder) (community)
- **Categories:** Travel
- **Stats:** 6 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

Search **Google Flights** for any route and get the results as clean, structured data — prices, airlines, departure and arrival times, flight duration, number of stops, layovers, aircraft, and estimated CO₂ emissions.

Perfect for price monitoring, travel dashboards, fare alerts, market research, or feeding flight data into your own app or spreadsheet.

***

### What you can do

- 🔎 Search **one-way** and **round-trip** flights for any route and date
- 💸 Get **live prices** in the currency of your choice
- 🛫 See **airlines, flight numbers, schedules, duration and stops**
- 🧳 Filter by **cabin class** (economy, premium economy, business, first)
- 🚏 Filter by **number of stops** (nonstop, 1 stop, 2 stops, or any)
- 👨‍👩‍👧 Search for **multiple passengers** (adults, children, infants)
- 🌍 Choose your **currency, language and country**

***

### Input

You only need three things to get started: **where from**, **where to**, and **when**.

| Field | Description | Example |
|-------|-------------|---------|
| **From (origin)** | Departure airport code | `JFK` |
| **To (destination)** | Arrival airport code | `LAX` |
| **Departure date** | Outbound date (`YYYY-MM-DD`) | `2026-07-30` |
| **Return date** | Return date — leave empty for one-way | `2026-08-06` |
| **Adults / Children / Infants** | Number of passengers | `1` |
| **Cabin class** | Economy, Premium economy, Business, First | `Economy` |
| **Stops** | Any, Nonstop, 1 stop or fewer, 2 stops or fewer | `Any` |
| **Currency** | Currency for prices | `USD` |
| **Language / Country** | Locale for results | `en` / `us` |
| **Maximum results** | Limit how many flights to save | `50` |
| **Include vendor booking links** | Fetch airline/OTA booking URLs (extra API call per flight) | `false` |
| **Include price calendar** | Embed flexible-date prices in each flight record | `false` |
| **Calendar start / end date** | Custom window for the price calendar | optional |

> 💡 **Tip:** Airports are entered as their 3-letter codes (for example `JFK`, `LHR`, `DXB`, `SIN`). You can also paste a full Google Flights link into the **Google Flights link** field and the actor will read the route and dates from it automatically.

#### Example input

```json
{
  "origin": "JFK",
  "destination": "LHR",
  "departureDate": "2026-07-30",
  "returnDate": "2026-08-06",
  "adults": 1,
  "cabinClass": "economy",
  "stops": "nonstop",
  "currency": "USD"
}
```

***

### Output

Each result is one flight option. When **Include price calendar** is enabled, every flight record also includes a `priceCalendar` array with flexible-date prices for the same route.

```json
{
  "price": 285,
  "currency": "USD",
  "airlines": ["British Airways"],
  "primaryAirlineName": "British Airways",
  "resultTier": "best",
  "departureAirport": "JFK",
  "departureTime": "07:50",
  "departureDate": "2026-07-30",
  "arrivalAirport": "LHR",
  "arrivalTime": "19:45",
  "arrivalDate": "2026-07-30",
  "duration": "6h 55m",
  "stops": 0,
  "co2EmissionsGrams": 424000,
  "co2EmissionsTypicalGrams": 410000,
  "co2EmissionsDeltaPercent": -3,
  "emissionsTag": "lower",
  "bookingLink": "https://www.google.com/travel/flights/booking?tfs=...",
  "searchLink": "https://www.google.com/travel/flights?q=...",
  "departureToken": "W1siQkEiLCIyMDI2...",
  "travelAdvisories": [{ "title": "Travel restricted", "message": "..." }],
  "baggagePolicyLinks": [{ "airlineCode": "BA", "url": "https://..." }],
  "priceCalendar": [
    {
      "departureDate": "2026-08-01",
      "returnDate": null,
      "price": 209,
      "currency": "USD",
      "isLowPrice": true
    }
  ],
  "segments": [
    {
      "flightNumber": "BA 178",
      "airlineCode": "BA",
      "extensions": ["Average legroom (31 in)", "Wi-Fi"],
      "amenities": { "wifi": true, "power": true }
    }
  ],
  "layovers": [{ "airport": "ORD", "changeOfAirport": true, "duration": "2h 10m" }]
}
```

When **Include vendor booking links** is enabled, records also include `bookingOptions` (vendor fares with `bookingLink`, `googleClickLink`, `fareName`, `fareCode`) and `vendorBookingLink`.

For flights with stops, the `segments` array lists each leg of the journey and `layovers` describes each connection (airport, city and waiting time).

You can export the results as **JSON, CSV, Excel, HTML or XML** from the **Storage** tab, or pull them through the Apify API.

***

### Notes

- For **round-trip** searches, results show the available outbound flights together with the lowest total round-trip price — exactly as Google Flights presents them.
- Prices are provided by Google and can change at any time. Always confirm the final price with the airline or booking site before purchasing.
- This actor is not affiliated with or endorsed by Google.

***

### FAQ

**Which airports can I search?**
Any airport or metro area supported by Google Flights. Use the standard 3-letter airport code.

**Can I monitor prices automatically?**
Yes. Use Apify **Schedules** to run the actor on a recurring basis and combine it with integrations (email, Slack, webhooks) to get alerts when prices change.

**Do I need to configure anything else?**
No. Just enter your route and dates and run it.

# Actor input Schema

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

Departure airport or city. Use a 3-letter airport code such as <b>JFK</b>, <b>LHR</b> or <b>DXB</b>.

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

Arrival airport or city. Use a 3-letter airport code such as <b>LAX</b>, <b>CDG</b> or <b>SIN</b>.

## `departureDate` (type: `string`):

Date of the outbound flight in <b>YYYY-MM-DD</b> format.

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

Date of the return flight in <b>YYYY-MM-DD</b> format. Leave empty for a one-way trip.

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

Number of adult passengers.

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

Number of children (2-11 years).

## `infantsInSeat` (type: `integer`):

Number of infants occupying their own seat.

## `infantsOnLap` (type: `integer`):

Number of infants travelling on a lap.

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

Preferred travel class.

## `stops` (type: `string`):

Maximum number of stops.

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

Currency for prices, e.g. <b>USD</b>, <b>EUR</b>, <b>GBP</b>, <b>INR</b>.

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

Two-letter language code for results, e.g. <b>en</b>.

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

Two-letter country code used for search context, e.g. <b>us</b>.

## `maxResults` (type: `integer`):

Limit the number of flights saved. Leave empty to save all results.

## `searchUrl` (type: `string`):

Alternatively, paste a full Google Flights link here and the actor will read the route and dates from it.

## `includeBookingOptions` (type: `boolean`):

When enabled, fetches airline and OTA booking links for each flight (one extra API call per result). The <b>bookingLink</b> field is always included without this option.

## `includePriceCalendar` (type: `boolean`):

When enabled, fetches flexible-date prices and embeds them in each flight record as a <b>priceCalendar</b> array.

## `calendarStartDate` (type: `string`):

Start of the price calendar window (<b>YYYY-MM-DD</b>). Defaults to 15 days before the departure date.

## `calendarEndDate` (type: `string`):

End of the price calendar window (<b>YYYY-MM-DD</b>). Defaults to 15 days after the departure date.

## Actor input object example

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "2026-07-30",
  "returnDate": "2026-08-06",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "cabinClass": "economy",
  "stops": "any",
  "currency": "USD",
  "language": "en",
  "country": "us",
  "includeBookingOptions": false,
  "includePriceCalendar": false,
  "calendarStartDate": "2026-07-01",
  "calendarEndDate": "2026-08-15"
}
```

# Actor output Schema

## `flights` (type: `string`):

One item per flight option, including price, currency, airlines, departure and arrival airports/times, total duration, number of stops, per-leg segments, layovers, CO2 estimates and a Google Flights booking link.

# 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": "LAX",
    "departureDate": "2026-07-30",
    "adults": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("curious_coder/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": "LAX",
    "departureDate": "2026-07-30",
    "adults": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("curious_coder/google-flights-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "LAX",
  "departureDate": "2026-07-30",
  "adults": 1
}' |
apify call curious_coder/google-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=curious_coder/google-flights-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/eeKzmgfTEVfeUYT8k/builds/lopFKU5BDLkZvjUFb/openapi.json
