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

Get Kayak one-way or round-trip itineraries with flight legs, travel times, provider counts, and shareable links. Add several origin-destination routes in one run to compare fares or plan trips.

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

## Pricing

from $0.20 / 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.
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

Search Kayak for airport routes and collect itinerary IDs, flight legs, timing, provider counts, and shareable result links. Choose one-way or round-trip searches.

### What data can you extract?

| Field | Type | Description |
| --- | --- | --- |
| `resultId` | String | Identifier for the flight itinerary in this Kayak result set. |
| `type` | String | Kayak trip type for the itinerary, such as one-way or round trip. |
| `shareableId` | String | Kayak identifier used to reopen the saved itinerary search. |
| `shareableUrl` | String | URL that opens this itinerary or its search results on Kayak. |
| `legs` | Array\<object> | Flight segments with airports, departure and arrival times, and duration. |
| `totalProviders` | Integer | Number of booking providers offering this itinerary. |
| `totalBookingOptions` | Integer | Number of distinct booking choices reported for the itinerary. |
| `input_route` | Object | Origin, destination, and any dates submitted for this route search. |
| `scraped_at` | String | UTC date and time when this itinerary was collected. |

### Use cases

- Travel planners can compare itineraries across multiple airport routes.
- Travel agencies can check providers, flight times, and booking choices.
- Fare analysts can track options for one-way and round-trip searches.

### How to use

1. Add one route object with origin and destination to `flights` per search.
2. Choose one-way or round-trip; omitted dates are set relative to today.
3. Set passenger and cabin options, then cap pages and results.

```json
{
  "flights": [
    {
      "origin": "JFK",
      "destination": "LAX"
    }
  ],
  "tripType": "one-way",
  "maxResults": 20,
  "maxPages": 2
}
```

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `flights` | Array\<object> | Yes | Flight routes with an origin and destination for each search. |
| `flights[].origin` | string | Yes per entry | 3-letter IATA airport or metro code. |
| `flights[].destination` | string | Yes per entry | 3-letter IATA airport or metro code. |
| `flights[].departure_date` | string | No | Departure date in YYYY-MM-DD format. When omitted, departure is set to 30 days from today. |
| `flights[].adults` | integer | No | Adult passengers, 1-9. |
| `flights[].children` | integer | No | Child passengers, 0-8. |
| `flights[].infants_in_seat` | integer | No | Infants with a seat, 0-8. |
| `flights[].infants_on_lap` | integer | No | Lap infants, 0-8. |
| `flights[].cabin` | string | No | economy, premium_economy, business, or first. |
| `flights[].sort` | string | No | best, price, or duration. |
| `flights[].page` | integer | No | Results page, 1-20. |
| `flights[].currency` | string | No | 3-letter ISO currency code. |
| `flights[].locale` | string | No | Language locale such as en-US. |
| `flights[].include_price_prediction` | boolean | No | Include available price insight data. |
| `flights[].include_display_metadata` | boolean | No | Include available display and offer metadata. |
| `flights[].return_date` | string | Conditional | Return date in YYYY-MM-DD format. Required when tripType is round-trip. Required for Round trip searches. When omitted for a round trip, return is set to 4 days after departure. |
| `destination` | string | No | 3-letter IATA airport or metro code. |
| `departure_date` | string | No | Departure date in YYYY-MM-DD format. When omitted, departure is set to 30 days from today. |
| `adults` | integer | No | Adult passengers, 1-9. |
| `children` | integer | No | Child passengers, 0-8. |
| `infants_in_seat` | integer | No | Infants with a seat, 0-8. |
| `infants_on_lap` | integer | No | Lap infants, 0-8. |
| `cabin` | string | No | economy, premium_economy, business, or first. |
| `sort` | string | No | best, price, or duration. |
| `page` | integer | No | Results page, 1-20. |
| `currency` | string | No | 3-letter ISO currency code. |
| `locale` | string | No | Language locale such as en-US. |
| `include_price_prediction` | boolean | No | Include available price insight data. |
| `include_display_metadata` | boolean | No | Include available display and offer metadata. |
| `return_date` | string | Conditional | Return date in YYYY-MM-DD format. Required when tripType is round-trip. Required for Round trip searches. When omitted for a round trip, return is set to 4 days after departure. |
| `tripType` | string | No | Choose a one-way or round-trip search. Round-trip routes use a return date. |
| `maxResults` | integer | No | Maximum dataset items to save across this entire run. |
| `maxPages` | integer | No | Maximum pages to request for each batch entry. |

### Output example

