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

🔥 $0.40/1K results 🔥 ✈️ Scrape live Google Flights prices, airlines, schedules, stops, layovers, aircraft, CO₂ data and booking links. Supports one-way, round-trip and multi-city searches with clean JSON, CSV, API and MCP output. ⚡ Fast, reliable and built for fare tracking.

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

## Pricing

from $0.40 / 1,000 results

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?

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 API: Live Flight Prices, Routes & Booking Links

Extract live flight prices, airlines, schedules, layovers, baggage information, and booking links from Google Flights without manually copying search results.

This **Google Flights Scraper API** is a ready-to-run Apify Actor for one-way, round-trip, and multi-city flight searches. Enter your route and travel dates to receive structured flight data that can be searched, filtered, downloaded, or integrated into another application.

Developers can use the Actor as a **Google Flights Scraper API** through the Apify API. Non-technical users can run it directly from a simple input form; no coding or scraping infrastructure required.

✈️ **In short:** Provide an origin, destination, and date; the Actor searches Google Flights and returns matching flight options as clean JSON, CSV, or Excel data.

### ✈️ What can you extract from Google Flights?

The Google Flights Scraper API collects the details needed to compare flights, monitor fares, analyse routes, or build a flight-search product.

Each result can include:

- Live flight price and currency
- Airline name and logo
- Departure and arrival airports
- Departure and arrival times
- Flight number and individual segments
- Total journey duration
- Direct, one-stop, and multi-stop itineraries
- Layover airports and waiting times
- Cabin and travel class
- Aircraft details
- Legroom and overnight-flight information
- CO₂ emissions estimate
- Passenger counts
- Google Flights itinerary link
- Airline and travel-agent booking options
- Fare type and baggage rules
- Price from each available booking provider

Results are available in two practical views:

- **Overview:** A clean table containing the most useful fields for quick comparison.
- **All fields:** The complete flight record, including segments, layovers, booking providers, baggage details, aircraft, and emissions.

### ✨ Why use this Google Flights Scraper API?

#### Search one-way, round-trip, and multi-city flights

Run a simple one-way search, include a return date for a round trip, or define multiple flight legs for a multi-city itinerary.

You can also search a multi-leg journey in one Actor run using **Multi-city legs**.

#### Compare live flight prices

Every run searches Google Flights at that time and returns the prices displayed for the selected route, dates, passengers, cabin, and currency.

Because airfares can change quickly, rerun the same search whenever you need refreshed pricing.

#### Get booking links, not just fare estimates

Every flight result includes a Google Flights link with the itinerary pre-selected.

Enable **Include Booking Details** to retrieve the available airline and travel-agent offers, including:

- Booking provider
- Provider price
- Fare type
- Baggage information
- Provider-specific booking link

This makes the dataset useful for flight comparison tools, travel research, fare monitoring, and booking workflows.

#### Apply detailed flight filters

Narrow results before extraction using filters such as:

- Economy, Premium Economy, Business, or First Class
- Adult, child, and infant passenger counts
- Maximum number of stops
- Maximum flight price
- Maximum journey duration
- Preferred airlines
- Airline alliances
- Departure time range
- Arrival time range

#### Localise prices and results

Select the currency, language, and country used for the search. Retrieve fares in USD, EUR, INR, GBP, or another supported currency directly from Google Flights.

#### Export structured flight data

Download the dataset in formats including:

- JSON
- CSV
- Excel

You can also access results programmatically through the Apify API and send them to a database, dashboard, spreadsheet, website, or internal application.

### 🚀 How to scrape Google Flights in four steps

1. Open the **Google Flights Scraper API** in Apify Console.
2. Enter the departure airport, arrival airport, and outbound date.
3. Optionally add a return date, passengers, cabin class, filters, currency, or multi-city legs.
4. Click **Run**, then open the Output tab to view or export the results.

Most standard searches finish in under a minute. Completion time can vary depending on the number of routes, filters, and booking details requested.

#### Quick search example

