# Google Flights Scraper & API — Airfare & Price Calendar (`aaronoptimus/google-flights-scraper`) Actor

Google Flights scraper and API: airfare, airlines, times, stops, layovers, CO2 and price insights for one-way, round-trip and multi-city trips, date ranges, every seller's fare with booking links, and cheapest-date calendars. Pay per result plus a small start fee, no platform fees.

- **URL**: https://apify.com/aaronoptimus/google-flights-scraper.md
- **Developed by:** [Aaron Tuttle](https://apify.com/aaronoptimus) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 94.7% 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

**Scrape Google Flights airfare for $1.20 per 1,000 flights (as low as $0.80 on Business plans), plus a small start fee and no platform fees.** Track fares on your routes, find the cheapest day to fly, or feed flight prices into your app, spreadsheet or AI agent.

This Google Flights scraper and API returns **every flight Google lists for the search** (up to *Max flights per search*) as clean JSON, CSV or Excel, for one-way, round-trip and **multi-city** trips: price, airlines, flight numbers, departure and arrival times, duration, stops and layovers, aircraft, legroom, Wi-Fi, CO2 emissions, and Google's **"prices are low / typical / high" insight** with the typical price range. Add **round-trip pairs with exact prices**, **every seller's fare** (airline or travel agency) with booking links, and **price calendars** with the cheapest fare for each departure date and the 5 cheapest days to fly.

Instead of loading pages in a browser, it reads the same data feed the Google Flights page loads in the background. That makes it fast and cheap to run.

### What Google Flights data can you scrape?

| Data | Details |
|---|---|
| Flight | Price, currency, position in Google's list, Google's *top flight* mark, airlines, flight numbers, departure and arrival airports and local times, total duration, number of stops |
| Legs | For each flight: flight number, airline, operated by, also sold as (codeshares), airports with full names, times, duration, aircraft, legroom, Wi-Fi / power / video, overnight flag, CO2 |
| Layovers | Airport, airport name, city, length in minutes, overnight, change of airport |
| Emissions | CO2 in grams, typical CO2 for the route, difference in %, lower / typical / higher |
| Price insight | Low / typical / high, typical price range (on every flight); typical price, lowest price and about 60 days of price history (optional row) |
| Round trips | Outbound flights with round-trip totals; optionally each top outbound flight's return flights with the exact price of the pair |
| Multi-city trips | First flights with the price of the whole trip; optionally complete itineraries (`nextFlights`) with exact prices |
| Booking options | Seller (airline or agency), airline-direct flag, fare name, price, carry-on and checked bag included, booking link, cheapest seller |
| Price calendar | Cheapest fare per departure date (and return date for round trips); the 5 cheapest dates per route in the run summary |
| Links | A Google Flights link for every search; `dataSource` says whether a result came from Google's data feed or the results page |

#### Why use this Google Flights scraper

- **Reliable by design.** Every throttled request is retried on a fresh session and IP with short backoff. Each request has a time limit, so runs never hang. If the data feed fails, the scraper reads the same flights from the normal Google Flights results page. If Google keeps blocking the default proxy, it switches to residential proxy automatically.
- **No platform fees on top.** You pay per result plus a small start fee. Compute and proxy costs are included. Failed searches and searches with no flights are free.
- **Everything Google shows for a flight.** Each flight number with its airline, operating carrier and codeshares, airports with full names, local times, layovers with city and length, aircraft, legroom, Wi-Fi, power and on-demand video, CO2 compared with typical, and self-transfer warnings.
- **Price insight on every flight.** Whether today's prices for the search are low, typical or high, and Google's typical price range. Optionally about 60 days of price history per search.
- **Real round-trip prices.** Google shows round-trip totals for outbound flights first; this scraper can also pick the top outbound flights and list their return flights with the exact price of each pair.
- **Multi-city trips.** Up to 5 flights per trip (`JFK-LHR 2026-11-20; LHR-CDG 2026-11-25; CDG-JFK 2026-12-02`), with the price of the whole trip, complete itineraries for the top first flights, and booking options for them.
- **Booking options.** Every seller of a flight (the airline and online travel agencies), each fare (*Basic Economy*, *Main Cabin*...) with its price, whether a carry-on and a checked bag are included, and a booking link.
- **Price calendars.** The cheapest fare for up to 300 consecutive departure dates per route, in a few requests, plus the 5 cheapest dates in the run summary: find the cheapest day to fly.
- **Google's own filters.** Stops, airlines and alliances (include or exclude), maximum price, maximum duration, layover length, connecting airports, departure and arrival times, bags in the price, no basic economy, lower emissions, cabin class, and every sort order.
- **Date ranges.** Search every departure date between two dates, or only Fridays and Saturdays for weekend trips.
- **Bulk-friendly.** Many routes times many dates in one run (up to 500 searches), several airports per side (`JFK, EWR - LHR`) and city codes (`NYC`, `LON`, `PAR`, `TYO`...).
- **Paste Google Flights links.** Set up a search on google.com/travel/flights, copy the address, done. Every result links back to the same search on Google Flights.

### How much does it cost to scrape Google Flights?

You pay per result plus a small start fee. Compute and proxy costs are included, with no platform fees. Prices drop on higher Apify plans:

| Event | Free | Starter | Scale | Business |
|---|---|---|---|---|
| Run start (once per run) | $0.005 | $0.005 | $0.005 | $0.005 |
| Flight | $0.0012 | $0.001 | $0.0009 | $0.0008 |
| Booking options (all sellers) | $0.006 | $0.005 | $0.0045 | $0.004 |
| Calendar date | $0.0002 | $0.0002 | $0.0002 | $0.0002 |

A **Flight** is a one-way flight, the first flight of a round or multi-city trip, or a complete trip. **Booking options** are every seller and fare for one flight, with booking links. A **Calendar date** is the cheapest fare on one departure date.

| Example | Free | Starter | Scale | Business |
|---|---|---|---|---|
| 30 flights for one route and date (the default search) | $0.041 | $0.035 | $0.032 | $0.029 |
| 30 flights with booking options for each | $0.221 | $0.185 | $0.167 | $0.149 |
| 30 flights for one route on each of 30 dates | $1.085 | $0.905 | $0.815 | $0.725 |
| 1,000 flights | $1.205 | $1.005 | $0.905 | $0.805 |
| 90-day price calendar for one route (plus its first 5 flights) | $0.029 | $0.028 | $0.028 | $0.027 |

**Apify's $5 free plan covers about 4,000 flights.**

Searches that fail or find no flights, flights Google shows without a price, booking lookups without sellers, and calendar dates without a fare are not charged. Your **Maximum cost per run** setting is always respected, also with parallel sessions. When Apify doesn't tell the run your plan, it budgets at the Free price, so a run on a cheaper plan may stop a little before your maximum.

### How to scrape Google Flights

1. Enter one or more **routes** as airport codes, one per line: `JFK-LAX`, `JFK, EWR - LHR`, `NYC - PAR`.
2. Enter one or more **departure dates**: `2026-11-20`, or relative to the run like `30 days` or `2 weeks` (handy for scheduled runs). Or set a **date range** with *Departure dates from* and *Departure dates to*, optionally weekends only.
3. Pick **one-way or round trip** (and the number of days until the return flight, or a return date), the passengers and the cabin. For **multi-city** trips, list each trip's flights under *Multi-city trips* instead.
4. Optional: filters, round-trip pairs, booking options, a price calendar.
5. Click **Start**. Download the results as JSON, CSV, Excel or HTML, or read them with the API.

#### Input examples

Cheapest one-way flights from New York to Los Angeles on two dates:

```json
{
    "routes": ["JFK, LGA, EWR - LAX"],
    "departureDates": ["2026-11-20", "2026-11-27"],
    "sortBy": "cheapest",
    "maxFlightsPerSearch": 20
}
```

A week-long round trip in business class for two, nonstop on Oneworld airlines, with return flights and booking options for the top 3:

```json
{
    "routes": ["JFK-LHR"],
    "departureDates": ["45 days"],
    "tripType": "round-trip",
    "tripLengthDays": 7,
    "adults": 2,
    "cabinClass": "business",
    "maxStops": "nonstop",
    "airlines": ["Oneworld"],
    "returnFlightsForTopOutbound": 3,
    "maxReturnFlightsPerOutbound": 5,
    "bookingOptionsForTop": 3
}
```

A multi-city trip with complete itineraries for the top 3 first flights:

```json
{
    "multiCityTrips": ["JFK-LHR 2026-11-20; LHR-CDG 2026-11-25; CDG-JFK 2026-12-02"],
    "maxFlightsPerSearch": 10,
    "returnFlightsForTopOutbound": 3,
    "maxReturnFlightsPerOutbound": 5
}
```

Every Friday and Saturday departure in December, as 2-day weekend round trips:

```json
{
    "routes": ["LAX-LAS"],
    "departureDateFrom": "2026-12-01",
    "departureDateTo": "2026-12-31",
    "weekendsOnly": true,
    "tripType": "round-trip",
    "tripLengthDays": 2,
    "maxFlightsPerSearch": 5
}
```

The cheapest day to fly in the next three months:

```json
{
    "routes": ["SFO-HNL"],
    "departureDates": ["7 days"],
    "maxFlightsPerSearch": 5,
    "priceCalendarDays": 90
}
```

#### Output example (shortened)

```json
{
    "type": "flight",
    "route": "JFK → LAX",
    "tripType": "one-way",
    "departureDate": "2026-11-20",
    "position": 1,
    "isTopFlight": true,
    "price": 289,
    "currency": "USD",
    "priceLevel": "high",
    "typicalPriceLow": 140,
    "typicalPriceHigh": 275,
    "flightNumbers": ["B6 123"],
    "airlines": ["JetBlue"],
    "departureAirport": "JFK",
    "arrivalAirport": "LAX",
    "departureTime": "2026-11-20T06:00",
    "arrivalTime": "2026-11-20T08:52",
    "durationMinutes": 352,
    "stops": 0,
    "legs": [
        {
            "flightNumber": "B6 123",
            "airline": "JetBlue",
            "departureAirportName": "John F. Kennedy International Airport",
            "arrivalAirportName": "Los Angeles International Airport",
            "aircraft": "Airbus A320",
            "legroom": "33 inches",
            "amenities": { "wifi": true, "power": null, "onDemandVideo": null },
            "co2Grams": 407055
        }
    ],
    "layovers": [],
    "co2Grams": 407000,
    "typicalCo2Grams": 355000,
    "co2DifferencePercent": 15,
    "emissionsLevel": "higher",
    "googleFlightsUrl": "https://www.google.com/travel/flights/search?tfs=...",
    "warnings": []
}
```

Other row types share the same route and date fields:

- `round-trip`: an outbound flight with one of its return flights (`returnFlight`), and the exact price of the pair.
- `multi-city`: the first flight with the following flights (`nextFlights`), and the exact price of the whole trip. The flights of the trip are in `tripFlights`.
- `booking-options`: the flight numbers plus `bookingOptions`, e.g. `{ "seller": "American", "isAirline": true, "fareName": "Main Cabin", "price": 457, "carryOnIncluded": true, "checkedBagIncluded": false, "bookingUrl": "https://www.google.com/travel/clk/f?u=..." }`, sorted cheapest first.
- `calendar-date`: `departureDate`, `returnDate` (round trips) and the cheapest `price` that day.
- `price-insight` (optional, free): price level, typical price and range, and `priceHistory` as `[{ "date": "2026-09-21", "price": 214 }, ...]`.
- `error`: a search that failed or found nothing, with the reason (never charged).

Prices are what Google Flights shows: the total for all passengers in the search, taxes and fees included. Times are local to each airport, as on Google Flights. `googleFlightsUrl` opens the same route, dates, passengers, cabin, stops and airlines on Google Flights; other filters (price, times, bags, sort order) are set again there. The **Flights**, **Price calendar** and **Booking options** tabs of the results show the most useful columns.

### Google Flights API: Python, JavaScript, Zapier, Make and AI agents (MCP)

Run it through the [Apify API](https://docs.apify.com/api/v2) or the Apify clients for Python and JavaScript:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("aaronoptimus/google-flights-scraper").call(run_input={
    "routes": ["JFK-LAX"],
    "departureDates": ["30 days"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["type"] == "flight":
        print(item["price"], item["flightNumbers"], item["departureTime"])
```

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('aaronoptimus/google-flights-scraper').call({ routes: ['JFK-LAX'], departureDates: ['30 days'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((i) => i.type === 'flight').map((i) => [i.price, i.flightNumbers]));
```

It also works with Zapier, Make, n8n and Google Sheets. AI agents (Claude, ChatGPT, Cursor and other MCP clients) can use it through the Apify MCP server: `https://mcp.apify.com?tools=aaronoptimus/google-flights-scraper`.

### Tips

- **Track fares over time:** schedule the scraper (Apify Schedules) with relative dates like `30 days`, and compare runs.
- **Round-trip and multi-city prices:** the first-flight list already shows Google's totals for the whole trip. Set *Next flights for the top N first flights* when you need complete itineraries with the exact price of each. For multi-city trips, the middle flights are Google's top choice after the flight before; the last flight lists several options.
- **Premium cabins:** for business and first class round trips, Google often shows no price until a return flight is chosen. Those flights come with a note; use the next-flights setting to get prices.
- **Market:** fares can differ by country. Set *Country* and *Currency* to the market you want; proxy IPs are taken from that country.
- **Big runs:** raise *Parallel sessions* for many routes and dates; leave the delay at 1 second.

> **What this tool doesn't do**
>
> - It doesn't book flights or hold fares: booking links open the seller's site.
> - No "anywhere" or Explore searches yet, and no country names as origin: use airport or city codes.
> - No personal data and no logged-in features (price tracking emails, saved trips).
> - Prices are Google's, for the market you choose; they can change between the run and booking.

### FAQ

**Do I need a Google account or API key?** No. The scraper only reads public Google Flights results, logged out.

**Why is a flight's price `null`?** Google didn't show a price for it, which happens for premium round trips until a return flight is chosen (see Tips). Those flights are delivered with their details but not charged; use the next-flights setting to get prices.

**Are booking links permanent?** They are Google's own redirect links to the seller and work for a while after the run, like the links on the Google Flights page. Fares change quickly; book soon after scraping.

**Can I search multi-city trips?** Yes: up to 5 flights per trip under *Multi-city trips*, or paste a Google Flights multi-city link.

**Can I search "anywhere" or by country name?** Not yet: use airport or city codes. Several airports per side are fine (`JFK, EWR - LHR, LGW`).

**Which airports can I use?** Any 3-letter IATA airport code, several per side, and the common city codes NYC, LON, PAR, TYO, CHI, WAS, MIL, ROM, SAO, RIO, BUE, MOW, STO, OSA, SEL, BJS, YTO, YMQ.

**Is scraping Google Flights legal?** The scraper only collects public flight and fare information, no personal data. Check that your use complies with the laws and terms that apply to you.

### Related tools

By the same developer: [Google Hotels Scraper](https://apify.com/aaronoptimus/google-hotels-scraper) for hotel prices and every booking site's rate on the same trip, [Google Trends Scraper](https://apify.com/aaronoptimus/google-trends-scraper) for search interest in destinations, [Google Autocomplete Scraper](https://apify.com/aaronoptimus/google-autocomplete-scraper) for travel keyword ideas, [Google News Scraper](https://apify.com/aaronoptimus/google-news-scraper) for airline and destination headlines, [Google Ads Transparency Scraper](https://apify.com/aaronoptimus/google-ads-transparency-scraper) for airlines' and OTAs' ads, [Google Jobs Scraper](https://apify.com/aaronoptimus/google-jobs-scraper) for aviation and travel jobs, [PageSpeed Insights Bulk Audit](https://apify.com/aaronoptimus/pagespeed-insights-bulk-audit) for your booking pages' Core Web Vitals, and [Google Analytics 4 Exporter](https://apify.com/aaronoptimus/google-analytics-4-exporter) for your travel site's GA4 reports.

### Support

Found a problem or need a field? Open an issue on the Issues tab. If the Actor saves you time, a short review helps others find it.

This Actor is an independent tool and is not affiliated with, endorsed by or sponsored by Google.

# Changelog

This Actor's version history is a separate document: https://apify.com/aaronoptimus/google-flights-scraper/changelog.md

# Actor input Schema

## `routes` (type: `array`):

One route per line, as airport codes: "JFK-LAX", "JFK, EWR - LHR" (several airports on one side), or city codes like NYC, LON, PAR, TYO (all of the city's airports). Each route is searched on every departure date below.

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

One or more dates like 2026-11-20, or dates relative to the run like "30 days" or "2 weeks". Each date is a separate search for every route.

## `departureDateFrom` (type: `string`):

Search every departure date from this date to "Departure dates to" (added to the dates above). YYYY-MM-DD or relative, like "14 days". Each date is one search per route, capped by "Maximum searches".

## `departureDateTo` (type: `string`):

Last departure date of the range, e.g. 2026-12-20 or "60 days".

## `weekendsOnly` (type: `boolean`):

Only search Fridays and Saturdays in the date range. Combine with "Trip length (days)" for weekend round trips (e.g. 2 days).

## `tripType` (type: `string`):

One-way, or round trip (prices are then the round-trip total). For multi-city trips use "Multi-city trips" below.

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

For round trips: the return flight is this many days after each departure date. Ignored when a return date is set.

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

Optional. One return date for every departure date (departure dates after it are skipped). Leave empty to use the number of days above.

## `searchUrls` (type: `array`):

Optional. Paste Google Flights search links (open a search on google.com/travel/flights, then copy the address). Their airports, dates, passengers and cabin are used; the filters below still apply.

## `multiCityTrips` (type: `array`):

Optional. One trip per line, its flights separated by ";": "JFK-LHR 2026-11-20; LHR-CDG 2026-11-25; CDG-JFK 2026-12-02" (2 to 5 flights, dates as above). Each trip lists its first flights with the price of the whole trip; set "Next flights for the top N first flights" for complete itineraries.

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

Passengers aged 12 and over.

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

Passengers aged 2 to 11.

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

Under 2, with their own seat.

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

At most one per adult.

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

Cabin for every flight of the trip.

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

Maximum number of stops per direction.

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

Only these airlines: 2-letter codes (AA, BA, LH, DL...) or alliances (Oneworld, SkyTeam, Star Alliance).

## `excludeAirlines` (type: `array`):

Leave out these airlines (2-letter codes or alliances).

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

Only flights up to this price (in the currency below; for round trips, the round-trip total).

## `maxDurationHours` (type: `integer`):

Only itineraries up to this many hours, connections included.

## `minLayoverHours` (type: `number`):

Optional. Only flights whose connections are at least this long, e.g. 1.5. 0 = no minimum.

## `maxLayoverHours` (type: `number`):

Optional. Only flights whose connections are at most this long, e.g. 4. 0 = no maximum.

## `connectingAirports` (type: `array`):

Optional. Only flights that connect at these airports, e.g. ORD, FRA.

## `departureTimeFrom` (type: `integer`):

Only flights leaving at or after this hour (0-23, local time).

## `departureTimeTo` (type: `integer`):

Only flights leaving before this hour (1-24, local time).

## `arrivalTimeFrom` (type: `integer`):

Only flights arriving at or after this hour (0-23, local time).

## `arrivalTimeTo` (type: `integer`):

Only flights arriving before this hour (1-24, local time).

## `checkedBags` (type: `integer`):

Add the airline's fees for this many checked bags to the prices, as Google's Bags filter does.

## `carryOnBag` (type: `boolean`):

Add carry-on bag fees to the prices.

## `excludeBasicEconomy` (type: `boolean`):

Leave out basic economy fares (no seat choice or carry-on).

## `lessEmissionsOnly` (type: `boolean`):

Only flights with lower than typical CO2 emissions.

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

Order of the flights, as on Google Flights.

## `maxFlightsPerSearch` (type: `integer`):

How many flights to return per route and date, in Google's order. Each flight is one result.

## `returnFlightsForTopOutbound` (type: `integer`):

For round trips and multi-city trips, also choose each of the top N first flights and list the flights that can follow it, with the exact price of the whole trip (as Google shows after you pick a flight). Round trips list return flights; multi-city trips take Google's top choice for the middle flights and list options for the last one. Each complete trip is one result. 0 = first flights only.

## `maxReturnFlightsPerOutbound` (type: `integer`):

How many return flights (or last-flight options for multi-city trips) to list for each chosen first flight.

## `bookingOptionsForTop` (type: `integer`):

Get every seller (airline or travel agency), fare name and price for the top N flights of each search, with a booking link. For round trips and multi-city trips this needs "Next flights for the top N first flights" and uses each first flight's best complete trip. Charged per flight that has booking options. 0 = off.

## `priceCalendarDays` (type: `integer`):

Also get the cheapest fare for each of this many consecutive departure dates, starting at the first departure date of each route (round trips keep the same trip length; with a fixed return date, the trip length of the first departure date). Each date with a fare is one calendar result. 0 = off.

## `includePriceHistory` (type: `boolean`):

Add one free row per search with Google's price insight: whether prices are low, typical or high, the typical range, and about 60 days of price history. Every flight already carries the price level and typical range.

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

3-letter currency code for all prices, e.g. USD, EUR, GBP, CAD, AUD, INR.

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

2-letter code of the country you search from, e.g. US, GB, DE. Fares can differ by market; Apify Proxy IPs are taken from this country.

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

Language of airport and airline names, e.g. en-US, en-GB, de, fr, es.

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

Google throttles repeated requests. Apify Proxy is recommended; sessions and IPs rotate automatically. IPs come from the Country above unless you pick a proxy country here.

## `useResidentialFallback` (type: `boolean`):

If Google keeps blocking the default proxy, switch to Apify residential proxy in the same country automatically. No extra cost to you.

## `maxSearches` (type: `integer`):

Upper limit on flight searches in one run (routes x departure dates, multi-city trips and links). Searches past the limit are skipped with a note. Your "Maximum cost per run" also stops the run when reached.

## `maxConcurrency` (type: `integer`):

How many requests run at the same time, each with its own session and IP. Higher is faster for big runs.

## `maxRetries` (type: `integer`):

How many times to retry with a fresh session and IP when Google throttles a request.

## `maxSecondsPerSearch` (type: `integer`):

Stop retrying a search, return-flight list, booking lookup or calendar range after this long, so one stubborn request can't stall the run. It is reported as failed and not charged.

## `delayBetweenRequestsSecs` (type: `integer`):

Pause between requests in each session to stay under Google's rate limits.

## Actor input object example

```json
{
  "routes": [
    "JFK-LAX"
  ],
  "departureDates": [
    "30 days"
  ],
  "weekendsOnly": false,
  "tripType": "one-way",
  "tripLengthDays": 7,
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "checkedBags": 0,
  "carryOnBag": false,
  "excludeBasicEconomy": false,
  "lessEmissionsOnly": false,
  "sortBy": "best",
  "maxFlightsPerSearch": 30,
  "returnFlightsForTopOutbound": 0,
  "maxReturnFlightsPerOutbound": 10,
  "bookingOptionsForTop": 0,
  "priceCalendarDays": 0,
  "includePriceHistory": false,
  "currency": "USD",
  "country": "US",
  "language": "en-US",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "useResidentialFallback": true,
  "maxSearches": 500,
  "maxConcurrency": 5,
  "maxRetries": 6,
  "maxSecondsPerSearch": 120,
  "delayBetweenRequestsSecs": 1
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "routes": [
        "JFK-LAX"
    ],
    "departureDates": [
        "30 days"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("aaronoptimus/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 = {
    "routes": ["JFK-LAX"],
    "departureDates": ["30 days"],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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