# Kayak Flights Scraper (`piotrv1001/kayak-flights-scraper`) Actor

The Kayak Flights Scraper extracts flight itineraries from Kayak search URLs, capturing airlines, flight numbers, aircraft, layovers, durations, baggage policies, and every travel agency booking option with its own price and link — ideal for fare monitoring and OTA price benchmarking.

- **URL**: https://apify.com/piotrv1001/kayak-flights-scraper.md
- **Developed by:** [FalconScrape](https://apify.com/piotrv1001) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 flight itineraries

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/platform/actors/running/actors-in-store#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 Flights Scraper

Easily extract flight search results from [Kayak](https://www.kayak.com). The **Kayak Flights Scraper** turns any Kayak flight search into structured data — full itineraries, airlines, aircraft, layovers, and **every booking option from every travel agency**, each with its own price and baggage policy.

Unlike scrapers that return a single headline price per flight, this Actor captures **all 20+ providers** Kayak compares for each itinerary, so you can see exactly who sells that flight and for how much.

### ✨ Features

- ✈️ **Complete itineraries**: Every leg and segment with airline, flight number, aircraft type, departure and arrival times, duration, layovers, and cabin class.
- 💵 **Every booking option**: All travel agency and airline offers per itinerary — provider name, price, total price with fees, free-cancellation flag, and a direct booking link.
- 🧳 **Baggage policies**: Carry-on and checked bag allowances with size restrictions, per carrier and per fare.
- 🔍 **Any search you can run on Kayak**: One-way, round-trip, and multi-city; cabin class and passenger counts are read straight from the search URL.
- 🌍 **Any currency**: Use a country domain such as `kayak.co.uk`, `kayak.de`, or `ca.kayak.com` and prices come back in that currency.
- 📶 **In-flight amenities**: Wi-Fi, live TV, power outlets, seat pitch, and meal service where Kayak reports them.
- 📦 **Export anywhere**: Download results as JSON, CSV, Excel, or HTML, or fetch them via the Apify API.

### 🛠️ How It Works

1. **Search on Kayak** – run the flight search you want in your browser (pick your dates, cabin, and passengers).
2. **Copy the URL** – paste the address bar into the **Kayak search URLs** input. Add as many as you like.
3. **Choose a sort order and a limit** – collect the best, cheapest, or fastest itineraries first.
4. **Run the scraper** – get clean, structured flight data in a couple of minutes.

### ⚙️ Input

| Field                | Type    | Description                                                                                   |
| -------------------- | ------- | --------------------------------------------------------------------------------------------- |
| `startUrls`          | array   | Kayak flight search URLs, e.g. `https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22`. |
| `sortBy`             | string  | Which itineraries to collect first: `best`, `cheapest`, or `fastest`. Default: `best`.        |
| `maxItems`           | integer | Maximum itineraries to extract per search URL. Default: `50`.                                 |
| `proxyConfiguration` | object  | Proxy settings. Residential US proxies are recommended.                                       |

Example input:

```json
{
    "startUrls": [
        { "url": "https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22" },
        { "url": "https://www.kayak.co.uk/flights/LON-JFK/2027-06-15/2027-06-22/business" }
    ],
    "sortBy": "cheapest",
    "maxItems": 100
}
```

### 📊 Sample Output Data

The scraper provides structured JSON output with full itinerary and pricing detail. Example (trimmed):

```json
{
    "searchUrl": "https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22",
    "resultId": "8528def8420aa3f1161e4cc6806e28a3",
    "price": 447,
    "currency": "USD",
    "formattedPrice": "$447",
    "provider": "American Airlines",
    "bookingUrl": "https://www.kayak.com/book/flight?code=0ZAiWrSZ-Y...",
    "airlines": [{ "code": "AA", "name": "American Airlines" }],
    "stops": 0,
    "durationMinutes": 690,
    "legs": [
        {
            "origin": { "code": "JFK", "name": "John F Kennedy Intl", "city": "New York" },
            "destination": { "code": "LAX", "name": "Los Angeles", "city": "Los Angeles" },
            "departure": "2027-06-15T09:00:00",
            "arrival": "2027-06-15T12:15:00",
            "durationMinutes": 375,
            "stops": 0,
            "segments": [
                {
                    "airline": { "code": "AA", "name": "American Airlines" },
                    "flightNumber": "1",
                    "origin": { "code": "JFK", "name": "John F Kennedy Intl", "city": "New York" },
                    "destination": { "code": "LAX", "name": "Los Angeles", "city": "Los Angeles" },
                    "departure": "2027-06-15T09:00:00",
                    "arrival": "2027-06-15T12:15:00",
                    "durationMinutes": 375,
                    "aircraft": "Airbus A321 (sharklets)",
                    "cabin": "Economy",
                    "isOvernight": false,
                    "amenities": [
                        "Streaming capable Wi-Fi",
                        "On demand & live TV",
                        "Power & USB outlets",
                        "31\" seat pitch"
                    ]
                }
            ]
        }
    ],
    "bookingOptions": [
        {
            "provider": "American Airlines",
            "providerCode": "AA",
            "price": 447,
            "totalPrice": 447,
            "currency": "USD",
            "formattedPrice": "$447",
            "bookingUrl": "https://www.kayak.com/book/flight?code=...",
            "freeCancellation": true,
            "carryOnBags": "Included",
            "checkedBags": "$40",
            "baggagePolicy": {
                "AA": [{ "bagType": "CARRYON", "bagRestriction": { "DIMENSIONS": "Up to 22 x 14 x 9in" } }]
            }
        }
    ],
    "totalBookingOptions": 23,
    "hasHackerFares": false,
    "detailUrl": "https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22/8528def..."
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### 📋 Output Fields

| Field                                   | Description                                                                                                       |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `searchUrl`                             | The search this itinerary came from                                                                               |
| `resultId`                              | Kayak's identifier for the itinerary                                                                              |
| `price` / `formattedPrice` / `currency` | Cheapest available price across all booking options                                                               |
| `provider` / `bookingUrl`               | Cheapest provider and a direct link to book with them                                                             |
| `airlines`                              | Every operating airline on the itinerary, with IATA code and name                                                 |
| `stops`                                 | Highest number of stops on any leg (`0` = non-stop)                                                               |
| `durationMinutes`                       | Total travel time across all legs                                                                                 |
| `legs`                                  | One entry per leg (outbound, return, or each multi-city hop)                                                      |
| `legs[].origin` / `legs[].destination`  | Airport code, full airport name, and city                                                                         |
| `legs[].departure` / `legs[].arrival`   | Local departure and arrival timestamps                                                                            |
| `legs[].segments`                       | Individual flights: airline, flight number, aircraft, cabin, duration, overnight flag, amenities                  |
| `bookingOptions`                        | Every offer for this itinerary — provider, price, total price, free cancellation, baggage allowance, booking link |
| `bookingOptions[].baggagePolicy`        | Carry-on, personal item, and checked bag rules with size limits, per carrier                                      |
| `totalBookingOptions`                   | How many offers Kayak found for this itinerary                                                                    |
| `hasHackerFares`                        | Whether the itinerary combines two one-way tickets                                                                |
| `detailUrl`                             | Shareable Kayak link to the itinerary                                                                             |

### 💰 How much does it cost to scrape Kayak flights?

The Actor uses transparent pay-per-event pricing — you only pay for what you scrape:

| Event            | Price                |
| ---------------- | -------------------- |
| Actor start      | $0.005 per run       |
| Flight search    | $0.02 per search URL |
| Flight itinerary | $0.001 per itinerary |

A typical run — one route, 50 itineraries — costs about **$0.075**. Scraping 20 routes with 100 itineraries each costs roughly **$2.40**. Use `maxItems` to keep run costs predictable.

### 💡 Use Cases

- **Fare monitoring** – track how prices on your routes move day to day and catch drops early.
- **Travel agency & OTA benchmarking** – see which providers undercut each other on the same itinerary.
- **Corporate travel** – pull compliant business-cabin options with baggage allowances for policy checks.
- **Route & market research** – analyze carrier mix, aircraft types, and non-stop availability on a route.
- **Price prediction models** – build training datasets of fares against departure dates and lead times.

### 💡 Tips

- **Sort before you limit.** With `maxItems` set low, `sortBy: "cheapest"` gives you the fares that matter instead of Kayak's default mix.
- **Use residential proxies.** Kayak limits how many flight searches a single IP address can run; the default residential US setting keeps runs reliable.
- **One URL per route-date.** Batch many searches in a single run — they are processed in parallel.
- **Search far enough ahead.** Airlines typically publish schedules about 11 months out; dates beyond that return nothing.

### ❓ FAQ

**Do I need to build the search URL by hand?**
No. Run the search on Kayak in your browser and copy the URL from the address bar. Cabin class, passenger counts, and multi-city legs are all read from the URL for you.

**Can I get prices in euros or pounds?**
Yes. Use the matching Kayak domain — `kayak.co.uk` for GBP, `kayak.de` for EUR, `ca.kayak.com` for CAD — and prices come back in that currency.

**How many itineraries can I get per search?**
A popular route can have well over a thousand. Set `maxItems` to how many you want per search URL.

**Are the prices live?**
Yes. Every run triggers a fresh search on Kayak, so the fares reflect what is bookable at that moment.

**Is it legal to scrape Kayak?**
This scraper only collects publicly available flight and pricing data and does not extract any personal information. You should always review Kayak's Terms of Service and consult legal counsel for your specific use case.

**Something not working?**
Please open an issue in the **Issues** tab of the Actor — we actively monitor and fix reported problems. Custom solutions are available on request.

Start tracking live airfares with the **Kayak Flights Scraper** today! 🚀

# Actor input Schema

## `startUrls` (type: `array`):

Kayak flight search URLs to scrape. Run the search on Kayak, then copy the address from your browser. One-way, round-trip and multi-city searches all work, and the cabin class and passenger counts encoded in the URL are respected. Use a country domain (e.g. kayak.co.uk, kayak.de) to get prices in that currency.

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

Which itineraries to collect first. Combined with the limit below this decides what you get — sort by price to capture the cheapest fares.

## `maxItems` (type: `integer`):

Maximum number of flight itineraries to extract for each search URL. A popular route can have well over a thousand.

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

Proxy settings. Residential US proxies are strongly recommended — Kayak limits how many flight searches a single IP address can run.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22"
    }
  ],
  "sortBy": "best",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "startUrls": [
        {
            "url": "https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/kayak-flights-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 = { "startUrls": [{ "url": "https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22" }] }

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/kayak-flights-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.kayak.com/flights/NYC-LAX/2027-06-15/2027-06-22"
    }
  ]
}' |
apify call piotrv1001/kayak-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=piotrv1001/kayak-flights-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/MztDSSYPuezDCR1Gg/builds/livdVLVspz9UMYxAS/openapi.json