Use the following values for a round-trip flight search:

| Input         | Example      |
| ------------- | ------------ |
| From          | `JFK`        |
| To            | `LHR`        |
| Outbound date | `2026-11-25` |
| Return date   | `2026-12-02` |
| Cabin class   | `Economy`    |
| Adults        | `1`          |
| Currency      | `USD`        |

Leave **Return Date** empty to search for a one-way flight.

### 🔌 Google Flights Scraper API

The Actor can be called programmatically as a **Google Flights Scraper API** using the Apify REST API or an Apify client.

A basic API input looks like this:

```json
{
  "departure": "JFK",
  "arrival": "LHR",
  "outboundDate": "2026-11-25",
  "returnDate": "2026-12-02"
}
```

To integrate the Actor:

1. Open the **API** tab on the Actor page.
2. Select JavaScript, Python, cURL, HTTP, CLI, or OpenAPI.
3. Copy the generated integration example.
4. Add your Apify API token and search input.
5. Start the Actor and retrieve the resulting dataset.

The API returns predictable, structured records that can be used in travel applications, fare trackers, price-comparison tools, dashboards, or data pipelines.

You do not need a Google Flights API key. An Apify API token is required when calling the Actor programmatically.

### 🛫 Run multi-city flights

Use **Multi-city legs (advanced)** for a journey with several consecutive
flight legs. Add one row per leg in `ORIGIN-DESTINATION-DATE` format, for
example:

```
LAX-JFK-2026-08-04
JFK-CDG-2026-08-10
```

Each row becomes one leg of a **single multi-city itinerary** (not separate
searches). When set, the multi-city legs override the **From / To / dates**
above. Leave the field empty for a one-way or round-trip search.

> To run **multiple independent searches** in one run (instead of one
> multi-leg itinerary), use **Searches (advanced / batch)**: one row per
> search as `DEP-ARR-DATE` (one-way) or `DEP-ARR-DATE-RETURN` (round-trip).
> Legacy object entries are still accepted via the JSON input.

### 📊 Google Flights data fields

Every matching flight option becomes a separate dataset record.

#### Overview fields

| Field         | Description                           | Example            |
| ------------- | ------------------------------------- | ------------------ |
| Route         | Origin and destination                | `JAX → LAX`        |
| Airline       | Operating airline                     | `Delta`            |
| Departure     | Scheduled departure                   | `2026-09-01 12:59` |
| Arrival       | Scheduled arrival                     | `2026-09-01 17:20` |
| Stops         | Number of stops                       | `1`                |
| Duration      | Total journey time                    | `7h 21m`           |
| Price         | Fare in the selected currency         | `275`              |
| Currency      | ISO currency code                     | `USD`              |
| Book          | Pre-selected Google Flights itinerary | URL                |
| Logo          | Airline logo                          | Image              |
| Has layover   | Whether the itinerary has a layover   | `true`             |
| Layover count | Number of layovers                    | `1`                |
| Layover time  | Total waiting time                    | `1h 45m`           |
| Adults        | Number of adult passengers            | `1`                |
| Children      | Number of child passengers            | `0`                |
| Infants       | Number of infant passengers           | `0`                |
| Return date   | Selected return date                  | `2026-12-02`       |
| Search index  | Source search within the run          | `1`                |
| Result type   | Google Flights result grouping        | `best`             |
| Actor version | Build metadata                        | Version marker     |

#### Detailed flight fields

The **All fields** view includes the complete itinerary structure:

- Individual flight segments
- Airline and flight number
- Departure and arrival airports
- Segment departure and arrival times
- Segment duration
- Aircraft model
- Travel class
- Legroom information
- Overnight-flight status
- Layover airport and duration
- Total CO₂ estimate
- Booking options and baggage details

#### Booking-option fields

When **Include Booking Details** is enabled, additional fields can include:

