# Booking.com Scraper (`scrapeai/booking-com-scraper`) Actor

Target-aware live actor for Booking.com Scraper. Scrape hotels and prices from Booking.com by city or search URL. Returns separate price fields — nightly rate, price before discount, taxes and fees, and total — plus ratings, stars, location and coordinates. Filter by dates, stars, score and price.…

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

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

**Status (2026-11-14): works through public Google Images results, and returns far less than a Booking.com scraper normally does.** booking.com answers plain HTTP requests with an AWS WAF challenge page (HTTP 202, no hotel rows), and this actor does not try to get around that challenge. It therefore **never contacts booking.com**. It reads public Google Search results (Google Images by default) for Booking.com hotel pages and returns, for each hotel page that Google shows: the page URL, a hotel ID, the country code, the hotel name and the city. **It does not return prices, availability, review scores, reviews, star ratings, amenities, rooms, photos, addresses or coordinates**, and it cannot apply date, guest, currency, star, score or price filters.

### What you get, and from where

| Data source (`resultSource`) | Where the data comes from | Fields |
|------------------------------|---------------------------|--------|
| `images` (default) | One Google Images page for `site:booking.com/hotel <your words>`, read through the Apify `GOOGLE_SERP` proxy group. Every image result carries the hotel page URL and the title of that page in plain attributes. | `hotelId`, `countryCode`, `name`, `city` (when the title shows it), `url`, `pageTitle`, `sourceUrl`, `dataOrigin` (`google-serp-images`), `serpQuery`, `serpPosition`, `titleTruncated` (only when set), `scrapedAt`. No result text. |
| `web` (opt-in) | Google web results for the same query, `maxPages` pages per search. | The same fields, plus `summary` (the short result text Google shows) and `dataOrigin` `google-serp`. Google often prints only opaque redirect links instead of the hotel URLs, which the actor never follows, so many results (sometimes all) are lost. |

Booking.com itself is never requested, not even for `robots.txt`. The only host the actor talks to is `www.google.com`, only the `/search` path, only through the `GOOGLE_SERP` proxy group, with no browser User-Agent, cookies or login. Result links (`/goto?...`) are never followed; only the plain landing page URL (`data-lpage`) and the image title (`alt`) of each result are read.

### Input

```json
{
    "query": "Barcelona",
    "resultSource": "images",
    "maxItems": 50,
    "googleCountry": "gb"
}
```

| Field | Description |
|-------|-------------|
| `query` | Words added to the Google query `site:booking.com/hotel <words>`: a city, a district, a landmark or a hotel name. Use short words; every extra word narrows the results. |
| `startUrls` | Optional Booking.com search page URLs such as `https://www.booking.com/searchresults.html?ss=Barcelona`. **They are never requested**: only the destination words (the `ss=` value, or the name in a `/city/<cc>/<name>.html`, `/region/...`, `/district/...` or `/landmark/...` URL) are added to the Google query. Dates, guests, filters and every other part of the URL are ignored. URLs of single hotel pages are not looked up. |
| `resultSource` | `images` (default) or `web`, see above. |
| `maxItems` | Maximum distinct hotels across all searches (default 50, maximum 1000). One Google Images page shows a limited number of results (see "Limits"), so a run returns fewer than the maximum unless you give several searches. |
| `maxPages` | Web results only: Google result pages per search, 10 results each (default 3); every page is billed by the `GOOGLE_SERP` proxy as one search. Images are read with one request per search. |
| `googleCountry` | Two-letter country code for Google's `gl` parameter (default `gb`); it changes the ranking only slightly. |
| `targetInput` | Legacy nested input of earlier versions. Only the destination (`search`, `destination`), `startUrls`/`searchUrls` and `maxItems`/`maxResults` are used. |

With several searches (`query` plus start URLs) every distinct destination is one Google request, and a hotel found twice is returned once.

Fields of the earlier page-crawling versions (`endUrls`, `maxRequestRetries`, `requestTimeoutSecs`, `crawlDetails`, `maxDetailPages`, `detailConcurrency`, `browserFallback`, `proxyEnabled`, and the dates, guests, currency, language, property type, stars, score, price, sort, review and photo options inside `targetInput`) are still accepted so that old tasks do not break. They have no effect, and the run log lists the ones that were given.

### Output

```json
{
    "hotelId": "es/w-barcelona",
    "countryCode": "ES",
    "name": "W Barcelona",
    "city": "Barcelona",
    "url": "https://www.booking.com/hotel/es/w-barcelona.html",
    "pageTitle": "W Barcelona, Barcelona (updated prices 2027)",
    "sourceUrl": "https://www.booking.com/hotel/es/w-barcelona.en-gb.html",
    "dataOrigin": "google-serp-images",
    "serpQuery": "site:booking.com/hotel Barcelona",
    "serpPosition": 1,
    "scrapedAt": "2026-11-14T11:59:08.486Z"
}
```

