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

Scrape KAYAK flight prices for many routes and dates in one run: every airline's and travel site's price per itinerary, fares, bags, flight numbers, times, stops, layovers and booking links. 27 KAYAK country sites, all cabins.

- **URL**: https://apify.com/automation-lab/kayak-flights-scraper.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Travel
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 flight 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

## Kayak Flights Scraper

Scrape flight prices from **KAYAK** as clean JSON, CSV or Excel. For every route and date you get the itineraries KAYAK finds, with **the price from every airline and travel site that sells each one** (KAYAK's meta-search comparison), fare names, bag rules, booking links, airlines, flight numbers, times, duration, stops, layovers and aircraft.

Run one search or a **batch of routes and dates** in one run, on **27 KAYAK country sites** (kayak.com, kayak.co.uk, kayak.de, ca.kayak.com, kayak.com.au and more), in economy, premium, business or first. No KAYAK account and no API key needed.

### What does Kayak Flights Scraper do?

Give it a route (`JFK` → `LAX`) and a date, a list of routes and dates, or paste KAYAK results links. For each search it runs the same search the KAYAK website runs, waits until KAYAK has collected prices from all its partners, and saves the results:

- **one row per itinerary** (default): the cheapest price and the site selling it, plus a `bookingOptions` list with every airline and travel site that sells the same flights, each with its own price, fare name, bag rules and booking link;
- or **one row per booking site** when you switch on *One row per booking provider*, for spreadsheet comparisons;
- outbound and return flights with airline, flight number, airports, local times, duration, layovers, aircraft and cabin;
- KAYAK's own *Best* and *Cheapest* flags and the rank of each itinerary in the results.

### Who is Kayak Flights Scraper for?

- **Travel agencies and OTAs**: see which agencies undercut you on the routes you sell, every day.
- **Fare monitoring and price-alert products**: track the cheapest fare per route and date over time.
- **Airline revenue management and pricing teams**: watch competitor fares, stop patterns and the gap between airline-direct and agency prices.
- **Corporate travel managers**: benchmark negotiated fares against public prices.
- **Travel bloggers and deal sites**: find the cheapest days and booking sites for popular routes.
- **Researchers and analysts**: study fare dispersion between booking sites, markets and cabins.

### Why use this KAYAK scraper?

- **Every booking site's price in one row.** KAYAK compares airlines and dozens of travel sites; each itinerary row keeps all of their prices, not just the cheapest.
- **Batch runs.** Many routes and dates in one run, each searched in parallel after one browser session per KAYAK site.
- **27 KAYAK country sites.** The site decides the currency and which local agencies appear.
- **Paste KAYAK links.** Route, dates, cabin, passengers and sort are read from the link.
- **Filters that fill the limit.** With *Max stops* or *Airlines* set, the Actor reads more KAYAK pages until it has as many matching itineraries as you asked for.
- **Honest status and charges.** The run says how many rows it saved and why it stopped. Empty searches and invalid input cost nothing.

### What data can you extract from KAYAK?

| Field | Example | Notes |
|---|---|---|
| `price` | `167` | Per person, as KAYAK shows it. Round trip: both directions |
| `totalPrice` | `501` | All travellers |
| `currency`, `priceText` | `EUR`, `167 €` | Set by the KAYAK site |
| `providerName`, `providerType` | `Expedia`, `travel site` | Who sells the fare: airline or travel site |
| `fareName` | `Economy Basic` | Fare brand when KAYAK shows one |
| `carryOnBag`, `checkedBag` | `included`, `fee` | `included`, `fee`, `not included` or `unknown` |
| `bookingOptions[]` | provider, price, fare, bags, link | Every booking site for the itinerary (default mode) |
| `providerCount` | `17` | Booking sites selling the itinerary |
| `airlines`, `airlineCodes` | `["Lufthansa"]`, `["LH"]` | |
| `flightNumbers` | `["LH1128"]` | Outbound then return |
| `departAt`, `arriveAt` | `2026-12-18T11:00:00` | Local times |
| `durationMinutes`, `stops`, `layoverAirports` | `120`, `0`, `[]` | Outbound |
| `returnDepartAt`, `returnArriveAt`, `returnDurationMinutes`, `returnStops` | | Round trips |
| `aircraft`, `cabin` | `["Airbus A321neo"]`, `Business` | |
| `legs[]` | segments, layover minutes | Full detail of each direction |
| `isBest`, `isCheapest`, `rank` | `true`, `false`, `1` | KAYAK's flags and position in KAYAK's full results list. With *Max stops* or *Airlines* set, `rank` keeps KAYAK's position, so the first row can have rank 7 |
| `bookingUrl`, `itineraryUrl`, `searchUrl` | KAYAK links | Booking redirect, itinerary page, results page. `bookingUrl` is empty on KAYAK *split bookings* (separate one-way tickets with no single booking link); open `itineraryUrl` for those |

### How much does it cost to scrape KAYAK flight prices?

Pay per result, no monthly rental. You pay a fee per run, which covers opening the KAYAK session, and a fee per saved flight row:

| Event | Free | Bronze | Silver | Gold, Platinum, Diamond |
|---|---|---|---|---|
| Run started (once per run) | $0.05 | $0.05 | $0.05 | $0.05 |
| Flight row saved | $0.0005 | $0.0005 | $0.00045 | $0.0004 |

That is $0.50 per 1,000 rows on the Free plan and $0.40 per 1,000 on Gold. Each row in the default mode already holds every booking site's price for the itinerary.

Examples on the Free plan, with the default one row per itinerary:

- 1 route and date, 15 itineraries: about **$0.058**
- 1 route and date, 50 itineraries: about **$0.075**
- 10 routes × 50 itineraries in one run: about **$0.30**
- 30 dates on one route × 20 itineraries (daily fare tracking): about **$0.35**

The run fee is the same for 1 search or 200, so batching routes and dates into one run is the cheapest way to track fares.

With *One row per booking provider* switched on, an itinerary gives one row per booking site (usually 3 to 30), so the same search costs several times more. A search with no results is not charged, and a run that fails on bad input costs nothing. Set **Max charge per run** in Apify to cap spending.

### How to scrape KAYAK flights

1. Open the Actor and enter **From** and **To** as airport codes (`JFK`, `LHR`) or KAYAK city codes (`NYC`, `LON`).
2. Pick a **Departure date** and, for a round trip, a **Return date**.
3. Optionally add more searches in **Routes (batch)** or paste **KAYAK search links**.
4. Choose the **KAYAK country site**, cabin and travellers.
5. Click **Start**. A first search takes about 30 to 60 seconds, including opening the KAYAK session; more searches run in parallel.
6. Open the **Flights** table, or export JSON, CSV or Excel.

### Input parameters

| Parameter | What it does |
|---|---|
| `origin`, `destination` | 3-letter airport or city code. |
| `departureDate`, `returnDate` | `YYYY-MM-DD`. Empty return = one-way. |
| `routes` | More searches: `{origin, destination, departureDate, returnDate}` each. Up to 200 searches per run. |
| `searchUrls` | KAYAK results links; site, route, dates, cabin, adults, children and sort come from the link. |
| `kayakSite` | KAYAK country site, e.g. `kayak.com`, `kayak.co.uk`, `kayak.de`, `ca.kayak.com`. |
| `cabinClass` | `economy`, `premium`, `business`, `first`. |
| `adults`, `children` | 1 to 9 adults, 0 to 8 children (age 2 to 11), 9 travellers at most. |
| `sortBy` | `best` (KAYAK default), `price` or `duration`. Decides which itineraries come first. |
| `maxItinerariesPerSearch` | Itineraries per search, default 50, up to 500. |
| `rowPerProvider` | Off (default): one row per itinerary with all booking options inside. On: one row per booking option. |
| `maxStops` | `any`, `0` (nonstop), `1`, `2`. Applies to each direction. |
| `airlines` | 2-letter airline codes; keeps itineraries with at least one flight by these airlines. |

Example, a family round trip in business on KAYAK UK:

```json
{
    "kayakSite": "kayak.co.uk",
    "origin": "LON",
    "destination": "NYC",
    "departureDate": "2027-01-17",
    "returnDate": "2027-01-24",
    "cabinClass": "business",
    "adults": 2,
    "children": 1,
    "sortBy": "price",
    "maxItinerariesPerSearch": 30
}
```

Daily fare tracking for several dates and routes:

```json
{
    "routes": [
        { "origin": "ORD", "destination": "MIA", "departureDate": "2026-12-18" },
        { "origin": "ORD", "destination": "MIA", "departureDate": "2026-12-19" },
        { "origin": "SFO", "destination": "SEA", "departureDate": "2026-12-18", "returnDate": "2026-12-22" }
    ],
    "maxItinerariesPerSearch": 20,
    "maxStops": "0"
}
```

### Output example

One itinerary row from kayak.co.uk (shortened: one leg and two booking options shown, links cut):

```json
{
    "origin": "LON",
    "destination": "NYC",
    "departureDate": "2027-01-17",
    "returnDate": "2027-01-24",
    "tripType": "round-trip",
    "rank": 27,
    "price": 2703,
    "totalPrice": 8107,
    "currency": "GBP",
    "priceText": "£2,703",
    "providerCode": "TRAVCART",
    "providerName": "Travcart",
    "providerType": "travel site",
    "fareName": "Mint",
    "isCheapestOption": true,
    "providerCount": 7,
    "airlines": [
        "JetBlue"
    ],
    "airlineCodes": [
        "B6"
    ],
    "flightNumbers": [
        "B620",
        "B67"
    ],
    "departAt": "2027-01-17T12:20:00",
    "arriveAt": "2027-01-17T15:52:00",
    "durationMinutes": 512,
    "stops": 0,
    "layoverAirports": [],
    "returnDepartAt": "2027-01-24T21:10:00",
    "returnArriveAt": "2027-01-25T09:30:00",
    "returnDurationMinutes": 440,
    "returnStops": 0,
    "aircraft": [
        "Airbus A321neo"
    ],
    "cabin": "Business",
    "carryOnBag": "included",
    "checkedBag": "included",
    "isBest": false,
    "isCheapest": false,
    "legs": [
        {
            "origin": "LHR",
            "destination": "JFK",
            "departAt": "2027-01-17T12:20:00",
            "arriveAt": "2027-01-17T15:52:00",
            "durationMinutes": 512,
            "stops": 0,
            "layoverAirports": [],
            "layoverMinutes": [],
            "segments": [
                {
                    "airlineCode": "B6",
                    "airline": "JetBlue",
                    "flightNumber": "B620",
                    "origin": "LHR",
                    "destination": "JFK",
                    "departAt": "2027-01-17T12:20:00",
                    "arriveAt": "2027-01-17T15:52:00",
                    "durationMinutes": 512,
                    "aircraft": "Airbus A321neo",
                    "cabin": "Business"
                }
            ]
        }
    ],
    "bookingUrl": "https://www.kayak.co.uk/book/flight?code=vGGCCn7gC4.HcI-hMJ5...",
    "bookingOptions": [
        {
            "providerCode": "TRAVCART",
            "providerName": "Travcart",
            "providerType": "travel site",
            "price": 2703,
            "totalPrice": 8107,
            "currency": "GBP",
            "priceText": "£2,703",
            "fareName": "Mint",
            "carryOnBag": "included",
            "checkedBag": "included",
            "bookingUrl": "https://www.kayak.co.uk/book/flight?code=vGGCCn7gC4.HcI-hMJ5..."
        },
        {
            "providerCode": "CHECKNFLY",
            "providerName": "ChecknFly",
            "providerType": "travel site",
            "price": 3105,
            "totalPrice": 9315,
            "currency": "GBP",
            "priceText": "£3,105",
            "fareName": "Mint",
            "carryOnBag": "included",
            "checkedBag": "included",
            "bookingUrl": "https://www.kayak.co.uk/book/flight?code=vGGCCn7gC4.BOXK_LsO..."
        }
    ],
    "itineraryUrl": "https://www.kayak.co.uk/flights/LON-NYC/2027-01-17/2027-01-24/business/fa24ae32a9681bc21915a30413a4a5afa/2adults/children-11?viewRank=35",
    "searchUrl": "https://www.kayak.co.uk/flights/LON-NYC/2027-01-17/2027-01-24/business/2adults/children-11?sort=price_a",
    "kayakSite": "kayak.co.uk",
    "adults": 2,
    "children": 1,
    "cabinClass": "business",
    "itineraryId": "a24ae32a9681bc21915a30413a4a5afa",
    "scrapedAt": "2026-11-18T08:29:26.071Z"
}
```

### Tips and limits

- **Times are local** at each airport, as on KAYAK. Durations are in minutes.
- **Prices are what KAYAK shows at run time.** The booking site sets the final price, and some add bag or payment fees.
- **City codes cover every airport** of a city (`LON` includes Heathrow, Gatwick, Stansted, Luton and City).
- **Fare names and bag rules** appear when KAYAK shows them for that fare; otherwise they are `null`.
- **Limits:** up to 200 searches per run and 500 itineraries per search. With filters the Actor reads at most 10 KAYAK pages (500 itineraries) per search.
- **Failures:** a bad code, a past date or an unsupported KAYAK site stops the run at once with a clear message and no charge. If KAYAK refuses one search, the others go on, saved rows are kept and the status names the failed search.
- **Multi-city trips** are not supported yet; search each leg as its own route.

### Scheduling fare monitoring

1. Save your input as an Apify **Task**, with your routes and dates in **Routes (batch)**.
2. Add a **Schedule**, for example every morning at 06:00.
3. Keep `maxItinerariesPerSearch` small (10 to 20) and sort by `price` for a cheap daily tracker.
4. Send each run's dataset to Google Sheets, a webhook or your database, and compare `price` by route, date and `providerName` over time.

### Integrations

- **Google Sheets, Excel, CSV:** export the Flights view directly.
- **Make, Zapier, n8n:** start a flow when a run succeeds and read the dataset.
- **Webhooks:** post the dataset link to your backend after each run.
- **Data warehouses:** load the JSON with `legs` and `bookingOptions` as nested records.

### Use the KAYAK scraper with the API

cURL:

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~kayak-flights-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"origin":"JFK","destination":"LAX","departureDate":"2027-01-20","maxItinerariesPerSearch":20}'
```

JavaScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('automation-lab/kayak-flights-scraper').call({
    origin: 'JFK',
    destination: 'LAX',
    departureDate: '2027-01-20',
    sortBy: 'price',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].price, items[0].providerName, items[0].bookingOptions.length);
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("automation-lab/kayak-flights-scraper").call(run_input={
    "kayakSite": "kayak.de",
    "origin": "FRA",
    "destination": "BCN",
    "departureDate": "2027-01-20",
    "maxStops": "0",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["flightNumbers"], row["price"], row["currency"], row["providerName"])
```

