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

Google Flights Scraper — Extract Google Flights data including airlines, routes, departure and arrival times, prices, flight durations, stops, airports, baggage details, and booking URLs. Useful for flight research, fare comparison, travel planning, and market analysis.

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

## Pricing

from $1.49 / 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.
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 — Prices, Legs, Times and Emissions

Google Flights Scraper searches Google Flights for one or many routes and returns every flight with its price, total duration, stops, each leg's airports, times, airline, flight number, aircraft and legroom, carbon emissions and Google's booking token. Every response is structured JSON — ready to pass directly to an LLM, index into a vector store, or feed a fare-tracking pipeline. **No Google account or cookies needed.** Start with one route, then compare several destinations, cabins and dates in a single run.

![Google Flights Scraper output: price, duration, airline and stops as JSON](https://api.apify.com/v2/key-value-stores/Lg9lp51Levfro6SrV/records/h-google-flights-hero.webp)

***

### What data can I extract with Google Flights Scraper?

Using this Google Flights API, you will be able to extract the following flight data:

| 💵 Price for all passengers | ⭐ Best-flight flag | ⏳ Total duration | 🛑 Number of stops |
|---|---|---|---|
| 🛫 Departure airport, name and time | 🛬 Arrival airport, name and time | ✈️ Airline per leg | 🔢 Flight number per leg |
| 🛩️ Aircraft type | 💺 Legroom and cabin | 🔁 "Also sold as" codeshares | 🌱 Carbon emissions vs. typical |
| 🖼️ Airline logo | 🎫 Google booking token | 🗺️ Route and dates searched | 🧾 Full search result per route |

***

### How to use Google Flights Scraper

Built for travel startups, analysts and AI builders: one run turns a list of routes into a table of flights with prices, legs and emissions.

**Copy to your AI assistant:**

```text
`google-flights-scraper` (Apify Actor ID: fastdataapi/google-flights-scraper, https://apify.com/fastdataapi/google-flights-scraper) is an Apify Actor that returns Google Flights search results as structured JSON: one row per flight with is_best, type (One way, Round trip, Multi-city), price, currency, duration_minutes, airline, departure_airport, arrival_airport, stops, route, outbound_date, return_date, note, and raw_flight_data holding every leg (airport names and codes, times, airline, flight number, aircraft, legroom, cabin, airline logo, codeshares), total duration, carbon emissions in grams and Google's departure token. Use it whenever someone needs flight prices or schedules without a browser or a Google login - comparing fares to several destinations, tracking a route's prices daily, or collecting non-stop options in a cabin class. Run it with curl: curl -X POST "https://api.apify.com/v2/acts/google-flights-scraper/run-sync-get-dataset-items?token=APIFY_TOKEN" -H "Content-Type: application/json" -d '{"departureIATA":"DAC","arrivalIATA":"LHR, CDG, FRA","departureDate":"2026-12-10","maximum":20,"stops":"1"}'. Or in Python: ApifyClient("APIFY_TOKEN").actor("google-flights-scraper").call(run_input={"departureIATA": "LAX", "arrivalIATA": "JFK", "departureDate": "2026-11-20", "arrivalDate": "2026-11-27", "seatclass": "3"}) then client.dataset(run["defaultDatasetId"]).list_items().items. Inputs: departureIATA (string, 3-letter codes, comma-separated, default "LAX"), arrivalIATA (string, comma-separated, default "JFK"; every departure is searched against every destination, each pair a separate route), departureDate (string YYYY-MM-DD; dates in the past or under 2 days away move to today + 21 days and the row's note says so), arrivalDate (string YYYY-MM-DD, return date, empty = one way), multi_city_json (string, JSON list of {departure_id, arrival_id, date} legs; replaces the airports and dates), adults (integer 1-9, default 1), children (integer 0-9), infants (integer 0-9, on lap, one adult each), seatclass ("1" economy | "2" premium economy | "3" business | "4" first, default "1"), stops ("0" non-stop | "1" at most 1 | "2" at most 2, default "2"), alliances (string, STAR, SKYTEAM, ONEWORLD or ALL), airlines (string, 2-character codes or ALL; a flight is kept when every leg is flown by a chosen airline or alliance member), maxPrice (integer, 0 = no limit), currency (string, 3 letters, default "USD"), hl (language code, default "en"), gl (country code, default "us"), maximum (integer 1-100 flights per route, best flights first, default 10), proxyConfiguration (object, default Apify residential proxy). departureDateRng, arrivalDateRng and max_pages are accepted but not used. Each saved flight is charged as the row_result event; a route without flights gives no rows and costs nothing. Round trips list the outbound flights with the price of the whole trip; multi-city trips list the options for the first flight with the price of the whole trip. The full result per route is also stored in the run's key-value store under OUTPUT. Full input schema, every enum and default, and the complete output field list: GET https://api.apify.com/v2/acts/google-flights-scraper/builds/default
```

#### Google Flights Scraper MCP Server: use these Actors from ChatGPT, Claude or Cursor

Point your AI assistant at Apify and it can search flights on its own: prices, schedules and legs for any route Google Flights covers. No glue code, no scraping logic in your prompts.

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=fastdataapi/google-flights-scraper"
```

#### Step by step

1. [Create a free Apify account](https://console.apify.com/sign-up).
2. Open [Google Flights Scraper](https://apify.com/fastdataapi/google-flights-scraper) in the Apify Store.
3. Enter the departure and destination airport codes and the travel date.
4. Click **Start** (or send your API request).
5. Download or stream your results in JSON, CSV or Excel.

#### How to scale Google Flights Scraper to bulk

Put several airport codes in each field: every departure is searched against every destination, four routes at a time, and each route's flights are saved as soon as that route is ready. A recorded run from Dhaka to London, Paris and Frankfurt with at most one stop saved 60 flights, 20 per route, in 5.9 seconds. To track the same routes over time, schedule the run daily or weekly in Apify Console and compare the prices.

***

### ✨ Features

Google Flights Scraper fetches clean, structured flight results from Google Flights ⚡. Use it as a flight price scraper or airfare data extractor, a Google Flights price tracker, a cheap flight finder, or the flight search API behind your own app — scrape Google Flights for round trip flight prices next to one-way and multi-city fares, all in one flight data API. It extracts, per flight:

- **Price** – fare in the currency you choose, for all passengers and the whole trip
- **Every leg** – departure and arrival airport with full name, local time, airline, flight number, aircraft, legroom and cabin
- **Schedule** – total duration with layovers and the number of stops
- **Emissions** – this flight's carbon emissions, the typical amount for the route and the difference in percent
- **Booking token** – Google's own token for the flight, plus the airline logo and codeshare flight numbers
- **Search context** – route, dates really searched and whether Google lists the flight under Best flights

⚡ Filters for stops, budget, airlines and alliances are applied before saving, and routes without matching flights cost nothing.

***

### Use cases 💡

- **Travel startup** — compare fares from one city to many destinations in a single run.
- **Revenue analyst** — track a route's prices daily for each cabin class.
- **Travel blogger** — collect non-stop options and prices for a destination guide.
- **Sustainability team** — compare flight emissions with the route's typical amount.
- **AI engineer** — let an agent answer "cheapest non-stop to Paris next month" with live data.

Building an AI agent? [Connect Google Flights Scraper over MCP](#mcp-integration-for-ai-agents) and let it call the actor on its own.

***

### Why choose this actor?

1. **Many routes in seconds.** A recorded run from Dhaka to London, Paris and Frankfurt saved 60 flights in 5.9 seconds.
2. **Every leg, not just the route.** A recorded Dhaka–London round trip came back as two legs via Doha with flight numbers QR 643 and QR 11, a Boeing 777 and an Airbus A380, and 745 kg of carbon emissions, 14% above the route's typical amount.
3. **Filters that hold.** Stops, budget, airlines and alliances are checked on every flight; a recorded round-trip run with all four filters saved 27 flights that all passed them.

***

### ⬇️ Input

![Google Flights Scraper input: departure and arrival airport codes and date](https://api.apify.com/v2/key-value-stores/Lg9lp51Levfro6SrV/records/h-google-flights-input.webp)

Enter the departure airport, the destination airport and the travel date. Every other setting is optional.

| Parameter | Required | Type | Description | Example value |
|---|---|---|---|---|
| `departureIATA` | No (default LAX) | string | 3-letter airport code(s), comma-separated. Every departure is searched against every destination. | `"DAC"` |
| `arrivalIATA` | No (default JFK) | string | 3-letter airport code(s), comma-separated. | `"LHR, CDG, FRA"` |
| `departureDate` | No | string | Travel date (YYYY-MM-DD). A date in the past or less than 2 days away is moved to 21 days from today, and the row's note says so. | `"2026-12-10"` |
| `arrivalDate` | No | string | Return date for a round trip; empty for one way. | `"2026-12-20"` |
| `multi_city_json` | No | string | JSON list of two or more legs with departure_id, arrival_id and date; replaces the airports and dates above. | `"[{\"departure_id\":\"SAN\",\"arrival_id\":\"LAX\",\"date\":\"2026-11-15\"},{\"departure_id\":\"LAX\",\"arrival_id\":\"MAD\",\"date\":\"2026-11-17\"}]"` |
| `adults` / `children` / `infants` | No | integer | Passengers (at most 9; one adult per infant on lap). Default 1 / 0 / 0. | `2` |
| `seatclass` | No | string | `"1"` Economy, `"2"` Premium Economy, `"3"` Business, `"4"` First Class. Default `"1"`. | `"3"` |
| `stops` | No | string | `"0"` non-stop only, `"1"` at most 1 stop, `"2"` at most 2 stops. Default `"2"`. | `"0"` |
| `alliances` | No | string | STAR, SKYTEAM, ONEWORLD (comma-separated) or ALL. | `"ONEWORLD"` |
| `airlines` | No | string | 2-character airline codes (comma-separated) or ALL. A flight is kept when every leg is flown by a chosen airline or alliance member. | `"EK, QR"` |
| `maxPrice` | No | integer | Highest price in the chosen currency; 0 = no limit. | `1500` |
| `currency` | No | string | 3-letter currency. Default USD. | `"EUR"` |
| `hl` / `gl` | No | string | Language of names and country searched from. Default en / us. | `"de"` / `"de"` |
| `maximum` | No | integer | Most flights saved per route (1-100), best flights first. Default 10. | `20` |
| `proxyConfiguration` | No | object | Default: Apify residential proxy, new exit address on every retry. | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` |

`departureDateRng`, `arrivalDateRng` and `max_pages` are accepted but not used at the moment.

#### Free plan limits

Free plan: up to 20 flights per run (all routes together) and 200 per month; paid plans have no limit.

#### Example input

```json
{
  "departureIATA": "DAC",
  "arrivalIATA": "LHR, CDG, FRA",
  "departureDate": "2026-12-10",
  "adults": 1,
  "seatclass": "1",
  "stops": "1",
  "currency": "USD",
  "maximum": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

***

### ⬆️ Output

![Google Flights Scraper output: one row per flight with price, duration and stops](https://api.apify.com/v2/key-value-stores/Lg9lp51Levfro6SrV/records/h-google-flights-output.webp)

Every flight is one typed, normalized JSON item with the same 14 fields on every run, best flights first for each route. The full search result for every route — search parameters, counts, best and other flights and airport names — is also stored in the run's key-value store under OUTPUT. Export the dataset as JSON (default), CSV or Excel.

#### Example output

A recorded round-trip flight from Dhaka to London (all legs shown):

```json
{
  "is_best": true,
  "type": "Round trip",
  "price": 1181,
  "currency": "USD",
  "duration_minutes": 1060,
  "airline": "Qatar Airways",
  "departure_airport": "DAC",
  "arrival_airport": "LHR",
  "stops": 1,
  "route": "DAC → LHR",
  "outbound_date": "2026-12-10",
  "return_date": "2026-12-20",
  "note": null,
  "raw_flight_data": {
    "flights": [
      {
        "departure_airport": {"name": "Hazrat Shahjalal International Airport", "id": "DAC", "time": "6:45 PM on Thu, Dec 10"},
        "arrival_airport": {"name": "Hamad International Airport", "id": "DOH", "time": "9:45 PM on Thu, Dec 10"},
        "airline": "Qatar Airways",
        "flight_number": "QR 643",
        "duration": 360,
        "airplane": "Boeing 777",
        "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/QR.png",
        "travel_class": "Economy",
        "legroom": "31 in",
        "extensions": ["Legroom: 31 in", "Carbon emissions estimate: 323 kg"]
      },
      {
        "departure_airport": {"name": "Hamad International Airport", "id": "DOH", "time": "2:00 AM on Fri, Dec 11"},
        "arrival_airport": {"name": "Heathrow Airport", "id": "LHR", "time": "6:25 AM on Fri, Dec 11"},
        "airline": "Qatar Airways",
        "flight_number": "QR 11",
        "duration": 445,
        "airplane": "Airbus A380",
        "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/QR.png",
        "travel_class": "Economy",
        "legroom": "31 in",
        "extensions": ["Legroom: 31 in", "Carbon emissions estimate: 422 kg"]
      }
    ],
    "total_duration": 1060,
    "carbon_emissions": {"this_flight": 745000, "typical_for_this_route": 654000, "difference_percent": 14},
    "price": 1181,
    "type": "Round trip",
    "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/QR.png",
    "extensions": ["Carbon emissions estimate: 745 kg CO2e", "+14% emissions vs. typical for this route"],
    "departure_token": "CjRITkxOT2U4R2JCWWtBRGlxREFCRy0tLS0tLS0tc2VieW0xNkFBQUFBR3JONFpBTnR5Q2lBEgpRUjY0M3xRUjExGgsIn5oHEAIaA1VTRDgdcJ+aBw=="
  }
}
```

Round trips list the outbound flights with the price of the whole trip, as Google shows them first; multi-city trips list the options for the first flight with the price of the whole trip. Carbon emissions are in grams. A price of 0 means Google showed no price for that flight.

***

### How does it work?

The actor reads the same flight results the Google Flights website shows any visitor, with plain web requests and no browser. For each route it runs one Google Flights search with your passengers, cabin, stop limit, currency, language and country, reads every flight with all its legs, keeps the ones that pass your stop, budget and airline filters, and saves up to your maximum, best flights first. Requests go through Apify residential proxies by default, and every retry uses a fresh exit address; when Google limits a request, the actor waits, switches address and tries again. It returns only publicly visible data — what any visitor sees without logging in — and the output fields stay the same from run to run, so your code and spreadsheets keep working when Google changes its pages.

***

### How do you integrate Google Flights Scraper into your stack?

It works with what you already use: the REST API from any language, MCP for AI agents, and no-code tools.

#### Using Google Flights Scraper with the Apify API

```python
import requests

response = requests.post(
    "https://api.apify.com/v2/acts/google-flights-scraper/run-sync-get-dataset-items",
    params={"token": "APIFY_TOKEN"},
    json={"departureIATA": "LAX", "arrivalIATA": "JFK, BOS", "departureDate": "2026-11-20", "stops": "0"},
)
for flight in response.json():
    print(flight["route"], flight["airline"], flight["price"], flight["currency"], flight["duration_minutes"])
```

*Works in Go, Ruby, Node.js, cURL — any language that can make an HTTP request.*

#### MCP integration for AI agents

Add the Apify MCP server to your AI client with one command:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=fastdataapi/google-flights-scraper"
```

This registers Google Flights Scraper as a tool your agent can call directly: the agent finds it through the server's search, adds it and runs it, then reads the flights back as JSON. Ask for "the cheapest non-stop flights from LAX to New York on November 20" and it does the rest. It works in Claude Code, Cursor and Windsurf.

#### No-code tools (n8n, Make, LangChain)

**n8n:** add the Apify node and choose "Run an Actor", or use the HTTP Request node pointed at the run-sync endpoint with your token. Send the cheapest flight per route to Slack or a Google Sheet in the next node.

**Make:** use the Apify app's "Run an Actor" module, then "Get Dataset Items" to pull the flights into the rest of your scenario.

**LangChain:** install `langchain-apify` and wrap the actor with `ApifyActorsTool("google-flights-scraper")` so your agent can search flights on demand.

***

### Is it legal to scrape Google Flights data?

Collecting public flight results is generally lawful: prices, schedules and airlines are shown to every visitor without an account. This actor returns only publicly available data — what any visitor sees without logging in. GDPR: scraping public data is generally permissible, but storing and using it must comply with local data-protection law. Flight results contain no personal data. Consult legal counsel if you plan to republish fares commercially.

***

### Frequently asked questions

#### What fields does Google Flights Scraper return?

It returns each flight's price, total duration, stops and every leg with airports, times, airline, flight number, aircraft and legroom, plus carbon emissions and Google's booking token. See [the data fields section](#what-data-can-i-extract-with-google-flights-scraper) for the full list.

#### Does Google Flights Scraper require a Google account or login?

No. Only public Google Flights results are extracted, and no credentials are needed.

#### How fast does Google Flights Scraper run?

A recorded run with three routes saved 60 flights in 5.9 seconds, and the first flight was saved after 3.4 seconds. Four routes are searched at the same time, and every run reads live prices, not a cache.

#### What happens if a route has no flights?

The route gives no rows and costs nothing; the log and the run's status message say why, for example that Google has no fares on that date or that none of the flights match your stop, budget or airline filters.

#### Can I scrape multiple routes at once?

Yes. Put several codes in the departure and destination fields, such as "LHR, CDG, FRA": every departure is searched against every destination, each pair as its own route, with up to your maximum flights per route.

#### Does Google Flights Scraper work with Claude, ChatGPT, and other AI agent tools?

Yes — Google Flights Scraper is available as an MCP tool. Register it in Claude Code, Cursor or Windsurf with `claude mcp add --transport http apify "https://mcp.apify.com?tools=fastdataapi/google-flights-scraper"`. Any agent that can call an HTTP endpoint can use the REST API directly.

#### Does Google Flights Scraper return data in a format LLMs can use directly?

Yes. Each flight is typed, normalized JSON with consistent field names, so there is no HTML parsing and no selectors. Pass it straight to an LLM, index it into a vector store, or feed it to an agent tool — no transformation step.

#### What happens when Google changes its layout or updates its anti-bot system?

The actor is maintained, and when Google Flights changes, it is updated so your calls keep returning the same JSON fields with no changes on your end.

#### Can I use Google Flights Scraper without managing proxies or browser infrastructure?

Yes. Residential proxies, fresh exit addresses on every retry, pauses and retries all run on the actor's side, and no browser is needed. You send one request and get structured JSON back, with no proxy accounts and no maintenance.

#### Which flight fields work best for AI training data and RAG indexing?

For RAG, use the route, airline, airport names, departure and arrival times and the extensions text. For training data and analytics, use the price, duration, stops, carbon emissions and the searched dates. All fields are plain strings, numbers, booleans and short lists, so no normalization is needed.

***

### Your feedback

Found a bug or missing a field? Let us know in the actor's Issues tab. Every report is read, and fixes ship as new versions of the actor.

# Actor input Schema

## `departureIATA` (type: `string`):

3-letter IATA code(s) such as LAX or JFK. Separate several codes with commas: every departure is searched against every destination, each pair as its own route. City names london, paris, tokyo and nyc are accepted.

## `arrivalIATA` (type: `string`):

3-letter IATA code(s), separated by commas for several destinations (e.g. LHR, CDG, FRA). 'london' searches LHR.

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

Travel date. A date in the past or less than 2 days away is moved to 21 days from today; the date really searched is shown in every row.

## `departureDateRng` (type: `string`):

Not used at the moment.

## `arrivalDate` (type: `string`):

Return date for a round trip; leave empty for one way. A return date on or before the departure date is moved to 7 days after it.

## `arrivalDateRng` (type: `string`):

Not used at the moment.

## `multi_city_json` (type: `string`):

JSON list of two or more legs for a multi-city trip: \[{"departure_id":"SAN","arrival_id":"LAX","date":"2026-11-15"},{"departure_id":"LAX","arrival_id":"MAD","date":"2026-11-17"}]. When set, the airports and dates above are not used. Results list the options for the first flight with the price of the whole trip, as Google shows them.

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

Number of adult passengers (12+ years). At most 9 passengers in total.

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

Number of children (2-12 years).

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

Number of infants (under 2 years, on lap). One adult per infant.

## `seatclass` (type: `string`):

Cabin to search.

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

Most layovers a flight may have. Only flights within the limit are returned; a route with none gives no rows and is not charged.

## `alliances` (type: `string`):

Keep only flights where every leg is flown by a member of these alliances: STAR, SKYTEAM, ONEWORLD (comma-separated). ALL = no filter. Combined with Specific Airlines, a flight may use any of the chosen airlines or alliance members.

## `airlines` (type: `string`):

Keep only flights where every leg is flown by these airlines: 2-character codes, comma-separated (e.g. AA, DL). ALL = no filter.

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

Highest price in the chosen currency (0 = no limit). Flights without a shown price are left out when a limit is set.

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

Price currency (USD, EUR, BDT, etc.).

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

Language of airport and airline names (e.g. 'en', 'fr', 'de', 'es'). Default: 'en'

## `gl` (type: `string`):

Country Google Flights searches from, which can change prices (e.g. 'us', 'uk', 'fr', 'de'). Default: 'us'

## `max_pages` (type: `integer`):

Not used at the moment: every search reads Google's full flight list.

## `maximum` (type: `integer`):

Most flights saved per route, best flights first. Free plan: up to 20 flights per run (all routes together) and 200 per month; paid plans have no limit.

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

Default: Apify residential proxy, with a new exit address on every retry. Other proxy groups move to residential when Google blocks; with no proxy the actor starts direct and switches to a proxy when blocked.

## Actor input object example

```json
{
  "departureIATA": "LAX",
  "arrivalIATA": "JFK",
  "departureDate": "2026-10-15",
  "departureDateRng": "",
  "arrivalDate": "",
  "arrivalDateRng": "",
  "multi_city_json": "",
  "adults": 1,
  "children": 0,
  "infants": 0,
  "seatclass": "1",
  "stops": "2",
  "alliances": "ALL",
  "airlines": "ALL",
  "maxPrice": 0,
  "currency": "USD",
  "hl": "en",
  "gl": "us",
  "max_pages": 1,
  "maximum": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Every saved flight: best-flight flag, price, duration, airline, airports, stops, route, dates and the full flight details with every leg.

## `searchResults` (type: `string`):

A list with one entry per route: search parameters, counts, best and other flights, and airport names.

# 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 = {
    "departureIATA": "LAX",
    "arrivalIATA": "JFK",
    "departureDate": "2026-10-15",
    "stops": "2",
    "maximum": 5,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fastdataapi/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 = {
    "departureIATA": "LAX",
    "arrivalIATA": "JFK",
    "departureDate": "2026-10-15",
    "stops": "2",
    "maximum": 5,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("fastdataapi/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 '{
  "departureIATA": "LAX",
  "arrivalIATA": "JFK",
  "departureDate": "2026-10-15",
  "stops": "2",
  "maximum": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call fastdataapi/google-flights-scraper --silent --output-dataset

```

## MCP server setup

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