# Google Flights Price Search (`monarchsenpai/google-flights-price-search`) Actor

Search Google Flights for a route and dates and get prices, airlines, times, stops and durations.

- **URL**: https://apify.com/monarchsenpai/google-flights-price-search.md
- **Developed by:** [Rahul S R](https://apify.com/monarchsenpai) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 flight searches

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 Search: Cheapest Flights, Flexible Dates & Multi-Airport

Find the cheapest flights on Google Flights in seconds. Search **many airports and many dates in one run**, and get clean, structured results: prices, airlines, flight numbers, stops, layovers, durations, emissions and Google's price insights.

### Why this Actor

- ⚡ **Fast.** No browser. One search takes a few seconds.
- 🛫 **Several airports at once.** `FRA,MUC,BER` → `COK,TRV` is a single search covering every combination.
- 📅 **Flexible dates.** Give a departure window and a return window, for example Aug 1–8 out and Sep 14–16 back. Every combination is searched, and you get the cheapest first.
- 💸 **Built to find the cheapest fare.** Results are sorted by price, and the hidden "more flights" are included by default.
- 🔑 **Bring your own SerpApi key (optional).** If you already have a SerpApi plan, use it and this Actor won't charge you per search.
- Round trip, one way and multi-city. Adults, children, infants, cabin class, stops, airlines or alliances, max price, max travel time, carry-on bags.
- Optional **return-flight options** and **booking options** (where to buy and the final price).

### How to use

1. Enter **From** and **To** airport codes. Separate several with commas.
2. Pick a **Departure date** and, for a round trip, a **Return date**.
3. Optional: add a **Latest departure date** and **Latest return date** to search a date range.
4. Click **Start**. Results appear in the **Output** tab. Export them as Excel, CSV or JSON, or fetch them through the API.

#### Example: Germany → Kerala, flexible dates

```json
{
  "departureAirports": "FRA,MUC,BER,DUS",
  "arrivalAirports": "COK,TRV",
  "outboundDate": "2027-08-01",
  "outboundDateTo": "2027-08-08",
  "returnDate": "2027-09-14",
  "returnDateTo": "2027-09-16",
  "currency": "EUR"
}
```

### Output

One row per flight itinerary:

```json
{
  "price": 684,
  "currency": "EUR",
  "tripType": "round_trip",
  "airlines": "Etihad, Akasa Air",
  "flightNumbers": "EY 134, QP 589",
  "stops": 1,
  "departureAirportCode": "DUS",
  "departureTime": "2027-08-09 11:15",
  "arrivalAirportCode": "COK",
  "arrivalTime": "2027-08-10 03:00",
  "totalDuration": "12 hr 15 min",
  "layovers": [{ "airportCode": "AUH", "duration": "1 hr 25 min" }],
  "segments": [ "...each flight with airline, flight number, aircraft, legroom..." ],
  "carbonEmissionsKg": 610,
  "searchOutboundDate": "2027-08-09",
  "searchReturnDate": "2027-09-14",
  "priceLevel": "typical",
  "typicalPriceRange": [650, 900],
  "googleFlightsUrl": "https://www.google.com/travel/flights?..."
}
```

For round trips, each row is an **outbound** flight, and `price` is the **round-trip total**. That's how Google Flights shows it too. Turn on *Fetch return flights* to get the matching return options.

The **`SUMMARY`** record in the run's key-value store lists the cheapest flight for each date combination, cheapest first.

### Pricing

You pay **per search**. One search = one route + one date combination, however many airports it includes.

| Run | Searches |
|---|---|
| One route, fixed dates | 1 |
| Departure window of D days × return window of R days | D × R |
| *Fetch return flights* for the top K | + K per date combination |
| *Fetch booking options* for the top K | + K per date combination |

Apify asks you for a **maximum cost per run** when you start it. The Actor stops cleanly when that limit is reached, and you keep the results found so far.

**Using your own SerpApi key?** Paste it into *Your SerpApi API key*. Searches then use your SerpApi plan, and this Actor doesn't charge you per search.

### Use cases

- Find the cheapest dates and airports for a trip
- Fare monitoring and price-drop alerts (schedule the Actor in Apify)
- Travel apps, comparison sites, travel agency workflows
- Route and price research, fare-history datasets

### API

```
POST https://api.apify.com/v2/acts/<ACTOR_ID>/run-sync-get-dataset-items
Authorization: Bearer <YOUR_APIFY_TOKEN>
Content-Type: application/json

{"departureAirports":"JFK","arrivalAirports":"LHR","outboundDate":"2027-06-01","returnDate":"2027-06-10"}
```

### Notes

- Data comes from Google Flights through SerpApi. Prices are Google's at the moment of the search, so confirm on the airline's or travel agency's site before booking.
- Google may not give a price level for dates far in the future.

# Actor input Schema

## `departureAirports` (type: `string`):

Airport code, e.g. FRA. For several airports separate with commas: FRA,MUC,BER. Google city IDs such as /m/0156q (all Berlin airports) also work.

## `arrivalAirports` (type: `string`):

Airport code, e.g. COK. Several airports: COK,TRV.

## `outboundDate` (type: `string`):

Day you fly out (YYYY-MM-DD).

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

Day you fly back. Leave empty for a one-way trip.

## `outboundDateTo` (type: `string`):

Flexible dates: also search every departure day after "Departure date" up to this day. Example: Departure date Aug 1 + Latest departure date Aug 8 searches Aug 1–8. Each date combination is one search.

## `returnDateTo` (type: `string`):

Also search every return day after "Return date" up to this day. Example: Return date Sep 14 + Latest return date Sep 16 searches Sep 14–16.

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

Number of adult passengers.

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

Children aged 2–11.

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

Infants under 2 with their own seat.

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

Infants under 2 sitting on an adult's lap.

## `travelClass` (type: `string`):

Cabin class to search.

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

Maximum number of stops.

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

Hide flights above this price, in the chosen currency.

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

Hide itineraries longer than this, layovers included.

## `includeAirlines` (type: `string`):

2-letter airline codes separated by commas, e.g. QR,EY. Alliances: STAR_ALLIANCE, SKYTEAM, ONEWORLD.

## `excludeAirlines` (type: `string`):

2-letter airline codes to leave out, e.g. AI. Ignored when "Only these airlines" is filled.

## `carryOnBags` (type: `integer`):

Prices will include fees for this many carry-on bags.

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

How Google orders the results.

## `showMoreFlights` (type: `boolean`):

Same as clicking "View more flights" on Google. Recommended for finding the cheapest fare.

## `deepSearch` (type: `boolean`):

Slower, but results match the Google Flights website exactly.

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

3-letter code, e.g. EUR, USD, INR.

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

2-letter country code Google prices from, e.g. us, de, in.

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

Language of airport and airline names, e.g. en, de.

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

How many flights to save for each date combination, cheapest first.

## `fetchReturnFlights` (type: `boolean`):

Round trips list outbound flights first. Turn on to also get the return-flight options for the cheapest outbound flights. 1 extra search per outbound flight.

## `returnFlightsForTop` (type: `integer`):

How many outbound flights get return options.

## `fetchBookingOptions` (type: `boolean`):

Where to buy each ticket and the final price. For round trips, "Fetch return flights" must be on too. 1 extra search per itinerary.

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

How many itineraries get booking options.

## `multiCityJson` (type: `string`):

Only for trips with more than two legs. When filled, From / To / dates above are ignored. Example: \[{"departure_id":"FRA","arrival_id":"COK","date":"2027-08-01"},{"departure_id":"TRV","arrival_id":"FRA","date":"2027-09-15"}]

## `apiKey` (type: `string`):

Leave empty to use this Actor's built-in key (charged per search, see Pricing). Or enter your own key from https://serpapi.com/manage-api-key — searches then use your SerpApi plan and this Actor does not charge per search.

## Actor input object example

```json
{
  "departureAirports": "FRA,MUC,BER",
  "arrivalAirports": "COK,TRV",
  "adults": 1,
  "children": 0,
  "infantsInSeat": 0,
  "infantsOnLap": 0,
  "travelClass": "economy",
  "maxStops": "any",
  "carryOnBags": 0,
  "sortBy": "price",
  "showMoreFlights": true,
  "deepSearch": false,
  "currency": "USD",
  "country": "us",
  "language": "en",
  "maxResults": 100,
  "fetchReturnFlights": false,
  "returnFlightsForTop": 3,
  "fetchBookingOptions": false,
  "bookingOptionsForTop": 3
}
```

# Actor output Schema

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

All itineraries found, one row each: price, airlines, flight numbers, stops, departure/arrival airports and times, duration, layovers, segments, emissions and price insights. Cheapest first within each date combination.

## `summary` (type: `string`):

JSON list with one entry per searched date combination: number of results, cheapest price, airlines, airports, duration and Google's price level, sorted cheapest first.

# 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 = {
    "departureAirports": "FRA,MUC,BER",
    "arrivalAirports": "COK,TRV"
};

// Run the Actor and wait for it to finish
const run = await client.actor("monarchsenpai/google-flights-price-search").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 = {
    "departureAirports": "FRA,MUC,BER",
    "arrivalAirports": "COK,TRV",
}

# Run the Actor and wait for it to finish
run = client.actor("monarchsenpai/google-flights-price-search").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 '{
  "departureAirports": "FRA,MUC,BER",
  "arrivalAirports": "COK,TRV"
}' |
apify call monarchsenpai/google-flights-price-search --silent --output-dataset

```

## MCP server setup

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

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/4KkbWyQhAgchJnWrF/builds/NpYAXCafEz4S16qWj/openapi.json
