# Flight Price Comparison — 4 sources in one run (`lergassy/flight-price-comparison`) Actor

Compare flight prices from Google Flights and KAYAK in one run: same route and date on both sources, one dataset, plus a verdict row saying which source is cheaper and by how much. Batch routes, any cabin, one-way and round trip.

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

## Pricing

from $0.60 / 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

## Flight Price Comparison

**Flight Price Comparison** runs the same search on **Google Flights, KAYAK, Momondo and Ryanair at once** and puts every answer in one dataset — plus a **verdict row**: which source was cheaper for that route, by how much, and where to book it.

Google Flights and KAYAK run by default; tick Momondo for a different partner mix, and **Ryanair for the fares the metasearch engines miss** — Ryanair sells direct only, so on European routes it regularly undercuts every engine that does not list it.

**You pay only the row price of each source Actor it runs on your account** — Google Flights $0.20, KAYAK and Momondo $0.70 per 1,000 rows, Ryanair $0.30 per 1,000 calendar days (it reads the rest of the month from your date). The comparison itself adds nothing on top: no comparison fee, no run fee, no proxy fee. Verdict rows and error rows are free.

Sources matter because they do not agree. Two real searches, both run on 21 September 2026:

| Route | Google Flights | KAYAK | Momondo | Ryanair | Gap |
|---|---|---|---|---|---|
| DPS–SIN, 15 Mar | **$55** | $75 | — | — | 36% |
| STN–DUB, 15 Mar | €42 | €47 | €47 | **€35.99** | 31% |

On the European route the winner is the one no metasearch lists properly. Checking a single source and calling it "the price" is how that money gets left on the table.

### What a run returns

One row per itinerary from each source, tagged with where it came from:

| Field | Notes |
|---|---|
| `source` | `google-flights`, `kayak`, `momondo` or `ryanair` |
| `price` / `currency` | Both sources priced in the same currency, so the comparison is apples to apples |
| `airline` / `flightNumbers` | Jetstar / \["JQ86"] |
| `stops` / `layovers[]` | Airport and minutes per layover |
| `departAt` / `arriveAt` / `durationMinutes` | Local times, as each site shows them |
| `seller` / `sellersForThisFlight` | Who sells the ticket — KAYAK names the agency or airline behind the fare |
| `priceLevel` / `emissionsKg` | Google's low / typical / high verdict and CO₂, where the source provides it |
| `bookingUrl` / `sourceUrl` | Straight to the booking, and back to the original search |

And one **verdict row** per route:

```json
{
  "type": "verdict",
  "cheapestBySource": { "google-flights": 55, "kayak": 75 },
  "cheaperSource": "google-flights",
  "gap": 20,
  "gapPercent": 36.4,
  "cheapestOverall": { "source": "google-flights", "price": 55, "airline": "Jetstar", "bookingUrl": "…" }
}
```

Verdict rows are not charged.

### How to run it

1. Enter **origin** and **destination** as IATA codes (`DPS`, `JFK`, `LHR`) and a **departure date**.
2. Add a **return date** for a round trip, set passengers, cabin and currency.
3. Click **Start**. Rows from both sources land in one table, cheapest first.

#### Many routes in one run

