# KAYAK Flight Scraper (`fetchfinch/kayak-flight-scraper`) Actor

\[💰 $0.90 / 1K] Extract live KAYAK flight prices, schedules, airlines, stops, providers, and booking links as normalized Dataset records.

- **URL**: https://apify.com/fetchfinch/kayak-flight-scraper.md
- **Developed by:** [Fetch Finch](https://apify.com/fetchfinch) (community)
- **Categories:** Travel
- **Stats:** 2 total users, 1 monthly users, 33.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## KAYAK Flight Scraper

Extract live flight search results from KAYAK into clean, structured Apify Dataset records.

The scraper supports both simple structured searches and complete KAYAK flight URLs. Each result includes itinerary details, prices, airlines, stops, providers, booking links, and flight segments where available.

### Example tasks

Try the ready-to-run examples:

- [One-way Prague to Paris flights](https://apify.com/fetchfinch/kayak-prague-paris-oneway)
- [Family flights with child and lap infant](https://apify.com/fetchfinch/kayak-family-prague-paris)
- [Paginated business-class KAYAK search](https://apify.com/fetchfinch/kayak-paginated-business-search)

### Features

- One-way and round-trip searches
- Airport and metro-area codes such as `PRG` and `PAR`
- Economy, premium economy, business, and first class
- Sort by best, price, duration, departure, or arrival
- Nonstop, stop-count, and airline filters
- Adult, child, and lap-infant passenger searches
- Bounded pagination when more results are requested
- Normalized itinerary records ready for analysis, alerts, or downstream automation
- Optional raw KAYAK result objects for advanced use cases

### Input

You can provide either a complete KAYAK flight URL or structured search fields. When both are supplied, the URL takes precedence.

#### Structured search

```json
{
  "origin": "PRG",
  "destination": "PAR",
  "departureDate": "2026-10-24",
  "returnDate": "2026-10-31",
  "adults": 1,
  "children": 1,
  "childAges": [5],
  "infants": 1,
  "cabinClass": "economy",
  "sort": "bestflight_a",
  "results_wanted": 30,
  "max_pages": 1
}
```

#### Complete KAYAK URL

This is useful when you already have a KAYAK search containing filters or settings that are not represented by the structured fields.

```json
{
  "url": "https://www.kayak.ie/flights/PRG-PAR/2026-10-24/2026-10-31/business?sort=duration_a",
  "results_wanted": 60,
  "max_pages": 2
}
```

#### Main input fields

| Field | Description |
| --- | --- |
| `origin` | Origin airport or metro code. |
| `destination` | Destination airport or metro code. |
| `departureDate` | Departure date in `YYYY-MM-DD` format. |
| `returnDate` | Optional return date. Omit for one-way searches. |
| `adults` | Number of adult passengers, from 1 to 9. |
| `children` | Number of children aged 2–11. |
| `childAges` | One age from 2 to 11 for each child. |
| `infants` | Number of under-2 lap infants. |
| `cabinClass` | `economy`, `premium_economy`, `business`, or `first`. |
| `sort` | `bestflight_a`, `price_a`, `duration_a`, `departure_a`, or `arrival_a`. |
| `stops` | `0` for nonstop, `1` for up to one stop, or `2` for two or more stops. |
| `airlines` | Optional comma-separated airline IATA codes, such as `FR,AF`. |
| `directOnly` | Boolean shortcut for a nonstop search. |
| `results_wanted` | Maximum number of normalized results, up to 500. `maxResults` is an alias. |
| `max_pages` | Maximum KAYAK result pages to request, up to 20. |
| `includeRaw` | Include the original result object in every Dataset item. |
| `saveRawResponse` | Save the final response as `SEARCH_RESPONSE` in the default Key-Value Store. |

### Output

The default Dataset contains one item per normalized itinerary. The most useful fields include:

```json
{
  "schema_version": "1",
  "source": "kayak.ie",
  "rank": 1,
  "route": "PRG-PAR",
  "origin": "PRG",
  "destination": "PAR",
  "depart_date": "2026-10-24",
  "return_date": "2026-10-31",
  "trip_type": "roundtrip",
  "provider": "Example provider",
  "price_amount": 123.45,
  "currency": "EUR",
  "total_duration_minutes": 185,
  "total_stops": 0,
  "airlines": "Example Airline",
  "booking_url": "https://www.kayak.ie/...",
  "outbound_departure": "2026-10-24T08:00:00+02:00",
  "outbound_arrival": "2026-10-24T11:05:00+02:00",
  "outbound_duration_minutes": 185,
  "outbound_stops": 0,
  "outbound_airlines": "Example Airline",
  "inbound_departure": "2026-10-31T18:00:00+02:00",
  "inbound_arrival": "2026-10-31T21:05:00+02:00",
  "inbound_duration_minutes": 185,
  "inbound_stops": 0,
  "inbound_airlines": "Example Airline",
  "booking_options": [],
  "legs": []
}
```

The exact providers, prices, schedules, and available booking options depend on the search and can change after the run. The Dataset also contains search metadata, progressive polling summaries, and bandwidth information.

### Proxy and reliability

The Actor uses KAYAK’s HTTP result flow and does not require a browser for normal operation. KAYAK can apply traffic controls that vary by location and request volume. If a run receives a temporary access error, configure a suitable residential proxy in the Actor environment rather than placing proxy credentials in task input.

Search results are live and should be treated as time-sensitive. Prices and availability can change when a booking provider is opened.

### Passenger notes

Child ages are required because they affect fare eligibility. `infants` represents infants travelling on an adult’s lap. Seat-infant searches are not currently supported because KAYAK’s result endpoint returns an upstream error for that passenger type.

### Limits

The Actor caps output at 500 normalized itineraries and pagination at 20 result pages. These limits keep runs bounded and help avoid unnecessary traffic for broad searches.

### Responsible use

Use the scraper only where you have the right to collect and process the data. Respect KAYAK’s terms, applicable laws, and reasonable request rates.

# Actor input Schema

## `startUrl` (type: `string`):

Optional complete KAYAK /flights/... URL. When supplied, route, dates, sorting, and supported URL settings are read from it.

## `url` (type: `string`):

Alias for startUrl; accepts a complete KAYAK /flights/... URL.

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

Three-letter airport or metro code, for example PRG.

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

Three-letter airport or metro code, for example PAR.

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

Departure date in YYYY-MM-DD format. If omitted, the Actor uses a date 30 days from today.

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

Optional return date in YYYY-MM-DD format.

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

Number of adult passengers.

## `sort` (type: `string`):

KAYAK result ordering.

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

Optional cabin class applied to every leg.

## `stops` (type: `integer`):

Optional KAYAK stop filter: 0 nonstop, 1 up to one stop, 2 two or more stops.

## `airlines` (type: `string`):

Optional comma-separated airline IATA codes, for example FR,AF.

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

Number of children aged 2–11. Supply one matching age in childAges for each child.

## `childAges` (type: `array`):

One age from 2 to 11 for each child; KAYAK uses these ages for fare eligibility.

## `infants` (type: `integer`):

Number of infants under 2 travelling on an adult’s lap. Encoded to KAYAK as INL.

## `directOnly` (type: `boolean`):

Limit results to nonstop flights.

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

Alias for results\_wanted: maximum normalized itinerary records to write.

## `results_wanted` (type: `integer`):

Maximum normalized itineraries to return. Fetches additional KAYAK result pages when needed.

## `max_pages` (type: `integer`):

Maximum KAYAK result pages to request, including the initial page, up to 20.

## `includeRaw` (type: `boolean`):

Include the original KAYAK result object alongside normalized fields.

## `pollIntervalMs` (type: `integer`):

Delay between progressive result polls.

## `maxPolls` (type: `integer`):

Maximum progressive polls before the run fails as incomplete.

## `saveRawResponse` (type: `boolean`):

Save the final raw KAYAK response as SEARCH\_RESPONSE in the default key-value store.

## Actor input object example

```json
{
  "origin": "PRG",
  "destination": "PAR",
  "adults": 1,
  "children": 0,
  "infants": 0,
  "max_pages": 1,
  "includeRaw": false,
  "pollIntervalMs": 2500,
  "maxPolls": 12,
  "saveRawResponse": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Raw candidate flight results from the completed KAYAK search.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("fetchfinch/kayak-flight-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("fetchfinch/kayak-flight-scraper").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 '{}' |
apify call fetchfinch/kayak-flight-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/vLlGkmq8JtdwoZgZp/builds/COKzzod9kCXyov5Z7/openapi.json