```json
{
  "resultId": "FL-JFK-LAX-20261114-01",
  "type": "ONE_WAY",
  "shareableId": "8f31b7",
  "shareableUrl": "https://www.kayak.com/flights/JFK-LAX/2026-11-14",
  "legs": [
    {
      "id": "leg-1",
      "departure": "2026-11-14T08:00:00Z",
      "arrival": "2026-11-14T11:00:00Z",
      "duration": 360
    }
  ],
  "totalProviders": 2,
  "totalBookingOptions": 3,
  "input_route": {
    "origin": "JFK",
    "destination": "LAX"
  },
  "scraped_at": "2026-10-01T12:00:00Z"
}
```

### Pricing

$0.30 per 1,000 results. Apify saves one dataset item per result and applies the Actor’s per-result price to saved items.

Pagination follows the source response. Set **maxPages** per batch entry and **maxResults** across the run.

### FAQ

#### Is scraping this information legal?

Rules depend on the source, location, data type, and intended use. Check applicable laws and source terms, and make sure your workflow follows privacy and data protection requirements.

#### What limits apply?

Submit up to 100 batch entries per run. Use **maxResults** to cap saved items and **maxPages** to limit pages for each entry. Results also depend on source availability and your Scrappa API plan.

#### Can I start runs through the Apify API?

Yes. Send a POST request to `https://api.apify.com/v2/acts/thescrappa~kayak-flights-scraper/runs` with your Actor input, or use an Apify client library. Read the output from the run dataset.

#### Can I connect the results to other tools?

Yes. Apify integrations and APIs can pass dataset results to Make, Zapier, n8n, Google Sheets, and other data workflows.

#### What happens when one input fails?

The Actor logs a short source error and continues with the remaining entries. Transient rate limits and gateway errors are retried; if every entry fails, the run reports an error.

#### How are travel dates chosen when omitted?

Departure defaults to 30 days from the run date. A round-trip return defaults to four days later; dates can be overridden per route or at the top level.

### Related Scrappa Actors

- [Google Flights Scraper](https://apify.com/thescrappa/google-flights-search-scraper)
- [Booking.com Search Scraper](https://apify.com/thescrappa/booking-search-scraper)
- [Booking.com Hotel Details Scraper](https://apify.com/thescrappa/booking-hotel-details-scraper)

# Actor input Schema

## `flights` (type: `array`):

Flight routes with an origin and destination for each search.

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

3-letter IATA airport or metro code.

## `departure_date` (type: `string`):

Departure date in YYYY-MM-DD format. When omitted, departure is set to 30 days from today.

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

Adult passengers, 1-9.

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

Child passengers, 0-8.

## `infants_in_seat` (type: `integer`):

Infants with a seat, 0-8.

## `infants_on_lap` (type: `integer`):

Lap infants, 0-8.

## `cabin` (type: `string`):

economy, premium_economy, business, or first.

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

best, price, or duration.

## `page` (type: `integer`):

Results page, 1-20.

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

3-letter ISO currency code.

## `locale` (type: `string`):

Language locale such as en-US.

## `include_price_prediction` (type: `boolean`):

Include available price insight data.

## `include_display_metadata` (type: `boolean`):

Include available display and offer metadata.

## `return_date` (type: `string`):

Return date in YYYY-MM-DD format. Required when tripType is round-trip. Required for Round trip searches. When omitted for a round trip, return is set to 4 days after departure.

## `tripType` (type: `string`):

Choose a one-way or round-trip search. Round-trip routes use a return date.

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

Maximum dataset items to save across this entire run.

## `maxPages` (type: `integer`):

Maximum pages to request for each batch entry.

## Actor input object example

```json
{
  "flights": [
    {
      "origin": "JFK",
      "destination": "LAX"
    }
  ],
  "adults": 1,
  "children": 0,
  "infants_in_seat": 0,
  "infants_on_lap": 0,
  "cabin": "economy",
  "sort": "best",
  "page": 1,
  "currency": "USD",
  "locale": "en-US",
  "tripType": "one-way",
  "maxResults": 20,
  "maxPages": 2
}
```

# Actor output Schema

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

All results from this run in the default dataset.

# 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 = {
    "flights": [
        {
            "origin": "JFK",
            "destination": "LAX"
        }
    ],
    "tripType": "one-way",
    "maxResults": 20,
    "maxPages": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("thescrappa/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 = {
    "flights": [{
            "origin": "JFK",
            "destination": "LAX",
        }],
    "tripType": "one-way",
    "maxResults": 20,
    "maxPages": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("thescrappa/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 '{
  "flights": [
    {
      "origin": "JFK",
      "destination": "LAX"
    }
  ],
  "tripType": "one-way",
  "maxResults": 20,
  "maxPages": 2
}' |
apify call thescrappa/kayak-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thescrappa/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/c5CJmHWWHZDpxaTlF/builds/eFlP8psi9pZG27hPI/openapi.json