| Field                 | Description                                              | Example                            |
| --------------------- | -------------------------------------------------------- | ---------------------------------- |
| `bookingOptionsCount` | Number of provider and fare options                      | `5`                                |
| `bookingFrom`         | Lowest provider price found                              | `187`                              |
| `bookingProviders`    | Airlines or agents offering the itinerary                | `JetBlue (direct), American`       |
| `baggage`             | Carry-on rules and optional charges                      | `Carry-on 32 in · add-on from $49` |
| `bookingOptions`      | Complete provider, fare, baggage, price, and URL records | Array                              |

### 📝 Input reference

| Input                   | Purpose                                    | Example           |
| ----------------------- | ------------------------------------------ | ----------------- |
| From                    | Departure airport or supported city        | `JFK`             |
| To                      | Arrival airport or supported city          | `LHR`             |
| Outbound Date           | Travel departure date                      | `2026-11-25`      |
| Return Date             | Optional return date                       | `2026-12-02`      |
| Multi-city legs        | Multi-leg journeys (`ORIGIN-DEST-DATE`)   | string list       |
| Searches (batch)       | Multiple searches (`DEP-ARR-DATE[+RETURN]`) | string list     |
| Cabin Class             | Selected travel class                      | `Business`        |
| Passengers              | Adults, children, and infants              | `2 adults`        |
| Maximum Stops           | Limits connecting flights                  | `1`               |
| Maximum Price           | Excludes fares above a set amount          | `500`             |
| Maximum Duration        | Limits total journey time                  | `12 hours`        |
| Airlines or Alliances   | Includes selected carriers                 | Selected airlines |
| Time Windows            | Limits departure or arrival times          | `08:00-18:00`     |
| Currency                | Fare currency                              | `USD`             |
| Language                | Result language                            | `en-US`           |
| Country                 | Google Flights country setting             | `US`              |
| Include Booking Details | Retrieves provider offers and baggage data | `true`            |

Three-letter IATA airport codes such as `JFK`, `LHR`, `CDG`, and `NRT` are recommended for precise searches.

#### Example input combinations

Ready-to-run inputs are in the repo under **`apify/examples/`**. Copy a file's
contents into the Actor's input JSON editor and run. The Actor also logs a
friendly `input hint:` warning when something looks off (bad date format,
unknown `maxStops`/`sortBy`, malformed search rows, etc.), so mistakes are
easy to spot.

The Actor infers the trip type from **which fields you fill in**:

| Mode             | Fields you set                                                      | Result                              |
| ---------------- | ------------------------------------------------------------------- | ----------------------------------- |
| **One-way**      | `departure` + `arrival` + `outboundDate`                            | 1 leg                               |
| **Round-trip**   | those + `returnDate`                                                | 2 legs (outbound + return)          |
| **Multi-city**   | `multiCityLegs` (list of `ORIGIN-DESTINATION-DATE` strings)          | N legs: **overrides** From/To/dates |
| **Batch**        | `searches` (list of `DEP-ARR-DATE[+RETURN]` strings)               | one search per row                 |

**One-way**

```json
{ "departure": "JAX", "arrival": "LAX", "outboundDate": "2026-08-31" }
```

**Round-trip**

```json
{
  "departure": "JAX", "arrival": "LAX",
  "outboundDate": "2026-08-31", "returnDate": "2026-09-07"
}
```

**Multi-city (2 legs, no From/To needed)**

```json
{ "multiCityLegs": ["LAX-JFK-2026-08-30", "JFK-LHR-2026-09-02"] }
```

**Full round-trip with filters, passengers and booking details**

```json
{
  "departure": "JAX", "arrival": "LAX",
  "outboundDate": "2026-08-31", "returnDate": "2026-09-07",
  "cabinClass": "Business", "adults": 2, "children": 1, "infants": 1,
  "maxStops": "Nonstop", "maxPrice": 800, "maxDuration": 600,
  "airlines": ["UA", "AA"], "alliance": "STAR_ALLIANCE", "excludeBasic": true,
  "departureTimeEarliest": "06:00", "departureTimeLatest": "22:00",
  "arrivalTimeEarliest": "07:00", "arrivalTimeLatest": "23:00",
  "sortBy": "Price", "showAllResults": true, "maxPages": 2, "topN": 10,
  "includeBookingDetails": true,
  "currency": "INR", "hl": "en-US", "country": "US"
}
```

