# Booking.com Scraper — Hotel Prices & Availability by Date (`kestrel/booking-prices-scraper`) Actor

Booking.com hotel prices for exact dates and guests: every property in a destination or a list of hotels, each with its stay total and nightly price, taxes, free-cancellation and breakfast flags, stars, review score, location and optional room rates. No browser, no login. Pay per priced hotel.

- **URL**: https://apify.com/kestrel/booking-prices-scraper.md
- **Developed by:** [Tedj MEABIOU](https://apify.com/kestrel) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 5 total users, 3 monthly users, 96.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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?

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

## Booking.com Scraper — Hotel Prices & Availability by Date

This **Booking.com scraper** is a **hotel price scraper** for exact dates, guests and rooms: it returns **Booking.com hotel prices** for every property in a destination, or for a list of hotels by URL, name or id, each as one clean row with the stay total in your currency, the nightly price, the taxes and fees Booking leaves out, free-cancellation and breakfast flags, stars, review score, location and the cheapest room. It reads the same call Booking.com's own search results page makes, so there is no browser, no login and no Booking.com API key — a way to scrape Booking.com without API access — and you pay per priced property, never for sold-out ones.

Last verified working: 2026-08-29.

### What does the Booking.com scraper do?

Give it a stay — check-in, nights, adults, children's ages, rooms, currency — and either destinations ("Lisbon", "Algarve", "Times Square", "Portugal") or properties. It returns:

- **One `hotel` row per property**: the lowest stay total Booking.com shows for that party, the nightly rate derived from it, the hotel-currency total, what is excluded (taxes and fees) and Booking's own wording for it, free cancellation, no-prepayment and breakfast flags, stars, the 1-10 review score and count, address, coordinates, neighbourhood and distance from the centre, the room behind the headline price, whether the property is sold out and the alternative dates Booking suggests.
- **Optional `room` rows** (`includeRooms`): every room and rate combination Booking matched to the stay, with its own price, occupancy, meal plan, free-cancellation deadline and "only 2 left" message.
- **One `status` row per target**: how many properties were delivered, priced, filtered and duplicated, how many pages were read and Booking's total for the destination.

Destinations are resolved through Booking's own autocomplete, so a city, region, district, landmark, airport or country all work, and sorting uses Booking's own orders (price, review score, stars, distance) so a **hotel price scraper** run is repeatable day after day.

### Booking.com hotel prices for a destination, a comp set or a portfolio

Three ways to address what you want priced, mixed freely in one run:

- **Destinations** (`locationQueries`) — a place name, paged up to `maxHotelsPerQuery` properties in the order `sortBy` gives. "Lisbon" with `sortBy: price` and 100 properties is one request; a 1,000-property market scan is ten.
- **Hotel URLs** (`startUrls`) — Booking.com property pages. A URL carries no id, so it is resolved through autocomplete first.
- **Hotel names or ids** (`hotelNames`, `hotelIds`) — the id is what an earlier run's `hotel_id` column holds, and it is the fastest way to re-price a comp set every morning.

A property that turns up twice (in two destinations, or as a URL and its id) is delivered and billed once; the second sighting is counted in `duplicates`.

### Hotel price monitoring that never goes stale

`checkIn` accepts relative dates — `"30 days"`, `"6 weeks"`, `"tomorrow"` — so a scheduled run always prices the same lead time. Run it daily with `sortBy: price` and you get a **booking.com prices by date** history for a market; run it with a comp set of ids and you have a **hotel rate scraper** doing your **hotel rate shopping** every morning, with **booking.com availability** (sold-out state and alternative dates) in the same rows. Because every row carries `check_in`, `nights`, `adults`, `rooms` and `currency`, rows from different days line up in one table without any post-processing.

The `maxPrice` input keeps only properties whose nightly rate is at or under a figure, and `minStars` is passed to Booking itself as its star filter. Both run **before billing**: a "4-star hotels under 150 EUR in Lisbon" run delivers and bills only the rows that qualify, and a quiet day costs nothing.

### Input

| field | what it does |
|---|---|
| `locationQueries` | Destinations as typed into Booking's search box. Each is one search for the stay. |
| `maxHotelsPerQuery` | Properties to take per destination (1-1000, default 50), in `sortBy` order. Booking pages 100 at a time. |
| `startUrls` | Booking.com property pages, priced one by one. |
| `hotelNames` | Property names; the first autocomplete match is priced — check `hotel_name` in the status row. |
| `hotelIds` | Booking's numeric ids (`hotel_id` from an earlier run). |
| `checkIn` | `YYYY-MM-DD` or relative (`"30 days"`). Check-out is `checkIn` + `nights`. |
| `nights` | Length of stay, 1-30. |
| `adults` | Adults across all rooms (1-30). |
| `childrenAges` | One age per child, 0-17. Booking needs ages to match family rooms. |
| `rooms` | Rooms needed (1-30). |
| `currency` | ISO code for every price. The hotel's own currency is kept alongside. |
| `sortBy` | Booking's orders: `popularity`, `price`, `price_desc`, `review_score`, `review_score_and_price`, `stars`, `stars_asc`, `stars_and_price`, `distance`, `homes_first`. |
| `minStars` | 0 = all; 1-5 = Booking's star filter, applied before fetching. |
| `maxPrice` | 0 = all; N = keep properties whose nightly rate is ≤ N in `currency`. Filtered rows are never billed. |
| `includeRooms` | Also deliver `room` rows for every priced property. |
| `locale` | Booking locale for labels and number formats (`en-US`, `de-DE`, …). |
| `sessions`, `perIp` | Parallel proxy sessions and the pace of each. |
| `proxyConfiguration` | Apify Proxy, RESIDENTIAL group — required (see the honest notes). |

#### Example: the cheapest 100 places in Lisbon for a weekend

```json
{
  "locationQueries": ["Lisbon"],
  "maxHotelsPerQuery": 100,
  "checkIn": "6 weeks",
  "nights": 2,
  "adults": 2,
  "currency": "EUR",
  "sortBy": "price"
}
```

One request, 100 rows, 100 × $0.004 = $0.40.

#### Example: a daily rate shop for a comp set

```json
{
  "hotelIds": ["536251", "2251985", "1471925"],
  "checkIn": "30 days",
  "nights": 1,
  "adults": 2,
  "currency": "USD",
  "includeRooms": true
}
```

Three `hotel` rows and every room and rate each property offers for that night, every morning, at the same 30-day lead time.

#### Example: family rooms under a budget, 4 stars and up

```json
{
  "locationQueries": ["Algarve"],
  "maxHotelsPerQuery": 200,
  "checkIn": "2026-10-10",
  "nights": 7,
  "adults": 2,
  "childrenAges": [5, 9],
  "rooms": 1,
  "currency": "GBP",
  "sortBy": "review_score",
  "minStars": 4,
  "maxPrice": 180
}
```

Booking applies the star filter; the actor applies the price cap; you are billed for the rows that pass both.

### Output

Every row has `type`: `hotel`, `room` or `status`. Hotel rows always carry every column below (null where Booking shows nothing), so a CSV export is rectangular.

```json
{
  "type": "hotel",
  "hotel_id": "536251",
  "name": "Memmo Alfama - Design Hotels",
  "url": "https://www.booking.com/hotel/pt/memmo-alfama.html",
  "property_type": "hotel",
  "stars": 4,
  "review_score": 9.3,
  "review_count": 894,
  "city": "Lisboa",
  "country_code": "pt",
  "display_location": "Santa Maria Maior, Lisbon",
  "distance_from_center": "0.8 km from downtown",
  "check_in": "2026-09-28",
  "check_out": "2026-09-29",
  "nights": 1,
  "adults": 2,
  "currency": "EUR",
  "price_total": 415.09,
  "price_nightly": 415.09,
  "price_display": "€ 415.09",
  "hotel_currency": "EUR",
  "taxes_included": true,
  "free_cancellation": true,
  "breakfast_included": true,
  "room_name": "Superior Double Room with Terrace",
  "rooms_listed": 3,
  "sold_out": false,
  "rank": 1,
  "query": "Memmo Alfama Lisbon"
}
```

Key columns:

- `price_total` / `price_nightly` / `currency` — the lowest total Booking shows for the whole stay and party, and that total divided by nights. `price_display` is Booking's own formatted string.
- `taxes_included`, `taxes_fees_excluded`, `charges_note` — whether Booking lists excluded charges, how much they are, and its wording ("+US$9 taxes and fees").
- `price_hotel_currency_total` / `hotel_currency` — the same total in the property's own currency, so conversions are yours to make.
- `stars`, `review_score`, `review_count`, `property_type`, `address`, `latitude`, `longitude`, `display_location`, `distance_from_center`, `transport`.
- `free_cancellation`, `no_prepayment`, `meal_plan`, `breakfast_included`, `room_name`, `rooms_listed`.
- `sold_out`, `sold_out_message`, `alternative_check_in`, `alternative_check_out` — a property with no price for the dates is delivered free with these filled in.
- `sponsored`, `newly_opened`, `sustainable`, `host_type`, `image`, `rank`, `query`.

`room` rows: `room_id`, `room_name`, `occupancy`, `meal_plan`, `price_total`, `price_nightly`, `currency`, `price_original` in the hotel currency, `free_cancellation_until`, `only_x_left`, `has_crib`, `third_party`.

`status` rows: `target`, `kind` (destination or hotel), `dest_type`, `dest_id`, `hotel_id`, `hotel_name`, `status` (`ok`, `no_results`, `not_found`, `duplicate`, `error`), `hotels`, `priced`, `unpriced`, `filtered`, `duplicates`, `rooms`, `pages`, `total`, `error`.

### How much does it cost?

$0.004 per priced `hotel` row and $0.002 per `room` row, plus nothing else: sold-out and unpriced properties, status rows, filtered rows and refused runs are free. Pricing 100 Lisbon properties is $0.40; a daily comp set of 10 hotels with room rates (say 60 rooms) is $0.16 a day. Apify's platform usage for a 100-property search is well under a cent.

### Booking.com scraper in Python, JavaScript, curl, n8n, Make or an AI agent

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("kestrel/booking-prices-scraper").call(run_input={
    "locationQueries": ["Lisbon"], "maxHotelsPerQuery": 50,
    "checkIn": "30 days", "nights": 1, "adults": 2, "currency": "EUR", "sortBy": "price",
})
rows = [r for r in client.dataset(run["defaultDatasetId"]).iterate_items() if r["type"] == "hotel" and r["price_total"] is not None]
for r in rows[:10]:
    print(r["rank"], r["name"], r["stars"], r["review_score"], r["price_nightly"], r["currency"], r["room_name"])
```

JavaScript:

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('kestrel/booking-prices-scraper').call({
    hotelIds: ['536251', '2251985'], checkIn: '30 days', nights: 1, adults: 2, currency: 'USD', includeRooms: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const hotels = items.filter(r => r.type === 'hotel');
console.log(hotels.map(h => [h.name, h.price_nightly, h.free_cancellation]));
```

curl:

```bash
curl -X POST "https://api.apify.com/v2/acts/kestrel~booking-prices-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"locationQueries": ["Algarve"], "maxHotelsPerQuery": 30, "checkIn": "6 weeks", "nights": 3, "adults": 2, "currency": "GBP", "sortBy": "review_score", "minStars": 4}'
```

**n8n and Make:** an HTTP Request node posting the same JSON to `run-sync-get-dataset-items` returns the rows in one step; keep rows where `type` is `hotel`, compare `price_nightly` with the previous run in a Code node, and alert on drops. The Google Hotels price-drop template in the [kestrel examples repository](https://github.com/mtedj/kestrel-actors-examples) follows exactly that shape.

**MCP and AI agents:** the actor is callable through Apify's MCP server; an agent that needs "the cheapest 4-star hotel in Lisbon next weekend under 200 EUR" can pass `locationQueries`, `checkIn`, `minStars`, `maxPrice` and read the first `hotel` row.

### Is it legal to scrape Booking.com prices?

The actor reads the publicly visible prices and property facts that Booking.com shows every anonymous visitor for the dates and party you specify — no login, no personal data, nothing behind an account. Prices are facts, not copyrighted works. Whether your use complies with Booking's terms and with the laws where you operate is your responsibility; keep the request rate reasonable, do not resell Booking's data as your own, and attribute where you publish comparisons.

### Limits and honest notes

- **Residential proxy required.** Booking's search call answers datacenter addresses with its WAF challenge but serves residential ones without cookies or tokens. The default `proxyConfiguration` is set accordingly; changing it to datacenter makes every search fail.
- **"Top picks" shifts between pages.** Booking's default `popularity` order is personalised and reshuffles, so a long paged run under it can repeat properties (deduplicated, counted in `duplicates`) and miss others. Use `price`, `review_score`, `stars` or `distance` for a complete, repeatable list.
- **Prices are for your party.** The stay total depends on adults, children's ages and rooms; a solo traveller sees different rates than a couple. `price_nightly` is the total divided by nights, not Booking's own per-night figure (which it omits for most searches).
- **Taxes vary by market.** In some countries the total includes taxes; elsewhere Booking lists them as excluded. `taxes_included`, `taxes_fees_excluded` and `charges_note` say which, per row.
- **Sold-out properties** still appear (free) with `sold_out: true` and Booking's alternative dates when it offers them. With `maxPrice` set they are dropped, since they have no price to compare.
- **Room rows** describe the combinations Booking matched to the party, not the property's whole inventory; a room can appear twice with different meal plans or cancellation policies.
- **A destination that names a property** ("Memmo Alfama Lisbon") prices just that property — the status row says `kind: hotel`.
- **Unknown ids** are reported as `not_found`, free. An unplaceable destination is an `error` row; the run continues with the other targets.

### FAQ

#### Does it need a Booking.com API key or login?

No. It uses the same GraphQL call Booking's public search results page makes, anonymously, and only needs Apify's residential proxy group.

#### Can I get Booking.com hotel prices for exact dates?

Yes — that is the whole point. `checkIn` plus `nights` sets the stay; `adults`, `childrenAges` and `rooms` set the party; `currency` sets the money. Every row carries those values.

#### How is this different from a browser-based Booking.com scraper?

It never renders a page. A 100-property search is one request that takes about three seconds, so a market scan costs a few cents of platform time instead of minutes of browser time, and it does not break when Booking changes its page layout.

#### Which sort orders are repeatable?

`price`, `price_desc`, `review_score`, `stars`, `stars_asc`, `distance` and their combinations are deterministic. `popularity` is Booking's personalised "top picks" and moves between pages.

#### Can I filter by star rating or price before paying?

Yes. `minStars` is sent to Booking as its own filter, so those properties are never fetched; `maxPrice` drops rows above your nightly cap before they are billed.

#### Does it return room-level rates?

With `includeRooms: true` you get one `room` row per room and rate combination, billed at $0.002 each. Without it you still get the cheapest room's name on the hotel row.

#### What does `taxes_included: false` mean?

Booking lists charges it excludes from the displayed total (city tax, VAT, resort fees). `taxes_fees_excluded` holds their amount in your currency and `charges_note` Booking's wording.

#### Why does the same hotel come back at a slightly different price on the next run?

Booking.com prices a stay per session. Two runs seconds apart can differ by a few per cent to a quarter — the site rotates promotional rates, mobile-only deals and currency handling per session, and `price_before_discount` is present on some answers and absent on others. That is the site's behaviour, not a parsing artefact, and every scraper of it sees the same thing.

Three ways to work with it rather than against it:

- Compare **the same field across runs** (`price_total` against `price_total`), never a nightly rate from one run with a stay total from another.
- Give a price-drop alert a threshold — three per cent filters the noise, and the n8n price-drop template ships with exactly that knob.
- For a decision that must be defensible (a rate-parity report, a revenue-management brief), take the **median of a few runs** rather than a single reading, or cross-check the stay against [Google Hotels Prices Scraper](https://apify.com/kestrel/google-hotels-prices), which reports what Google's own comparison shows for the same dates.

#### Can I use it for hotel price comparison across sites?

Yes — pair it with the Google Hotels and rate-parity actors below, which return every booking site's rate for the same stay, and compare the `price_total` columns.

#### How do I build a Booking.com price history?

Schedule a run with a relative `checkIn` and a deterministic `sortBy`; each day's rows share the same lead time and columns, so appending them to a sheet or a table is a price history.

#### Can I scrape Booking.com without an API?

That is what this does: no Booking.com API, no key, no browser — a plain request through Apify's proxy. If you have been searching for a "Booking.com API" for prices, this is the practical answer: the same data the site shows, as rows.

#### What does bulk work cost?

1,000 properties across ten destinations is 1,000 × $0.004 = $4.00 plus a cent or two of platform usage; ten requests of 100 rows each.

### Rate shopping and market data with Booking.com hotel data

#### Comp-set monitoring

Put the ids of your property and its competitors in `hotelIds`, schedule the run at the same hour daily for a few lead times (7, 14, 30 days), and chart `price_nightly` by `hotel_id` and `check_in`. `free_cancellation` and `breakfast_included` tell you whether a lower rate is really comparable.

#### Market scans

`locationQueries` with `sortBy: price` and a high `maxHotelsPerQuery` gives you the whole price ladder of a destination for a stay — the median rate, the share of properties under a budget, how many are sold out — in one request per hundred properties.

#### What this does not do

It does not read reviews (that is the Booking.com Reviews Scraper below), it does not book, and it does not see member-only or logged-in Genius rates.

### Related scrapers

Prices are one side of a stay. These read the rest of it, and they share the same pay-per-delivered-row billing and the same scheduling story:

- **[Booking.com Reviews Scraper](https://apify.com/kestrel/booking-reviews-scraper)** — every guest review of a Booking.com property, filtered by language and score before billing.
- **[Google Hotels Prices Scraper](https://apify.com/kestrel/google-hotels-prices)** — every booking site's rate for a stay, one row per source.
- **[Hotel Rate Parity Checker](https://apify.com/kestrel/hotel-rate-parity)** — one row per property with every source side by side and the parity math done.
- **[Hotel Price Tracker](https://apify.com/kestrel/hotel-price-tracker)** — the lowest rate per property and check-in date over a window, for daily price history.
- **[Agoda Reviews Scraper](https://apify.com/kestrel/agoda-reviews-scraper)** — Agoda guest reviews with separate positives and negatives.

All of them bill per delivered row, never charge for rows a filter or a spending limit removed, and write an Apify dataset you can export to CSV, Excel or JSON.

# Changelog

This Actor's version history is a separate document: https://apify.com/kestrel/booking-prices-scraper/changelog.md

# Actor input Schema

## `locationQueries` (type: `array`):

Places as you would type them into Booking.com's search box — a city, region, district, landmark, airport or country ("Lisbon", "Algarve", "Times Square", "Portugal"). Each becomes one search for your dates, paged up to maxHotelsPerQuery properties. Leave empty to price only the hotels below.

## `maxHotelsPerQuery` (type: `integer`):

How many properties to take from each destination search, in the order sortBy gives (Booking pages 100 at a time). The main cost control for destination runs.

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

Booking.com property pages, e.g. https://www.booking.com/hotel/pt/memmo-alfama.html — each is priced on its own for your dates. Resolved through Booking's autocomplete (a URL carries no id).

## `hotelNames` (type: `array`):

Property names as you would type them into Booking's search box, e.g. "Memmo Alfama Lisbon". The first matching property wins; check the status row's hotel\_name.

## `hotelIds` (type: `array`):

Booking's numeric property ids, e.g. 536251 — what an earlier run's hotel\_id column holds. The fastest way to re-price a portfolio or a comp set every day.

## `checkIn` (type: `string`):

YYYY-MM-DD, or relative so a schedule never goes stale: "30 days", "6 weeks", "tomorrow". Check-out is checkIn + nights.

## `nights` (type: `integer`):

Length of stay. price\_total is for the whole stay; price\_nightly is the total divided by this.

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

Adults across all rooms. Booking prices the occupancy you ask for, so a solo traveller and a couple can see different rates.

## `childrenAges` (type: `array`):

One age (0-17) per child, e.g. 5 and 9. Booking needs ages, not a count, to match family rooms and child policies.

## `rooms` (type: `integer`):

How many rooms the guests need. With two rooms Booking returns two room blocks per property and the total covers both.

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

ISO code for every price (USD, EUR, GBP, …). The hotel's own currency is kept alongside in hotel\_currency and price\_hotel\_currency\_total.

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

Booking's own sort orders. "Top picks" is personalised and shifts between pages; the price, review and star orders are stable and are what a price monitor should use.

## `minStars` (type: `integer`):

0 = every property. 1-5 = Booking's own star filter, applied by Booking before the results are fetched — filtered properties are never fetched or billed.

## `maxPrice` (type: `number`):

0 = every priced property. N = keep only properties whose nightly rate (stay total ÷ nights, in your currency) is N or less. Filtered properties are never delivered or billed; with this set, sold-out properties are dropped too.

## `includeRooms` (type: `boolean`):

Also deliver one `room` row per room and rate combination Booking matched to the stay (name, occupancy, meal plan, price, free-cancellation deadline, "only X left"). Billed per room row.

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

Booking locale for the request, e.g. en-US, en-GB, de-DE, fr-FR. It sets the language of labels such as the meal plan and distance texts and the number format in price\_display.

## `sessions` (type: `integer`):

How many proxy sessions (egress IPs) run in parallel. More is faster; each is paced separately.

## `perIp` (type: `number`):

Pace for each session. Booking answered 10 searches at 1/s from one IP with no refusals; a search takes 2-4 s anyway.

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

Apify Proxy with the RESIDENTIAL group is required: Booking's search call answers datacenter IPs with its WAF challenge, while residential IPs are served without cookies or tokens. Keep the default.

## Actor input object example

```json
{
  "locationQueries": [
    "Lisbon"
  ],
  "maxHotelsPerQuery": 20,
  "startUrls": [],
  "hotelNames": [],
  "hotelIds": [],
  "checkIn": "30 days",
  "nights": 1,
  "adults": 2,
  "childrenAges": [],
  "rooms": 1,
  "currency": "USD",
  "sortBy": "popularity",
  "minStars": 0,
  "maxPrice": 0,
  "includeRooms": false,
  "locale": "en-US",
  "sessions": 4,
  "perIp": 1,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per property with the stay total and nightly rate, optional room-rate rows, and status rows. Charged rows are billed as delivered; unpriced properties and status rows are always free.

## `summary` (type: `string`):

One JSON record with the counts this run delivered and charged, its filtered and duplicate tallies, and its HTTP stats.

# 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 = {
    "locationQueries": [
        "Lisbon"
    ],
    "maxHotelsPerQuery": 20,
    "startUrls": [],
    "hotelNames": [],
    "hotelIds": [],
    "checkIn": "30 days",
    "childrenAges": [],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kestrel/booking-prices-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 = {
    "locationQueries": ["Lisbon"],
    "maxHotelsPerQuery": 20,
    "startUrls": [],
    "hotelNames": [],
    "hotelIds": [],
    "checkIn": "30 days",
    "childrenAges": [],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("kestrel/booking-prices-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 '{
  "locationQueries": [
    "Lisbon"
  ],
  "maxHotelsPerQuery": 20,
  "startUrls": [],
  "hotelNames": [],
  "hotelIds": [],
  "checkIn": "30 days",
  "childrenAges": [],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call kestrel/booking-prices-scraper --silent --output-dataset

```

## MCP server setup

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