- `url`, `hotelId` and `countryCode` come from the hotel page URL `https://www.booking.com/hotel/<cc>/<name>[.<language>].html`. `url` is the canonical form without language suffix and query; `hotelId` is `<cc>/<name>`. Only URLs of that form are kept; city pages, review pages and everything else are dropped. The same hotel found under several language variants of its URL is returned once. Booking.com's numeric hotel ID is not shown by Google and is not returned. Booking.com uses the same `/hotel/` path for apartments, hostels and guest houses, so such rows appear too.
- `name` and `city` come from the page title in the form `<hotel name>, <city> (updated prices <year>)`: the city is what follows the last comma. The part in brackets is Booking.com's own title text, **it is not a price** and is not returned. A title without that shape is returned whole as `name` and has no `city`. A star class that is part of a hotel's name (for example `Gran Hotel Barcino 4 Sup`) stays in the name and is not read as a rating.
- `pageTitle` is the title exactly as Google shows it, so you can see what `name` and `city` were read from. `titleTruncated` is `true` when Google shortened a title.
- `summary` (**web results only**) is the short text Google shows for the page; it is not the hotel description.
- `sourceUrl` is the exact URL Google printed (often with `.en-gb.html`). `serpPosition` is the position among the distinct landing pages of the Google page.
- A missing field is absent, never guessed. `RUN_SUMMARY` in the key-value store records the Google queries, the number of Google requests (`googleRequests`), the results read, how many were not hotel pages or duplicates, how many searches Google answered without image results (`imagePagesWithoutResults`) and, for web results, how many results had no readable URL (`opaqueLinks`).

### Measured results (2026-11-14)

First runs of this actor on the Apify platform (build 0.1.6, default settings except `maxItems` 100), one Google Images request per search:

| Query sent to Google | Image results on the page | Distinct hotel pages | Distinct hotels (language variants merged) |
|----------------------|---------------------------|----------------------|---------------------------------------------|
| `site:booking.com/hotel Barcelona` | 50 | 41 | 37 |
| `site:booking.com/hotel Lisbon` | 50 | 41 | 40 |
| `site:booking.com/hotel Tokyo` | 100 | 63 | 58 |

Every image title had the `<name>, <city> (updated prices 2027)` shape, and no result was a page other than a hotel page. One of the three requests took longer than 45 seconds and was asked a second time (the only repeat the actor makes), which is why one run shows two Google requests. The pages change from request to request: a later `Barcelona` search returned 100 image results with 65 distinct hotel pages.

The web source (`resultSource: "web"`) was tried once, for `site:booking.com/hotel Rome` with one page: Google returned 10 results, all with opaque redirect links and no readable URL, so the run found no hotel and failed with a message that says so. Use the images source.

### Limits

- Results are the hotel pages that Google has indexed and ranks for your words, in Google's order. Hotels that Google does not return are not found, and a hotel whose *name* contains your words can be located elsewhere (the search `Tokyo` returned `Hotel Tokyo Palace` in Jaisalmer, India; use `city` and `countryCode` to filter). There is no way to ask for "all hotels in a city".
- One Google Images page shows at most about 100 image results, which contain about 40 to 65 distinct hotel pages. The actor reads **one page per search**: the start offset does not page through image results reliably. For more hotels give more searches (for example `Barcelona`, `Barcelona hostel`, `Barcelona apartment`, `Barcelona Eixample`).
- The title text can be older than the live page, and hotels may no longer be bookable. Nothing about availability or price is known.
- Google sometimes answers an image request with its web layout and no image results. The actor then reads nothing from that search, does not request the page again, and fails the run with a message that says so if nothing else was found. An image request that takes longer than 45 seconds counts as a timeout and is asked once more; that is the only repeat. If Google answers with a CAPTCHA or unusual-traffic page, or with an HTTP error status, the run stops with an error.
- The web source loses the results for which Google printed only an opaque redirect link; its number of rows changes from run to run and can be zero.

### Proxy and billing

The actor uses only the Apify `GOOGLE_SERP` proxy group (billed per search page; your account needs access to it). Each search is one request (plus the single retry after a timeout). The actor's own charge is per dataset row, as set on its pricing page.

### Tests

`npm test` runs the unit tests (`node --test`). They use result elements copied from real Google Images pages, a fake proxy on localhost and fakes of the Apify SDK, and send no request to Google or Booking.com.

# Changelog

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

# Actor input Schema

## `query` (type: `string`):

Words added to the Google query `site:booking.com/hotel <words>`, for example a city (`Barcelona`), a district or a hotel name. Google ranks the Booking.com hotel pages for these words; use short words, because every extra word narrows the results.

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

Optional Booking.com search page URLs such as `https://www.booking.com/searchresults.html?ss=Barcelona`. The URLs are never requested: only the destination words (the `ss=` value, or the name in a `/city/<cc>/<name>.html` URL) are added to the Google query. Every other part of the URL (dates, guests, filters) is ignored.

## `resultSource` (type: `string`):

Images (default): one Google Images result page per search; every image result gives the hotel page URL and the title of that page. Web: Google web results, which also give a short result text; Google often prints only opaque redirect links instead of the result URLs, which the actor never follows, so many results (sometimes all) are lost.

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

Maximum number of distinct hotel pages across all searches. One Google Images page shows a limited number of results, so a run can return fewer.

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

Only for the Google web results source: Google result pages to read per search (10 results each; each page is billed as one search by the GOOGLE_SERP proxy). Google Images results are read with one request per search.

## `googleCountry` (type: `string`):

Two-letter country code passed to Google (the gl parameter). It changes the ranking only slightly, because the results are limited to booking.com hotel pages.

## `targetInput` (type: `object`):

Optional input of earlier versions. Only the destination (`search`, `destination`), `startUrls`/`searchUrls` and `maxItems`/`maxResults` are used; dates, guests, currency, filters and every other field are accepted and ignored (and listed in the run log).

## Actor input object example

```json
{
  "query": "Amsterdam",
  "startUrls": [],
  "resultSource": "images",
  "maxItems": 50,
  "maxPages": 3,
  "googleCountry": "gb"
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "query": "Amsterdam"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/booking-com-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 = { "query": "Amsterdam" }

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/booking-com-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 '{
  "query": "Amsterdam"
}' |
apify call scrapeai/booking-com-scraper --silent --output-dataset

```

## MCP server setup

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