**Batch (`searches`: multiple one-way / round-trip searches in one run)**

```json
{
  "searches": [
    "JAX-LAX-2026-08-31",
    "LAX-SFO-2026-09-10-2026-09-17"
  ]
}
```

Row format: `DEP-ARR-DATE` (one-way) or `DEP-ARR-DATE-RETURN` (round-trip).
This is exposed in the input form as **"Searches (advanced / batch)"** with the
same list design as Multi-city legs: add one row per search and keep adding.
Leave it empty to use the single From / To / Date fields.

**Things to keep in mind**

- **Precedence:** `multiCityLegs` overrides From/To/dates; `searches` runs only when it has rows. (Legacy object entries can still set per-search overrides via the JSON input.)
- **Booking details add time:** `includeBookingDetails` fetches per-flight
  booking offers one network call per top result, so a search with it on takes
  \~9-11s vs ~2s without it. Works for one-way, round-trip and multi-city.
- **Pay-per-event:** a filtered query charges the `filter` event (`results × active filters`); enabling booking details charges `additional-detail` (`results`).
- **Output record types:** the default (flight) dataset holds `best`, `other`, `noFlights` (no matches), and `error` (failed search).

### 📈 Flight price monitoring

The Google Flights Scraper API can be scheduled on Apify to repeat the same route search automatically.

A typical fare-monitoring workflow is:

1. Save a search containing the route, dates, passengers, and filters.
2. Schedule it to run hourly, daily, or weekly.
3. Store each dataset with its run date and time.
4. Compare the latest price with earlier results.
5. Trigger your own notification when the fare reaches a target.

This allows you to build airfare histories, route dashboards, price-drop alerts, or travel-deal monitoring systems without operating your own scraper.

### 💰 Pay-per-event pricing

The actor uses Apify's **pay-per-event (PPE)** pricing model. Besides the
platform events billed automatically (`apify-actor-start` per run and
`apify-default-dataset-item` per dataset item), the actor reports
**pay-per-event metrics** for filter usage and booking details:

The **`filter`** event is charged on every filtered search:

```
total billed = number of results × number of active filters × price per event
```

Set its price per event once in the Apify Console (**Monetization &
Pricing** tab of the actor); the price is configured there, not in the Actor.
A search that uses no filters incurs no `filter` charge.

Which filters count (each adds 1 to the multiplier):

| Actor input          | Charged when the query applies…                    |
| -------------------- | -------------------------------------------------- |
| `maxStops`           | a stop limit (including **Nonstop**)               |
| `maxPrice`           | a maximum price                                    |
| `maxDuration`        | a maximum duration                                 |
| `airlines`           | an airline list                                    |
| `alliance`           | an alliance                                        |
| `excludeBasic`       | exclude basic economy                              |
| `departureTimeEarliest` / `departureTimeLatest` | a departure time window |
| `arrivalTimeEarliest` / `arrivalTimeLatest` | an arrival time window       |

Example: 20 results with `maxStops` + `airlines` → 20 results × 2 filters = 40
events. An event with no configured price is skipped, so the actor is safe to
run before you set pricing.

The **`additional-detail`** event is charged once per search **for all
results** when **Include Booking Details** is selected:

```
total billed = number of results × price per event
```

So if you find 20 results with Include Booking Details on, that's 20
`additional-detail` events (on top of any `filter` events). Like `filter`,
its price is set once in the Apify Console, not in the Actor.

### 💼 Popular use cases

#### Travel agencies and booking platforms

Collect structured flight options for customer research, itinerary comparison, or internal booking workflows.

#### Flight price trackers

Monitor a route repeatedly and identify price increases, reductions, or unusually low fares.

