# Google Flights API by APISH (`apish/google-flights-api`) Actor

Search Google Flights and get fares, segments, return options, cheapest days and cheapest destinations as JSON, via APISH. Pay per credit; failed calls are free.

- **URL**: https://apify.com/apish/google-flights-api.md
- **Developed by:** [APISH](https://apify.com/apish) (community)
- **Categories:** Travel
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 credits

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 by APISH

Get public Google Flights data as clean, consistent JSON: google Flights autocomplete, google Flights price calendar, google Flights deals (Explore), google Flights price graph, return flights for a chosen outbound, google Flights search. 6 endpoints, one response shape, numbers parsed, absolute URLs.

### How to use

1. Pick an **Endpoint**. Each option shows what it returns and its price in credits.
2. Enter its **Parameters** as JSON, for example `{"q":"lond"}`. All parameters are listed below.
3. Run. Each call becomes one row in the dataset. Use **Batch** to run the same endpoint for many inputs and **Pages per input** to follow pagination.

### Pricing

Pay per event: you pay per APISH credit the call used. The price of each endpoint is in the table below. Calls that fail on our side (server errors, timeouts, blocks) are free.

### Endpoints

| Endpoint | Returns | Required parameters | Credits |
|---|---|---|---|
| `/google-flights/v1/autocomplete` | Google Flights autocomplete | `q` | 1 |
| `/google-flights/v1/calendar` | Google Flights price calendar | `origin`, `destination` | 1 |
| `/google-flights/v1/deals` | Google Flights deals (Explore) | `from` | 1 |
| `/google-flights/v1/price-graph` | Google Flights price graph | `origin`, `destination` | 1 |
| `/google-flights/v1/return` | Return flights for a chosen outbound | `origin`, `destination`, `depart`, `return`, `outbound` | 1 |
| `/google-flights/v1/search` | Google Flights search | `origin`, `destination`, `depart` | 2 |

### Output

Each dataset row has `endpoint`, `params`, `status`, `credits_used` and the endpoint's data. Add `"raw": 1` to the parameters to also get the site's original record, or `"fields": "a,b.c"` to return only the fields you need.

### Endpoint details

#### Google Flights autocomplete

Endpoint `/google-flights/v1/autocomplete` · 1 credit per successful call.

Google Flights place suggestions for what a user typed: cities, airports, regions and stations with their IATA codes and kgmids, and each city's airports with their distance.

Parameters:

- `q` (required): What the user typed, e.g. lond.
- `hl`: Language, e.g. en.
- `gl`: Country, e.g. us.

Example parameters: `{"q":"lond"}`

#### Google Flights price calendar

Endpoint `/google-flights/v1/calendar` · 1 credit per successful call.

The lowest fare Google Flights shows for each departure day in a range: one-way, or round trips of a fixed length (`trip_length`). Give a `month` (YYYY-MM) or `start_date`/`end_date` (default: the next 30 days; up to 300 days). Returns every day with its price (and return date for round trips), the cheapest and most expensive day and the median price. Prices are for all passengers together.

Parameters:

- `origin` (required): Departure airport or city: 3-letter IATA code; several comma separated (e.g. `JFK,EWR`).
- `destination` (required): Arrival airport or city: 3-letter IATA code; several comma separated.
- `month`: A month to show, YYYY-MM (instead of start_date/end_date).
- `start_date`: First departure day, YYYY-MM-DD (default tomorrow).
- `end_date`: Last departure day, YYYY-MM-DD (default 30 days after start_date).
- `trip_length`: Round trip: days between departure and return (1-60). Omit for one-way fares.
- `adults`: Adults (1-9, default 1).
- `children`: Children (0-8).
- `infants_in_seat`: Infants with their own seat (0-8).
- `infants_on_lap`: Infants on a lap (0-8).
- `cabin` — one of `economy`, `premium_economy`, `business`, `first`: Cabin class (default economy).
- `stops` — one of `any`, `nonstop`, `1`, `2`: At most this many stops: any (default), nonstop, 1, 2.
- `airlines`: Only these airlines: 2-letter IATA airline codes, comma separated (e.g. `UA,DL`).
- `currency`: Price currency, a 3-letter code (default USD).
- `country`: Two-letter country whose point of sale prices are shown (default US).

Example parameters: `{"origin":"JFK","destination":"LAX"}`

#### Google Flights deals (Explore)

Endpoint `/google-flights/v1/deals` · 1 credit per successful call.

Google Flights Explore from an origin: destinations with the cheapest round trip found for a one-week trip in the next six months: dates, price, airline, stops, flight time, destination airport, coordinates and image, cheapest first. `from` is an airport code (AUS), a city kgmid (/m/0vzm) or a place name.

Parameters:

- `from` (required): Origin: airport code, city kgmid or place name.
- `currency`: Currency code, default USD.
- `hl`: Language, e.g. en.
- `gl`: Country, e.g. us.

Example parameters: `{"from":"AUS"}`

#### Google Flights price graph

Endpoint `/google-flights/v1/price-graph` · 1 credit per successful call.

Google Flights' price graph: the lowest fare per departure day over the next six months by default (or `start_date`..`end_date`, up to 300 days), one-way or for round trips of `trip_length` days. Each day comes with its price and return date; the cheapest and most expensive day and the median price are included.

Parameters:

- `origin` (required): Departure airport or city: 3-letter IATA code; several comma separated.
- `destination` (required): Arrival airport or city: 3-letter IATA code; several comma separated.
- `trip_length`: Round trip: days between departure and return (1-60). Omit for one-way fares.
- `start_date`: First departure day, YYYY-MM-DD (default tomorrow).
- `end_date`: Last departure day, YYYY-MM-DD (default 180 days after start_date).
- `adults`: Adults (1-9, default 1).
- `children`: Children (0-8).
- `infants_in_seat`: Infants with their own seat (0-8).
- `infants_on_lap`: Infants on a lap (0-8).
- `cabin` — one of `economy`, `premium_economy`, `business`, `first`: Cabin class (default economy).
- `stops` — one of `any`, `nonstop`, `1`, `2`: At most this many stops: any (default), nonstop, 1, 2.
- `airlines`: Only these airlines: 2-letter IATA airline codes, comma separated (e.g. `UA,DL`).
- `currency`: Price currency, a 3-letter code (default USD).
- `country`: Two-letter country whose point of sale prices are shown (default US).

Example parameters: `{"origin":"JFK","destination":"LHR"}`

#### Return flights for a chosen outbound

Endpoint `/google-flights/v1/return` · 1 credit per successful call.

The return flights Google Flights offers after an outbound flight is chosen (pass a flight's `select` from /google-flights/v1/search or this route). Prices are for the whole round trip. Each flight has price, stops, airline, departure and arrival airport, date and time, duration, layovers, emissions against the route's typical emissions and every segment (airports, times, carrier and flight number, aircraft, legroom, codeshares), plus `select`, the value that picks it.

Parameters:

- `origin` (required): Outbound departure airport or city code.
- `destination` (required): Outbound arrival code.
- `depart` (required): Outbound date (YYYY-MM-DD).
- `return` (required): Return date.
- `outbound` (required): The chosen outbound flight's select value (segments separated by |).
- `adults`: Adults (1-9).
- `currency`: Currency (default USD).

Example parameters: `{"origin":"JFK","destination":"LHR","depart":"2026-12-10","return":"2026-12-17","outbound":"JFK:LHR:2026-12-10:AA:142"}`

#### Google Flights search

Endpoint `/google-flights/v1/search` · 2 credits per successful call.

The flights embedded in the search page. Google loads more only on a click, so `next_cursor` is null. Passengers (adults, children, infants_in_seat, infants_on_lap), cabin, stops, airlines and alliance search for exactly that trip (origin and destination must then be airport or city codes); prices are the total for all passengers. max_price, max_duration, departure_window, arrival_window and sort filter and order the returned results. Also returns price_insight.level (low, typical or high, when shown) and applied_filters. Each flight carries `select` and its segments when the page gives them; pass `select` to /google-flights/v1/return for the return flights of a round trip. When Google Flights has no flights for the search (no service on those dates, or an airport code that is not the one meant), the answer is `flights: []` with `no_results: true`, `route_airports` (the airports Google read, with city and country), and the `suggested_dates` and `nearby_airports` Google offers instead.

Parameters:

- `origin` (required)
- `destination` (required)
- `depart` (required): Departure date, `YYYY-MM-DD`.
- `return`: Return date (YYYY-MM-DD) for a round trip.
- `currency`: Price currency, e.g. USD.
- `adults`: Adult passengers, 1-9 (default 1).
- `children`: Child passengers, 0-8.
- `infants_in_seat`: Infants with their own seat, 0-8.
- `infants_on_lap`: Infants on an adult's lap, 0-8 (at most one per adult).
- `cabin` — one of `economy`, `premium_economy`, `business`, `first`: Cabin class.
- `stops` — one of `any`, `nonstop`, `1`, `2`: any; nonstop; 1 = at most one stop; 2 = at most two stops.
- `airlines`: Only these airlines: 2-character airline codes, comma separated (e.g. DL,AA), up to 10.
- `alliance` — one of `star_alliance`, `skyteam`, `oneworld`: Only airlines of this alliance.
- `max_price`: Only results at or below this price (whole amount in the chosen currency).
- `max_duration`: Only results with a total duration up to this many hours (e.g. 8 or 7.5).
- `departure_window`: Only results departing between these hours, local time, as start-end (e.g. 6-12).
- `arrival_window`: Only results arriving between these hours, local time, as start-end (e.g. 14-22).
- `sort` — one of `best`, `price`, `duration`, `departure`, `arrival`, `emissions`: Order of results (best = the site's own order, the default).

Example parameters: `{"origin":"JFK","destination":"LHR","depart":"2026-12-15","currency":"USD"}`

### Support

Questions, bugs or a missing field? Open an issue in this Actor's Issues tab and we will reply there.

Public data only: nothing behind a login. You are responsible for how you use the data you collect.

# Actor input Schema

## `endpoint` (type: `string`):

Which Google Flights endpoint to call. Each option shows what it returns and its price in credits.

## `params` (type: `object`):

Query parameters for the endpoint, as JSON. See the README for every endpoint's parameters. Example: {"q":"lond"}

## `batch` (type: `array`):

Run the same endpoint for many inputs: a list of parameter objects. Each item is one call. Leave empty to use Parameters.

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

For paginated endpoints: follow next_cursor up to this many pages per input. 1 = first page only.

## Actor input object example

```json
{
  "endpoint": "/google-flights/v1/autocomplete",
  "params": {
    "q": "lond"
  },
  "batch": [],
  "maxPages": 1
}
```

# Actor output Schema

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

One row per call: endpoint, params, status, credits_used and the data.

# 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 = {
    "endpoint": "/google-flights/v1/autocomplete",
    "params": {
        "q": "lond"
    },
    "batch": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("apish/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 = {
    "endpoint": "/google-flights/v1/autocomplete",
    "params": { "q": "lond" },
    "batch": [],
}

# Run the Actor and wait for it to finish
run = client.actor("apish/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 '{
  "endpoint": "/google-flights/v1/autocomplete",
  "params": {
    "q": "lond"
  },
  "batch": []
}' |
apify call apish/google-flights-api --silent --output-dataset

```

## MCP server setup

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