### Use with AI agents through MCP

Connect this Actor to Claude, Cursor, VS Code or any MCP client through the Apify MCP server.

Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/kayak-flights-scraper"
```

Claude Desktop, Cursor or VS Code (JSON config):

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com?tools=automation-lab/kayak-flights-scraper"
        }
    }
}
```

The Actor-specific URL also adds the run and dataset helper tools. A search can take longer than one `call-actor` wait, so keep the returned run ID and check that same run until it finishes, then read the dataset in pages (for example 20 rows at a time) with only the fields you need, such as `price`, `providerName`, `flightNumbers`, `departAt`.

Example prompts:

- "Find the 10 cheapest KAYAK flights from New York to Los Angeles on 20 January and list who sells each one."
- "Compare business class prices London to New York on kayak.co.uk for 17 to 24 January."
- "Which booking site is cheapest for nonstop Frankfurt to Barcelona flights next Friday on kayak.de?"

### Data handling and privacy

The Actor does not call an AI model and collects no personal data. It sends only your routes, dates, cabin and traveller counts to KAYAK. Results stay in your Apify run storage and follow your account's retention settings.

Failed operations send sanitized diagnostic input, exceptions and Actor/build/run IDs to our private GlitchTip service for repair. Secret fields and URL query strings are removed; reports are retained for 30 days.