#### Travel comparison websites

Power route pages and comparison tools with airlines, prices, schedules, durations, stops, and booking links.

#### Developers and SaaS teams

Use the Google Flights Scraper API as a flight-data source for applications, dashboards, automated workflows, and prototypes.

#### Data analysts and researchers

Study airfare changes, airline coverage, route competition, journey duration, layovers, and pricing patterns.

#### Corporate travel teams

Compare business-travel options and monitor frequently used routes for budgeting and planning.

#### Individual travellers

Compare the cheapest, fastest, direct, or most convenient flights without reviewing every option manually.

### ❓ Frequently asked questions

#### What is a Google Flights scraper?

A Google Flights scraper automatically collects flight-search results from Google Flights. It converts prices, airlines, schedules, durations, stops, routes, and booking information into structured records that can be downloaded or processed automatically.

#### Does this Actor provide a Google Flights Scraper API?

Yes. You can start searches and retrieve results through the Apify API. The Actor can be integrated using REST, Python, JavaScript, cURL, CLI, or its OpenAPI definition.

#### Do I need to know how to code?

No. Enter the route and date in the Actor’s web form, click **Run**, and download the results.

Coding is only required when you want to integrate the Actor into an application or automated workflow.

#### Does the scraper return live Google Flights prices?

Yes. Each run performs a new Google Flights search and collects the prices displayed at that time.

Flight prices and availability can change after extraction, so rerun the Actor when you need the latest fare information.

#### Can I scrape round-trip flights?

Yes. Add an outbound date and a return date to search for round-trip itineraries. Leave the return date blank for a one-way search.

#### Can I search multi-city flights?

Yes. Use the **Multi-city legs (advanced)** field to define several consecutive flight segments within one multi-city itinerary.

#### Can I search multiple routes in one run?

Yes. Use **Searches (advanced / batch)** and add one row per search as `DEP-ARR-DATE` (one-way) or `DEP-ARR-DATE-RETURN` (round-trip). Each row runs as an independent search and appears in the output with its own search index.

#### Can I filter for nonstop flights?

Yes. Set the maximum number of stops to zero. You can also allow one or more stops and apply price, duration, airline, alliance, departure-time, or arrival-time filters.

#### Can I search Business or First Class flights?

Yes. Supported cabin options include Economy, Premium Economy, Business, and First Class.

#### Can I retrieve prices in different currencies?

Yes. Select your preferred currency before starting the search. Google Flights returns fares using the chosen currency setting.

#### Does every result include a booking link?

Each flight option includes a Google Flights itinerary link. When **Include Booking Details** is enabled, the result can also include separate airline or travel-agent offers with provider-specific links.

#### Does the Actor book flights automatically?

No. The Actor extracts and compares flight information. Booking links take you to Google Flights or the relevant provider, where the traveller completes the purchase.

#### Which airports and destinations are supported?

You can search routes supported by Google Flights worldwide. Three-letter IATA airport codes are recommended, although supported city names can also be used in the From and To fields.

#### Can the results be exported to Excel?

Yes. Actor datasets can be exported as Excel, CSV, or JSON files.

#### Is the Google Flights Scraper API free?

Apify offers a free platform tier. This Actor uses Apify compute resources, with no separate per-search fee or Google Flights API key required. Review the Actor’s **Pricing** tab for the latest applicable platform costs.

#### What do I need to run the Actor?

You only need:

- An Apify account
- A departure location
- An arrival location
- An outbound travel date

The Actor runs in the cloud, so you do not need to install a browser, configure a proxy, or maintain your own scraping server.

### 🎉 Start extracting Google Flights data

Enter your route and travel dates to collect live prices, airlines, schedules, layovers, booking links, and detailed flight records.

Run the Actor manually for a quick comparison, schedule it for fare monitoring, or connect the **Google Flights Scraper API** to your application for automated flight-data extraction.

# Actor input Schema

## `departure` (type: `string`):

