# Booking.com All-Year Multi-Area Hotel Data Scraper (`moving_beacon-owner1/my-actor-25`) Actor

A Python-based scraper that automatically collects hotel listings from Booking.com across multiple cities and every month of the year, capturing data such as price, rating, and availability for travel and market analysis

- **URL**: https://apify.com/moving_beacon-owner1/my-actor-25.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** Real estate, Developer tools, Travel
- **Stats:** 44 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 4.00 out of 5 stars

## Pricing

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

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 Hotel Scraper

### Overview

This Python script scrapes hotel data from Booking.com for specified dates and locations. It extracts key information including hotel names, prices, ratings, and availability.

### Features

- 🏨 Scrapes hotel listings with detailed information
- 📅 Supports flexible date ranges
- 🛡️ Implements anti-bot bypass techniques
- 📊 Outputs structured data in JSON format
- ⚡ Asynchronous implementation for better performance

### Configuration

The script accepts the following input parameters:

```json
{
  "startUrls": [{
    "url": "https://www.booking.com/searchresults.html?dest_id=1234&dest_type=district"
  }],
  "start_date": "2025-05-01",
  "days": 3
}
```

### Data Fields Collected

| Field | Description |
|-------|-------------|
| `check_in` | Check-in date |
| `check_out` | Check-out date |
| `name` | Hotel name |
| `price` | Room price |
| `rating` | Guest rating |
| `timestamp` | When data was scraped |

### Usage

1. Configure your input parameters in the Apify platform or local environment
2. Run the script:

```bash
python main.py
```

### Output

The script outputs data in JSON format with the following structure:

```json
[
  {
    "check_in": "2025-05-15",
    "check_out": "2025-05-16",
    "name": "Example Hotel",
    "price": "€120",
    "rating": "8.5",
    "timestamp": "2025-05-04T12:34:56.789Z"
  }
]
```

# Actor input Schema

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

One or more Booking.com search URLs to crawl. The date range is applied to each URL in turn. Any filters / destination params encoded in the URL are preserved — only check-in, check-out, and currency are overridden by this Actor.

## `start_date` (type: `string`):

First check-in date (YYYY-MM-DD). If left empty, today's date is used.

## `days` (type: `integer`):

How many consecutive check-in dates to scrape, starting from Start Date. Each date × each URL is one Booking.com page request, so large values multiply the run time.

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

Currency for displayed hotel prices. Overrides any selected_currency value in your URLs.

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

Apify Proxy configuration. Residential proxies are strongly recommended for Booking.com — datacentre IPs are blocked aggressively. If the chosen config fails at startup, the Actor automatically falls back to RESIDENTIAL → auto group → direct connection. Each retry rotates IP.

## `timeout` (type: `integer`):

Playwright navigation timeout per page, in milliseconds.

## `retries` (type: `integer`):

How many times to retry a single date if blocked / timed out / parsed 0 hotels. Each retry launches a fresh browser with a new proxy IP.

## `delayMin` (type: `integer`):

Lower bound of the random pause between consecutive date requests.

## `delayMax` (type: `integer`):

Upper bound of the random pause between consecutive date requests. Must be ≥ Min Delay.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.booking.com/searchresults.html?ss=London&ssne=London&ssne_untouched=London&efdco=1&label=gen173nr-10CAQoggJCDXNlYXJjaF9sb25kb25IM1gEaLUBiAEBmAEzuAEZyAEM2AED6AEB-AEBiAIBqAIBuAK2ztvQBsACAdICJDM4N2FiODAzLWVkMjEtNDg1MS1hODZiLThiYmUyMTIwY2FkMtgCAeACAQ&aid=304142&lang=en-us&sb=1&src_elem=sb&src=searchresults&dest_id=-2601889&dest_type=city&checkin=2026-06-09&checkout=2026-06-10&group_adults=2&no_rooms=1&group_children=0"
    }
  ],
  "days": 3,
  "currency": "USD",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "timeout": 60000,
  "retries": 5,
  "delayMin": 2,
  "delayMax": 5
}
```

# 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.booking.com/searchresults.html?ss=London&ssne=London&ssne_untouched=London&efdco=1&label=gen173nr-10CAQoggJCDXNlYXJjaF9sb25kb25IM1gEaLUBiAEBmAEzuAEZyAEM2AED6AEB-AEBiAIBqAIBuAK2ztvQBsACAdICJDM4N2FiODAzLWVkMjEtNDg1MS1hODZiLThiYmUyMTIwY2FkMtgCAeACAQ&aid=304142&lang=en-us&sb=1&src_elem=sb&src=searchresults&dest_id=-2601889&dest_type=city&checkin=2026-06-09&checkout=2026-06-10&group_adults=2&no_rooms=1&group_children=0"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("moving_beacon-owner1/my-actor-25").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.booking.com/searchresults.html?ss=London&ssne=London&ssne_untouched=London&efdco=1&label=gen173nr-10CAQoggJCDXNlYXJjaF9sb25kb25IM1gEaLUBiAEBmAEzuAEZyAEM2AED6AEB-AEBiAIBqAIBuAK2ztvQBsACAdICJDM4N2FiODAzLWVkMjEtNDg1MS1hODZiLThiYmUyMTIwY2FkMtgCAeACAQ&aid=304142&lang=en-us&sb=1&src_elem=sb&src=searchresults&dest_id=-2601889&dest_type=city&checkin=2026-06-09&checkout=2026-06-10&group_adults=2&no_rooms=1&group_children=0" }] }

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/my-actor-25").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 '{
  "startUrls": [
    {
      "url": "https://www.booking.com/searchresults.html?ss=London&ssne=London&ssne_untouched=London&efdco=1&label=gen173nr-10CAQoggJCDXNlYXJjaF9sb25kb25IM1gEaLUBiAEBmAEzuAEZyAEM2AED6AEB-AEBiAIBqAIBuAK2ztvQBsACAdICJDM4N2FiODAzLWVkMjEtNDg1MS1hODZiLThiYmUyMTIwY2FkMtgCAeACAQ&aid=304142&lang=en-us&sb=1&src_elem=sb&src=searchresults&dest_id=-2601889&dest_type=city&checkin=2026-06-09&checkout=2026-06-10&group_adults=2&no_rooms=1&group_children=0"
    }
  ]
}' |
apify call moving_beacon-owner1/my-actor-25 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moving_beacon-owner1/my-actor-25"
        }
    }
}
```

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/hbRnvccDbf3aFhlJE/builds/ou1untj6qLwilTGhg/openapi.json