### Is it legal to scrape KAYAK?

This Actor collects publicly visible flight prices and schedules, the same data any visitor sees on KAYAK without logging in. It collects no personal data. Make sure your use complies with KAYAK's terms and the laws that apply to you, especially if you republish the data commercially. This Actor is not affiliated with or endorsed by KAYAK. When in doubt, consult a lawyer.

### FAQ

**How fresh are the prices?**
Each search is a live KAYAK search at run time. KAYAK may reuse very recent partner answers from its own cache.

**Why is the price different on the booking site?**
Airlines and travel sites change prices often, and some add fees for bags or payment. Always confirm on the booking site.

**Why did I get fewer itineraries than my limit?**
KAYAK found fewer for that route and date, or your Max stops or Airlines filter matched fewer within 10 pages of results. The run status says how many rows were saved.

**A search failed with a KAYAK bot check. What now?**
The Actor already retries with fresh sessions and switches to residential connections. Run it again a few minutes later; you only pay for saved rows.

**Can I search a price calendar or flexible dates?**
Not as one KAYAK request. Put each date you care about in Routes (batch); they run in parallel in one run.

**Which currency do I get?**
The currency of the KAYAK site you choose, for example USD on kayak.com, GBP on kayak.co.uk and EUR on kayak.de.

### Related Actors