Departure airport code (IATA), e.g. JFK.

## `arrival` (type: `string`):

Arrival airport code (IATA), e.g. LHR.

## `outboundDate` (type: `string`):

Departure date, e.g. 2026-11-25.

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

Optional return date for a round-trip search, e.g. 2026-12-02. Leave empty for one-way.

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

Run multiple searches in one run. Add one row per search as DEP-ARR-DATE (one-way, e.g. JAX-LAX-2026-08-31) or DEP-ARR-DATE-RETURN (round-trip, e.g. JAX-LAX-2026-08-31-2026-09-07). Leave empty to use the single From / To / Date fields above. When set together with Multi-city legs, Multi-city legs wins.

## `multiCityLegs` (type: `array`):

For multi-city trips only. Add one row per leg as ORIGIN-DESTINATION-DATE, e.g. LAX-JFK-2026-08-04. When set, this overrides the From / To / dates above. Leave empty for one-way or round-trip.

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

Cabin class for all searches, e.g. Economy, Business.

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

Number of adult passengers, e.g. 2.

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

Number of child passengers, e.g. 1.

## `infants` (type: `integer`):

Number of infants travelling on an adult's lap, e.g. 1.

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

Maximum number of stops, e.g. Nonstop for direct flights only.

## `maxPrice` (type: `integer`):

Maximum price in the selected currency, e.g. 800.

## `maxDuration` (type: `integer`):

Maximum total trip duration in minutes, e.g. 600 (10 hours).

## `airlines` (type: `array`):

Restrict results to these airline codes (IATA), e.g. AA, UA, LH.

## `alliance` (type: `string`):

Restrict results to an airline alliance, e.g. STAR\_ALLIANCE.

## `excludeBasic` (type: `boolean`):

Exclude basic-economy fares from results. Set to Yes to skip them.

## `departureTimeEarliest` (type: `string`):

Earliest departure time, e.g. 06:00.

## `departureTimeLatest` (type: `string`):

Latest departure time, e.g. 22:00.

## `arrivalTimeEarliest` (type: `string`):

Earliest arrival time, e.g. 06:00.

## `arrivalTimeLatest` (type: `string`):

Latest arrival time, e.g. 22:00.

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

Result ordering, e.g. Price to see cheapest first.

## `showAllResults` (type: `boolean`):

Fetch more results (paginate) instead of only the best/other flights. Set to Yes for a fuller list.

## `maxPages` (type: `integer`):

Maximum result pages to fetch per search, e.g. 2.

## `topN` (type: `integer`):

Expand the top N best itineraries into individual entries, e.g. 10.

## `includeBookingDetails` (type: `boolean`):

Fetch per-itinerary booking options: prices from different booking providers (airline direct / agents) plus baggage info, and booking links. Set to Yes to include them for one-way, round-trip and multi-city searches (top results).

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

Currency for prices and price filters, e.g. USD, EUR, INR.

## `hl` (type: `string`):

Google Flights interface language, e.g. en-US, de-DE.

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

Google Flights country code, e.g. US, DE.

## Actor input object example

```json
{
  "searches": [],
  "multiCityLegs": [],
  "cabinClass": "Economy",
  "adults": 1,
  "children": 0,
  "infants": 0,
  "alliance": "None",
  "excludeBasic": false,
  "sortBy": "Best",
  "showAllResults": false,
  "maxPages": 1,
  "topN": 5,
  "includeBookingDetails": false,
  "currency": "USD",
  "hl": "en-US",
  "country": "US"
}
```

# Actor output Schema

## `flightResults` (type: `string`):

Flight itineraries with airlines, prices, schedules, durations, stops, layovers and booking links. Rows are tagged by recordType: best, other, noFlights, or error.

# 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": [],
    "multiCityLegs": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("poidata/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": [],
    "multiCityLegs": [],
}

# Run the Actor and wait for it to finish
run = client.actor("poidata/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": [],
  "multiCityLegs": []
}' |
apify call poidata/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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