# Google Flights API — $0.20/1K rows, fares & booking (`lergassy/google-flights-api`) Actor

\[$0.20/1K rows] Google Flights API: send a route and date over HTTP, get every itinerary Google shows — price, price level, airline, flight numbers, layovers, aircraft, CO2, booking options with seller prices. Batch routes, calendar, multi-city. No fee per request.

- **URL**: https://apify.com/lergassy/google-flights-api.md
- **Developed by:** [Matvey](https://apify.com/lergassy) (community)
- **Categories:** Travel, Agents, MCP servers
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.10 / 1,000 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

## Google Flights API

A **Google Flights API** you can call from anything that speaks HTTP: send a route and a date, get back
the fares Google shows — every itinerary, not the first page. No official Google Flights API exists;
this endpoint talks to the JSON service behind the site, so a search answers in seconds without a
browser.

**$0.20 per 1,000 rows. No fee per request, no fee per search, no proxy fee. Error rows are free.**

### One request

```bash
curl -X POST "https://api.apify.com/v2/acts/lergassy~google-flights-api/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"origin":"DPS","destination":"SIN","departureDate":"2027-03-15","currency":"USD"}'
```

The response is a JSON array of itineraries — no polling, no webhook, no SDK required.

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_TOKEN>")
run = client.actor("lergassy/google-flights-api").call(run_input={
    "origin": "DPS", "destination": "SIN", "departureDate": "2027-03-15",
    "adults": 2, "cabinClass": "business", "maxStops": "0",
})
for f in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f["price"], f["currency"], f["airline"], f["flightNumbers"], f["departAt"])
```

### What comes back

| Field | Example |
|---|---|
| `price` / `currency` / `priceLevel` | 92 / USD / typical — Google's own low/typical/high verdict |
| `airline` / `airlineCodes` / `flightNumbers` | Jetstar / \["JQ"] / \["JQ86"] |
| `stops` / `layovers[]` | 1 / airport, city, duration |
| `departAt` / `arriveAt` / `totalDurationMinutes` | 2027-03-15T15:05 / 2027-03-15T18:00 / 175 |
| `legs[]` | Per leg: flight number, operating carrier, airports, times, aircraft, legroom, CO₂ |
| `emissionsKg` / `emissionsVsTypicalPercent` | 114 / −2 |
| `bookingToken` / `googleFlightsUrl` | Google's token for this itinerary, and a link that reopens the search |
| `bookingOptions[]` (optional) | Seller, price, fees and a deep link — airline and agencies such as Trip.com or Expedia |
| `returnOptions[]` (optional) | Round trips: matched return flights with the total price for both directions |

Every search also returns a summary object: flights found, lowest price, price level, the typical
price band and 60 days of price history.

### Parameters

| Parameter | Notes |
|---|---|
| `origin` / `destination` / `departureDate` / `returnDate` | IATA codes and ISO dates; a return date prices the round trip as one total |
| `adults` / `children` / `infantsInSeat` / `infantsOnLap` | Up to 9 passengers |
| `cabinClass` | economy, premium economy, business, first |
| `maxStops` / `airlines` / `excludeAirlines` / `maxPrice` / `maxDurationMinutes` | Filters |
| `sortBy` | best (Google's ranking), price, duration, departure |
| `currency` / `market` / `language` | Point of sale: what a shopper in that country sees |
| `routes[]` | Many route/date pairs in one request |
| `multiCityLegs[]` | Multi-city itineraries priced leg by leg |
| `calendarDays` | Lowest fare per departure date, up to a year |
| `exploreAnywhere` | Cheapest destinations from an origin |
| `resolveBookingOptions` / `resolveReturnFlights` | Sellers and matched returns for the top results |

### Rate, scale and reliability

Requests run in parallel and each is retried against Google's endpoint with a residential proxy
included in the price; when Google refuses the endpoint the Actor falls back to the results page, and
every row carries `resultsSource` so you know what you got. There is no rate card per request — you
are billed for rows only, so a burst of 500 searches costs the same as 500 searches spread over a day.

Batch 200 route/date pairs into one call with `routes[]` instead of firing 200 calls: same price,
fewer round trips.

### MCP for AI agents

The Actor is exposed over Apify's MCP server, so an agent can call it as a tool without glue code.
Prompts like *"cheapest nonstop DPS–SIN in March, in USD"* or *"is CGK–KUL on 1 November cheap right
now, and who sells it"* are answered from the schema, which is self-describing.

### What it costs

One event, $0.0002 per row — **$0.20 per 1,000**, down to $0.10 on higher Store tiers. A search
returning 50 itineraries costs **one cent**. 50,000 rows cost **$10** with nothing added for requests,
pages, retries or proxy. Rows that fail are never charged, so a bad route costs nothing.

### Notes and limits

Times are local to each airport, as Google displays them. Round-trip prices are the total for both
directions. Stays longer than about a month return fewer itineraries because most airlines cap
round-trip fares — request the two legs as one-ways instead. Prices move during the day; for
monitoring, schedule the call rather than caching a result.

The Actor reads publicly displayed prices and schedules without logging in, bypassing access controls
or collecting personal data. Google's terms restrict automated access, and the legality of scraping
public data depends on your jurisdiction and use; review the terms and consult a lawyer for commercial
use.

### Need an endpoint that isn't here?

**Open an issue on this Actor's page** — answered the same day, most requests shipped within a week.

Related: [Flight Price Calendar](https://apify.com/lergassy/flight-price-calendar) (cheapest dates),
[Flight Price Tracker](https://apify.com/lergassy/flight-price-tracker) (fare alerts),
[Cheap Flight Destinations](https://apify.com/lergassy/cheap-flight-destinations) (Explore as data).

# Actor input Schema

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

Departure airport code, e.g. <code>DPS</code> (Bali), <code>CGK</code> (Jakarta), <code>SIN</code> (Singapore), <code>LHR</code> (London)

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

Arrival airport code, e.g. <code>SIN</code> (Singapore), <code>BKK</code> (Bangkok), <code>SYD</code> (Sydney). Ignored when <b>Explore</b> is on.

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

Format <code>YYYY-MM-DD</code> Leave the whole route empty and the Actor runs a demo search so a first run always returns rows.

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

Leave empty for one-way. Format <code>YYYY-MM-DD</code>. Round-trip prices are the total for both directions.

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

Passengers aged 12 and over (1–9). Prices are the total for all passengers.

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

Passengers aged 2 to 11. Google applies child fares where the airline offers them.

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

Under 2 years old, with their own seat (charged as a child fare on most airlines).

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

Under 2 years old, travelling on an adult's lap (usually ~10% of the adult fare).

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

Economy, premium economy, business or first

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

<code>any</code>, <code>0</code> nonstop only, <code>1</code> up to one stop, <code>2</code> up to two stops

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

ISO code for prices: <code>USD</code>, <code>IDR</code>, <code>EUR</code>, <code>SGD</code>, <code>AUD</code>…

## `market` (type: `string`):

Two-letter country code of the point of sale, e.g. <code>US</code>, <code>ID</code>, <code>GB</code>, <code>DE</code>, <code>AU</code>. Google returns the fares, sellers and booking links available to buyers in that country — prices differ by market. Leave empty for Google's default.

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

Google returns up to ~150 itineraries per search

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

Google's own ranking (best), or by price, duration or departure time

## `calendarDays` (type: `integer`):

Lowest fare for each departure date over this many days starting at the departure date — Google's date grid as data. <code>0</code> = off, <code>60</code> = two months, up to <code>365</code>. One request per 90 days. Adds <code>calendar\_day</code> items and a <code>calendar.cheapestDates</code> summary to the search item. For round trips the trip length (return minus departure) is kept fixed.

## `resolveBookingOptions` (type: `boolean`):

For the top flights of each search, fetch Google's booking options: airline and travel agencies (Trip.com, Expedia, Kiwi…), their prices, fees, and a deep link to book. Round trips need <b>Return flights</b> on — options are fetched for the outbound plus its cheapest return. One extra request per flight — cap it with the field below.

## `resolveReturnFlights` (type: `boolean`):

For the top outbound itineraries of a round trip, fetch Google's list of return flights — each with the total price for both directions — so you get complete outbound + return combinations. One extra request per outbound itinerary.

## `exploreAnywhere` (type: `boolean`):

Instead of a fixed route, list the cheapest destinations Google suggests from <b>Origin</b> — city, country, price, airline, stops, duration and suggested dates. Uses <b>Departure/Return date</b> when set, otherwise Google's flexible one-week trips over the coming months.

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

Search many routes in one run. Each item: <code>{"origin": "DPS", "destination": "BKK", "departureDate": "2026-10-15", "returnDate": "2026-10-22"}</code> (returnDate optional). Passengers, cabin and filters below apply to every route.

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

A multi-city trip as a list of legs: <code>{"origin": "SIN", "destination": "BKK", "date": "2026-10-15"}</code>, <code>{"origin": "BKK", "destination": "HKT", "date": "2026-10-19"}</code>, <code>{"origin": "HKT", "destination": "SIN", "date": "2026-10-23"}</code>. Google prices the trip leg by leg; the Actor resolves complete itineraries for the top first-leg options. The total is shown when Google can sell all legs as one ticket.

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

IATA airline codes to keep, e.g. <code>SQ</code>, <code>GA</code>, <code>QZ</code>. Leave empty for all.

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

IATA airline codes to drop, e.g. <code>TR</code> (Scoot)

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

Drop flights above this price (in the selected currency)

## `maxDurationMinutes` (type: `integer`):

Drop itineraries longer than this, e.g. <code>720</code> for 12 hours

## `maxLayoverMinutes` (type: `integer`):

Drop itineraries with any layover longer than this, e.g. <code>180</code>

## `departureTimeFrom` (type: `string`):

Earliest departure time, local, e.g. <code>06:00</code>

## `departureTimeTo` (type: `string`):

Latest departure time, local, e.g. <code>12:00</code>

## `arrivalTimeFrom` (type: `string`):

Earliest arrival time, local, e.g. <code>08:00</code>

## `arrivalTimeTo` (type: `string`):

Latest arrival time, local, e.g. <code>22:00</code>

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

Language of airport and airline names, e.g. <code>en</code>, <code>id</code>, <code>de</code>

## `calendarOnly` (type: `boolean`):

Return just the price calendar and the search summary — the cheapest way to sweep dates or routes.

## `includePriceInsights` (type: `boolean`):

Add Google's price level (low / typical / high), typical price range and 60-day price history to the search summary and to every flight

## `includeSearchSummary` (type: `boolean`):

Adds one <code>type: "search"</code> row per search with how many itineraries Google had, its own lowest price, the price level and the price history. It is not a flight, so it is off by default and the table stays flights only — the same summary is always saved as the run's <b>SEARCH\_SUMMARY</b> record in the key-value store.

## `maxDestinations` (type: `integer`):

How many destinations to return in Explore mode, cheapest first.

## `maxBookingResolutions` (type: `integer`):

Per search, counted from the top of the sorted list

## `maxReturnResolutions` (type: `integer`):

Per round-trip search, counted from the top of the sorted list

## `maxReturnOptions` (type: `integer`):

How many return flights to keep for each outbound itinerary, cheapest first.

## `maxMultiCityResolutions` (type: `integer`):

How many first-leg options to follow through all legs (one request per leg each)

## `dataSource` (type: `string`):

<b>Auto</b>: Google's results API (full list of 100–150 itineraries, needs a residential proxy) with automatic fallback to the results page (first ~15 itineraries, works from any IP). Force one source for debugging.

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

Google serves the full results API only to residential IPs — keep <b>Residential</b> proxies for complete results (a search transfers ~250 KB, a fraction of a cent). Datacenter proxies still work through the page fallback with the first ~15 itineraries.

## Actor input object example

```json
{
  "origin": "DPS",
  "destination": "SIN",
  "departureDate": "2027-03-15",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "cabinClass": "economy",
  "maxStops": "any",
  "currency": "USD",
  "maxResults": 100,
  "sortBy": "best",
  "calendarDays": 0,
  "resolveBookingOptions": false,
  "resolveReturnFlights": false,
  "exploreAnywhere": false,
  "routes": [],
  "multiCityLegs": [],
  "language": "en",
  "calendarOnly": false,
  "includePriceInsights": true,
  "includeSearchSummary": false,
  "maxDestinations": 60,
  "maxBookingResolutions": 10,
  "maxReturnResolutions": 10,
  "maxReturnOptions": 20,
  "maxMultiCityResolutions": 5,
  "dataSource": "auto",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per flight itinerary: airline, flight numbers, price in the requested currency, Google's price level against the route's usual band, stops and layovers, times, aircraft, CO₂ and booking options with seller prices. Search summaries, explore destinations and cheapest-date rows share the dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "origin": "DPS",
    "destination": "SIN",
    "departureDate": "2027-03-15",
    "routes": [],
    "multiCityLegs": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("lergassy/google-flights-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "origin": "DPS",
    "destination": "SIN",
    "departureDate": "2027-03-15",
    "routes": [],
    "multiCityLegs": [],
}

# Run the Actor and wait for it to finish
run = client.actor("lergassy/google-flights-api").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 '{
  "origin": "DPS",
  "destination": "SIN",
  "departureDate": "2027-03-15",
  "routes": [],
  "multiCityLegs": []
}' |
apify call lergassy/google-flights-api --silent --output-dataset

```

## MCP server setup

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

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/e59FQHOoV7PirgyLp/builds/GPBnyF1bSAcyXgBH7/openapi.json