- [Skyscanner Flight Price Scraper](https://apify.com/automation-lab/skyscanner-flight-price-scraper): flight prices from Skyscanner with every agent's price and a price calendar.
- [Google Flights Scraper](https://apify.com/automation-lab/google-flights-scraper): flight prices from Google Flights.
- [Ryanair Scraper](https://apify.com/automation-lab/ryanair-flight-fares-cheapest-routes): Ryanair fares and cheapest routes.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/kayak-flights-scraper/changelog.md

# Actor input Schema

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

3-letter IATA airport code (JFK, LHR) or KAYAK city code that covers all airports of a city (NYC, LON). Use with To and Departure date for one search. Leave empty when you use Routes or KAYAK search links.

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

3-letter IATA airport or city code of the arrival, e.g. LAX or PAR.

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

Outbound date, YYYY-MM-DD. Must be today or later.

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

Leave empty for a one-way search. When set, KAYAK prices the round trip and each row has the outbound and return flights; the price covers both directions.

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

Many searches in one run. Each item is one search: {"origin": "LHR", "destination": "JFK", "departureDate": "2027-02-10", "returnDate": "2027-02-17"} (returnDate optional). To track several dates on one route, add one item per date. Cabin, passengers, site, sort and filters below apply to every route. Runs together with the single route above. At most 200 searches per run.

## `searchUrls` (type: `array`):

Paste results links from KAYAK, e.g. https://www.kayak.co.uk/flights/LON-NYC/2027-01-10/2027-01-17/business/2adults?sort=price_a. The link sets its own site, route, dates, cabin, adults, children and sort; other fields here only fill what the link does not say. KAYAK on-page filters in the fs= parameter are not applied; use Max stops and Airlines below.

## `kayakSite` (type: `string`):

Which KAYAK country site to search. It sets the price currency and the mix of booking sites (local agencies differ by country). Not used for KAYAK search links, which carry their own site.

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

Cabin to search.

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

Adult travellers (1-9).

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

Child travellers, searched as age 11. Adults plus children may not exceed 9. price is per person as KAYAK shows it; totalPrice covers all travellers.

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

Order in which KAYAK ranks itineraries. With a limit below the total, it decides which itineraries you get.

## `maxItinerariesPerSearch` (type: `integer`):

Limit per search (per route and date), in itineraries that pass Max stops and Airlines. KAYAK serves 50 itineraries per page: without filters 50 reads one page and 200 reads four; with filters the Actor reads up to 10 pages to fill the limit. A search stops early when KAYAK has no more. With one row per booking provider on, each itinerary gives several rows.

## `rowPerProvider` (type: `boolean`):

Off (default): one row per itinerary, priced at its cheapest booking option, with every option (airline direct, Expedia, Trip.com, ...) listed in bookingOptions with its own price, fare name and link. On: a separate row for each booking option instead, for spreadsheets; an itinerary then gives about 5-30 rows, and each row is charged.

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

Keeps only itineraries where no direction has more stops than this. Filtering happens on KAYAK results as they are read (up to 10 pages of 50 per search), so a rare match can return fewer rows than the limit.

## `airlines` (type: `array`):

Keeps only itineraries flown at least partly by one of these 2-letter airline codes (e.g. BA, AA, LH). Case-insensitive; a match on any flight segment counts. Applies to every search in the run. Filtering happens on KAYAK results as they are read (up to 10 pages of 50 per search).

## Actor input object example

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "2027-01-20",
  "routes": [],
  "searchUrls": [],
  "kayakSite": "kayak.com",
  "cabinClass": "economy",
  "adults": 1,
  "children": 0,
  "sortBy": "best",
  "maxItinerariesPerSearch": 50,
  "rowPerProvider": false,
  "maxStops": "any",
  "airlines": []
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per itinerary (with all booking options) or per booking site, depending on input. Table view: route, price, provider, airlines, flight numbers, times, stops, booking link.

# 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": "JFK",
    "destination": "LAX",
    "departureDate": "2027-01-20",
    "routes": [],
    "searchUrls": [],
    "airlines": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/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 = {
    "origin": "JFK",
    "destination": "LAX",
    "departureDate": "2027-01-20",
    "routes": [],
    "searchUrls": [],
    "airlines": [],
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/kayak-flights-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 '{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "2027-01-20",
  "routes": [],
  "searchUrls": [],
  "airlines": []
}' |
apify call automation-lab/kayak-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/kayak-flights-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/DTsV9FNqFVG7FJDI6/builds/FzePksM9JskJkfE0r/openapi.json