```json
{
  "routes": [
    { "origin": "JFK", "destination": "LHR", "departureDate": "2027-03-15", "returnDate": "2027-03-22" },
    { "origin": "DPS", "destination": "SIN", "departureDate": "2027-03-15" }
  ],
  "maxResultsPerSource": 30
}
```

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("lergassy/flight-price-comparison").call(run_input={
    "origin": "JFK", "destination": "LHR", "departureDate": "2027-03-15",
    "maxResultsPerSource": 30, "currency": "USD",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row.get("type") == "verdict":
        print("cheaper source:", row["cheaperSource"], row["cheapestBySource"])
```

### What it is good for

- **Fare arbitrage**: the same seat is priced differently by source and seller — the verdict row finds the gap for you.
- **Price monitoring with a sanity check**: one source can go stale or lag; two disagreeing is a signal, not noise.
- **Travel agencies**: quote a client the real floor, not the first number you saw.
- **Research and dashboards**: source-tagged rows let you measure which metasearch is actually cheaper on your routes over time.

### Bulk export: what it costs

Since 25 September 2026 this Actor adds no charge of its own: each source runs as its own Actor on your account and bills only its own rows (Free-plan prices: Google Flights $0.0002, KAYAK and Momondo $0.0007 per row, Ryanair $0.0003 per calendar day). Nothing is charged for runs, proxy, verdict rows or error rows. Totals below are for Google Flights + KAYAK, half the rows from each:

| Job | Rows | Cost |
|---|---|---|
| One route, both sources, 30 each | 60 | $0.027 |
| 100 routes compared once | 6,000 | $2.70 |
| 20 routes compared daily for a month | 36,000 | $16.20 |
| Big export | 50,000 | **$22.50** |

Running the sources yourself means two to four integrations and datasets; here it is one call, one dataset and one row format — the source runs still appear on your account and in your bill. Compute and proxy are included in the row prices.

### Inputs

| Input | Notes |
|---|---|
| `origin` / `destination` / `departureDate` / `returnDate` | IATA codes and ISO dates |
| `sources` | Google Flights and KAYAK by default; add Momondo and Ryanair, or drop one to query a single source |
| `adults` / `children` / `cabinClass` | Up to 9 passengers, any cabin |
| `maxResultsPerSource` | Rows collected from each source per route |
| `currency` | Both sources priced in it |
| `includeVerdict` | The free comparison row, on by default |
| `routes[]` | Many routes in one run |

### Notes and limits

Fares move during the day and differ by point of sale, so a gap measured now is a gap now — schedule the run if you need a trend. A source that fails writes a free `error` row and the other sources still return, so a run is never all-or-nothing. Every source is a separate Actor run on your account: all four sources plus this Actor use five concurrent runs, the whole Free-plan allowance — if the account is at its limit, the Actor waits and retries that source. Round-trip prices are the total for both directions on both sources.

The Actor reads publicly displayed prices without logging in, bypassing access controls or collecting personal data. Both sites' terms restrict automated access, and the legality of scraping public data depends on your jurisdiction and use.

### Need another source?

**Open an issue on this Actor's page** and say which one — sources get added on request.

Single-source Actors, if that is all you need: [Google Flights Scraper](https://apify.com/lergassy/google-flights-scraper) · [Kayak Flights Scraper](https://apify.com/lergassy/kayak-flights-scraper) · [Momondo Flights Scraper](https://apify.com/lergassy/momondo-flights-scraper) · [Ryanair Flights Scraper](https://apify.com/lergassy/ryanair-flights-scraper) · [Flight Price Tracker](https://apify.com/lergassy/flight-price-tracker) · [Flight Price Calendar](https://apify.com/lergassy/flight-price-calendar)

# Actor input Schema

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

Departure airport code, e.g. <code>DPS</code> (Bali), <code>JFK</code> (New York), <code>LHR</code> (London)

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

Arrival airport code, e.g. <code>SIN</code> (Singapore), <code>BKK</code> (Bangkok)

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

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

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

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

## `sources` (type: `array`):

Which sources to query. Google Flights and KAYAK by default. Momondo has a different partner mix, and Ryanair sells direct only — its fares are thin or missing in every metasearch, so on European routes it often undercuts them all.

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

Number of adult passengers

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

Passengers aged 2–11

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

Fare class to search on both sources

## `maxResultsPerSource` (type: `integer`):

Rows collected from each source for each route

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

Three-letter code, e.g. <code>USD</code>, <code>EUR</code>, <code>GBP</code> — both sources are priced in it, so the comparison is apples to apples

## `includeVerdict` (type: `boolean`):

Adds one row per route: cheapest price on each source, the gap between them and which source won. Free — verdict rows are not charged.

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

Compare many routes in one run. Each item: <code>{"origin": "JFK", "destination": "LHR", "departureDate": "2027-03-15", "returnDate": "2027-03-22"}</code>

## Actor input object example

```json
{
  "origin": "DPS",
  "destination": "SIN",
  "departureDate": "2027-03-15",
  "sources": [
    "google-flights",
    "kayak"
  ],
  "adults": 1,
  "children": 0,
  "cabinClass": "economy",
  "maxResultsPerSource": 30,
  "currency": "USD",
  "includeVerdict": true,
  "routes": []
}
```

# Actor output Schema

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

One row per itinerary from each source, tagged with the source it came from, plus one free verdict row per route saying which source was cheaper and by how much.

# 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": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("lergassy/flight-price-comparison").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": [],
}

# Run the Actor and wait for it to finish
run = client.actor("lergassy/flight-price-comparison").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": []
}' |
apify call lergassy/flight-price-comparison --silent --output-dataset

```

## MCP server setup

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

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/FyiaS8M94q2DPYtsM/builds/PfMc58jog9J20sAW3/openapi.json
