# Google Flights Scraper | Fares & Itineraries (`danthedataman/google-flights-fare-atlas`) Actor

Export live Google Flights fares for one-way, round-trip and multi-city trips. Get full itineraries, fare data, flight details and optional booking offers in JSON or CSV.

- **URL**: https://apify.com/danthedataman/google-flights-fare-atlas.md
- **Developed by:** [Eli J](https://apify.com/danthedataman) (community)
- **Categories:** Travel, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.02 / 1,000 flight rows

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

Export live Google Flights fares for one-way, round-trip and connected multi-city trips. Each row contains a complete priced itinerary or an unpriced schedule returned by Google, with flight segments, stops, airlines and available fare details. Use the data for trip comparisons, fare monitoring and travel research; optional booking lookups add provider offers and forms.

Expanded result lists are requested before optional filters and row limits. Export the dataset as JSON, CSV or Excel through Apify. Fares are observed when run and can change before booking.

### Quick start

```json
{"searches":[{"origin":"JFK","destination":"LAX","departureDate":"2027-03-17"}]}
```

For a round trip, add `"returnDate":"2027-03-21"`. For a connected multi-city trip:

```json
{"searches":[{"legs":[{"origin":"JFK","destination":"LAX","departureDate":"2027-03-17"},{"origin":"LAX","destination":"SFO","departureDate":"2027-03-21"}]}],"currency":"EUR","country":"FR","language":"fr","cabinClass":"business","adults":2}
```

A grouped origin is an array, for example `"origin":["JFK","EWR"]`. Locations also accept exact city names such as `"New York"`, and Google place IDs such as `"/m/02_286"`. Names are resolved through Google's anonymous suggestions with an exact name match. A search can instead contain `{"url":"https://www.google.com/travel/flights/search?tfs=..."}` with airport or place-ID legs. Currency, market, cabin and passengers come from the explicit Actor controls.

### Input

| Field | Type | Default | Meaning |
| --- | --- | --- | --- |
| `searches` | array | No searches | Up to 20 independent searches. Use origin, destination and departureDate; returnDate makes a round trip. Multi-city uses 2 to 20 legs. Locations accept IATA codes, exact city names, Google place IDs or arrays. Google Flights tfs URLs may supply the itinerary. Country-wide locations are unproved. |
| `currency` | string | `"USD"` | Three-letter fare currency. Google returns prices; no conversion is performed. |
| `country` | string | `"US"` | Two-letter Google search market. |
| `language` | string | `"en-US"` | Google result language tag. |
| `cabinClass` | string | `"economy"` | Requested cabin, applying to every leg. |
| `adults` | integer | `1` | 1 to 9 adults. |
| `children` | integer | `0` | Children aged 2 to 11. |
| `infantsOnLap` | integer | `0` | At most one per adult. |
| `infantsInSeat` | integer | `0` | Infants with their own seat. |
| `sortBy` | string | `"best"` | Google order, cheapest total fare, fastest complete trip, or final-leg times. |
| `includeBookingDetails` | boolean | `false` | Resolve provider options and booking forms for returned fares. Additional requests increase runtime. |
| `airlines` | array | `[]` | Carrier codes or STAR_ALLIANCE, ONEWORLD, SKYTEAM. Alliance/mixed filters use Google's source selection; code-only filters also check every returned segment. Empty means all carriers. |
| `maxStops` | integer | Unset | 0 for nonstop, 1 or 2 for a per-leg maximum. |
| `maxPrice` | integer | Unset | Maximum total itinerary price in requested currency; zero permits only zero-priced fares. |
| `maxDuration` | integer | Unset | Maximum leg duration in minutes. |
| `maxResults` | integer | Unlimited | Omit for all expanded final-leg alternatives. Zero requests no work. |
| `maxBookingDetails` | integer | Unlimited | Omit for all retained fares. Zero disables booking lookups. |
| `departureTimeEarliest` | string | Unset | HH:MM local time bound applied to every leg. |
| `departureTimeLatest` | string | Unset | HH:MM local time bound applied to every leg. |
| `arrivalTimeEarliest` | string | Unset | HH:MM local time bound applied to every leg. |
| `arrivalTimeLatest` | string | Unset | HH:MM local time bound applied to every leg. |

The input form supplies a prefill for testing; API input `{}` performs no work and exits successfully with guidance. `searches: []` and `maxResults: 0` also perform no work. At most 20 searches, 20 connected legs, and nine passengers are accepted. Dates must be real `YYYY-MM-DD` dates in travel order. Invalid settings and unresolved searches go to the run’s `ERRORS` record; they never become dataset rows. An empty valid result is successful. A run where every search fails is marked failed.

Filters apply to every leg. Price filtering and fastest sorting use the complete itinerary. Time sorting uses the final leg. Google applies airline/alliance selection before expansion; code-only selections also check every returned segment. Other filters operate on returned schedules, so they cannot recover inventory Google did not return. Null price rows are retained unless a price filter is active.

Country-wide name resolution is an open limitation. Unsupported names go to `ERRORS`; the Actor does not silently substitute their capitals. Names must match Google's result language. Ambiguous names use the first exact city match in Google order. Use a qualified city name in the result language or a place ID to select a specific city. Arbitrary place IDs require Google to echo the requested location; the Actor does not maintain a geographic airport membership database.

### Coverage and completeness

For one-way searches, all expanded best and other flights returned by Google are considered. For round-trip and multi-city searches, the first eligible earlier-leg choice in Google order is selected at each stage, and all expanded final-leg alternatives are returned with those earlier selections. This is one complete journey selection with final-leg alternatives; it does not enumerate the Cartesian product of every earlier flight choice. Duplicate booking tokens retain the first fare. Omit `maxResults` to retain every eligible row.

`expandedResultCounts` records raw Google row counts at each stage; `resultCount` is the number of retained rows before a charge limit stops delivery. Neither counts all possible flights in the market. Calendars, date grids, date pickers and Explore are outside this release. Fares can change after retrieval.

The input grammar accepts up to 20 connected legs. Live coverage at six and twenty legs remains unproved; accepting that input is not a completeness guarantee for those trip lengths.

### Output

| Field | Meaning |
| --- | --- |
| `recordType` | Always `flight`. |
| `searchIndex` | Zero-based index in the input searches. |
| `origin`, `destination`, `departureDate`, `returnDate`, `tripType` | Actual airports and trip dates; returnDate is null except round trips. |
| `cabinClass`, `price`, `currency` | Requested cabin and total quoted itinerary fare in Google’s currency; price may be null. No conversion or checkout-price guarantee. |
| `totalDuration`, `stops` | Sum of leg durations in minutes and connection counts. |
| `airlines`, `airlineCodes` | Distinct carrier names and codes from each segment's flight number. |
| `airports` | Endpoint airport metadata from Google: code, name, city and country. Place-ID endpoint metadata is not represented as an airport, so this array can be empty for city searches. |
| `outbound`, `return`, `legs` | Complete journey legs; return is populated only for round trips. |
| `co2Emissions` | Sum of Google leg estimates in grams, or null if any estimate is absent. |
| `baggageAllowance` | Included carry-on and checked counts for the current fare, or null counts when unavailable. Verify final provider rules. |
| `bookingToken`, `bookingDetails` | Google token and optional provider choices, forms and baggage policies. |
| `priceInsights` | Google’s typical low/high prices and historical timestampMs/price observations, or null. `priceLevel` is low, typical or high, derived by comparing Google's search-level current price with its typical band; null when those values are absent. It is not a verdict on each individual fare. |
| `expandedResultCounts`, `resultCount` | Source stage counts and retained result count as described above. |
| `googleFlightsUrl` | Google search URL retaining trip locations, dates, cabin, all passenger types, airline/alliance filters and locale/currency. |
| `scrapedAt` | UTC time of row projection. |

Each leg contains actual origin/destination, departureDate, duration, stops, segments, co2Emissions and co2ComparedToTypicalPercent. Segment fields are airline, airlineCode, flightNumber, aircraft, departureAirport, departureAirportName, arrivalAirport, arrivalAirportName, departureTime, arrivalTime, duration and layover. A layover has airport and duration in minutes. Flight times use the airport’s local clock; exact UTC offsets are retained when provided in Google’s encoded fare metadata. No offset is invented when that metadata is absent.

### Booking options

Set `includeBookingDetails: true` to request booking options. A booking lookup is attempted for each retained fare unless `maxBookingDetails` limits it. Zero disables lookups. `bookingDetails` is null if not requested or unavailable. Available details contain bookingOptions, baggagePolicies and googleFlightsUrl. Each option contains providerCode, provider, isAirlineDirect, displayUrl, flightNumbers, price, currency, bookingForm, fareClass and baggageFees. `baggageFees` labels firstCheckedBag and carryOn as amount/currency objects; a free bag has amount zero and unavailable fees are null. `secondCheckedBag` remains null because its positional mapping was not independently confirmed. Verify final provider rules.

`bookingDetails.priceInsights` contains the selected fare's typical band, history and derived low/typical/high priceLevel when Google supplies them; this band can differ from the top-level search band. It requires a booking lookup. `displayUrl` is display text. `bookingForm` supplies an action and string fields; all fields belong together. This Actor returns forms and never submits them or purchases tickets. Options may be empty when Google has no provider offer. A failed optional lookup is recorded in `ERRORS` while the usable fare is retained. Booking lookups increase run cost and duration.

### Billing and access

The `flight-row` event charges once per delivered row for the first 100 rows of each search. Additional rows of that search are delivered free. There is no search fee or priced `apify-default-dataset-item` event. Amounts are shown in the Actor's pricing; Apify's Actor start fee also applies. Empty or failed searches incur no flight-row charges; errors never become dataset items. Optional booking failures leave usable fares billable. Before starting a search, the Actor checks that the remaining charge cap covers one flight-row. The SDK limits each paid push to affordable rows; if the cap binds before row 100, delivery stops before further booking lookups or searches. Once row 100 is paid, the free remainder is delivered even if that charge exhausts the cap. The next search starts a new 100-row paid window. Unbooked results use separate paid and free batch writes; booking results are written individually.

Requests use cookie-free HTTP through Apify datacenter, without a browser or login. Shopping and booking operations start four requests together on distinct fresh proxy sessions, take the first valid response and cancel the remaining requests. Only when every request in a wave fails does the next wave start, within nine total attempts per operation (four, four, then one). Searches, later legs and booking lookups each perform their own operations. Names add a serial suggestion lookup capped at nine fresh-session attempts. Run with 1024 MB memory and a 300-second timeout. Runtime includes startup and varies with egress and cold image pulls.

The prefill's 2027-03-17 departure is a fixed example, valid through that date. Choose future dates for later runs. The Actor validates calendar dates and travel order; it does not supply historical fares.

# Changelog

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

# Actor input Schema

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

Up to 20 independent searches. Use origin, destination and departureDate; returnDate makes a round trip. Multi-city uses 2 to 20 legs. Locations accept IATA codes, exact city names, Google place IDs or arrays. Google Flights tfs URLs may supply the itinerary. Country-wide locations are unproved.

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

Three-letter fare currency. Google returns prices; no conversion is performed.

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

Two-letter Google search market.

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

Google result language tag.

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

Requested cabin, applying to every leg.

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

1 to 9 adults.

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

Children aged 2 to 11.

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

At most one per adult.

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

Infants with their own seat.

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

Google order, cheapest total fare, fastest complete trip, or final-leg times.

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

Resolve provider options and booking forms for returned fares. Additional requests increase runtime.

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

Carrier codes or STAR_ALLIANCE, ONEWORLD, SKYTEAM. Alliance/mixed filters use Google's source selection; code-only filters also check every returned segment. Empty means all carriers.

## `maxStops` (type: `integer`):

0 for nonstop, 1 or 2 for a per-leg maximum.

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

Maximum total itinerary price in requested currency; zero permits only zero-priced fares.

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

Maximum leg duration in minutes.

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

Omit for all expanded final-leg alternatives. Zero requests no work.

## `maxBookingDetails` (type: `integer`):

Omit for all retained fares. Zero disables booking lookups.

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

HH:MM local time bound applied to every leg.

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

HH:MM local time bound applied to every leg.

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

HH:MM local time bound applied to every leg.

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

HH:MM local time bound applied to every leg.

## Actor input object example

```json
{
  "searches": [
    {
      "origin": "JFK",
      "destination": "LAX",
      "departureDate": "2027-03-17"
    }
  ],
  "currency": "USD",
  "country": "US",
  "language": "en-US",
  "cabinClass": "economy",
  "adults": 1,
  "sortBy": "best",
  "airlines": []
}
```

# Actor output Schema

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

No description

## `errors` (type: `string`):

Handled request failures, when present; never result rows.

# 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": [
        {
            "origin": "JFK",
            "destination": "LAX",
            "departureDate": "2027-03-17"
        }
    ],
    "currency": "USD",
    "country": "US",
    "language": "en-US",
    "cabinClass": "economy",
    "adults": 1,
    "children": 0,
    "infantsOnLap": 0,
    "infantsInSeat": 0,
    "sortBy": "best",
    "includeBookingDetails": false,
    "airlines": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("danthedataman/google-flights-fare-atlas").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": [{
            "origin": "JFK",
            "destination": "LAX",
            "departureDate": "2027-03-17",
        }],
    "currency": "USD",
    "country": "US",
    "language": "en-US",
    "cabinClass": "economy",
    "adults": 1,
    "children": 0,
    "infantsOnLap": 0,
    "infantsInSeat": 0,
    "sortBy": "best",
    "includeBookingDetails": False,
    "airlines": [],
}

# Run the Actor and wait for it to finish
run = client.actor("danthedataman/google-flights-fare-atlas").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": [
    {
      "origin": "JFK",
      "destination": "LAX",
      "departureDate": "2027-03-17"
    }
  ],
  "currency": "USD",
  "country": "US",
  "language": "en-US",
  "cabinClass": "economy",
  "adults": 1,
  "children": 0,
  "infantsOnLap": 0,
  "infantsInSeat": 0,
  "sortBy": "best",
  "includeBookingDetails": false,
  "airlines": []
}' |
apify call danthedataman/google-flights-fare-atlas --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,danthedataman/google-flights-fare-atlas"
        }
    }
}
```

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/ksSXnxDXK1R6yRnJq/builds/OH48h6q92QEGmOBgJ/openapi.json
