Playground Sign in Start free
← All posts

Scrape Booking.com Without Getting Blocked: What Actually Works

If you want to scrape Booking.com without getting blocked, two parameters fix most failures: js=true and wait_for=15000. You switched proxies and still got a bot-check page. That is because the block fires at the JavaScript execution layer, before IP reputation enters the picture. A request that never runs JavaScript looks nothing like a real browser session, and Booking.com's protection scripts know it within milliseconds.

We verified those two parameters across 21 automated health checks over 7 days: every check returned hotel content, not a challenge page. By the end of this post you will know why those parameters matter, what fails without them, and how a single recipe call returns structured JSON for listing pages, hotel detail pages and search results without writing a single CSS selector.

Does Booking.com Block Scrapers?

Yes, and it does so aggressively. A plain HTTP request with no JavaScript rendering returns a bot-check interstitial on almost every attempt. The failure is not primarily about IP reputation. It is about JavaScript execution: Booking.com's front-end loads protection scripts that must run and resolve before the page serves real content. A raw HTML fetch never triggers those scripts, so it never passes the check.

Booking.com's robots.txt disallows a range of paths, primarily internal API and fragment endpoints. The public HTML pages, city listing pages, hotel detail pages and search result pages, are the practical scraping surface. Whether scraping those pages is permitted under Booking.com's terms of service is a separate question; automated access is restricted by their terms, and the legal picture varies by jurisdiction and use case. The post Is Web Scraping Legal? covers the relevant frameworks in detail.

The practical point: if you are hitting a bot-check page, the fix is almost never "add a better proxy first." It is "turn on JavaScript rendering first."

What Booking.com's Bot Detection Actually Checks

Booking.com's protection stack operates across three distinct layers, and most scrapers fail at the first one.

Layer 1, JavaScript fingerprinting. When a browser loads a Booking.com page, protection scripts interrogate the browser environment: navigator properties, timing of DOM events, rendering behaviour. Chrome's headless mode documentation notes that protection scripts interrogate browser environment signals to distinguish automated from human sessions, and those scripts need time to execute and resolve before the page is considered legitimate. This is why the wait matters: it is not just about waiting for content to load. It is about giving the fingerprint scripts enough time to run, collect their signals and pass the check.

Layer 2, Session and timing behaviour. A real user takes several seconds to load a page, scroll and navigate. A scraper that fires requests in rapid succession with near-zero wait produces a timing signature that session-analysis systems catch. The OWASP Automated Threats to Web Applications project documents how automated traffic patterns differ from human sessions, and timing is among the signals used to distinguish them. Irregular, human-paced timing is harder to classify as a bot.

Layer 3, IP reputation. Datacenter IP ranges are classified by ASN databases as non-residential. Booking.com's protection layer scores incoming IPs, and a known datacenter range combined with no JavaScript rendering is the easiest possible block. IP reputation matters, but it is the third lock, not the first. Fix the JavaScript layer before worrying about the proxy tier.

Think of it as a sequential filter: fix layer one and layers two and three rarely matter.

Try it yourself

Run this on your own pages

Get a free API key and make your first call in minutes. 5,000 free credits for 21 days, no card.

What Fails: Common Settings and Why They Get Blocked

Here is what the failure modes look like in practice, specific to Booking.com.

Plain HTTP with no JavaScript rendering (js=false). The page returns a bot-check interstitial. Booking.com's front-end requires JavaScript to resolve the initial challenge before serving hotel content. A raw HTML fetch never sees the real page. This is the single most common mistake, and it is the one that sending a residential proxy will not fix.

js=true with wait_for=0 or a very short wait. Even with JavaScript rendering enabled, a near-zero wait fires the fingerprint scripts before they finish. The result is an incomplete fingerprint that the detection layer scores as suspicious. The content may partially load, but the structured data is missing or the page is a challenge variant.

Mismatched or static user-agent strings. Setting a custom useragent that does not match the browser version Chromium reports internally creates a detectable inconsistency. More broadly, sending the same user-agent string on every request lets Booking.com fingerprint a single browser identity across your entire session. Rotating user agents, or letting the API manage them, prevents the site from building a consistent profile of your scraper. Letting the API manage the user-agent is safer than overriding it manually.

Rapid request bursts without delays. Booking.com's session analysis flags burst patterns. Even with the right proxy and JavaScript settings, firing many requests per second from the same session triggers rate-limiting. Adding delays between requests mimics the pacing of a real user and keeps your timing profile within the range of normal human browsing. This is not optional at scale: omitting delays will trigger session-based rate-limiting regardless of your proxy tier.

Rotating proxies without distributing across IPs. A rotating proxy pool works like a call centre rotating its outgoing lines: each request goes out on a different IP, so no single address accumulates enough requests to trip a rate limit. Without rotation, even a residential IP will eventually be flagged if it sends too many requests in a short window. The default rotating proxy in the Scrape API distributes requests across IPs automatically.

Setting combination Typical result Why it fails
js=false, any proxy Bot-check page JS fingerprint scripts never run
js=true, wait_for=0, datacenter Bot-check or empty content Scripts start but do not finish
js=true, wait_for=15000, default rotating Passes (100% in our health checks) Scripts run and resolve fully
js=true, wait_for=15000, higher proxy tier Expected to pass at high volume Residential-grade IPs for scale; not tested in our health checks

Cloudflare is one possible protection layer on some Booking.com subdomains and partner pages. A Cloudflare challenge page served with HTTP 200 is treated as a failed request and not billed, so your credit balance is not consumed by challenge pages you cannot use.

Takeaway: Before upgrading to a higher proxy tier, confirm js=true and wait_for=15000 are set. In our health checks, those two parameters on the default rotating proxy passed at every attempt.

How to Scrape Booking.com Without Getting Blocked: The Exact Settings

Over 7 days, 21 automated health checks ran against Booking.com listing, detail and search pages. Every check passed with the following configuration: js=true, wait_for=15000, proxy_type=rotating (the default), proxy_country=US. That is a 100% pass rate across 21 checks, no bot-check pages, no empty responses.

The wait_for value of 15000 milliseconds (15 seconds) is the critical variable. Our health checks confirm that 15 seconds is sufficient for Booking.com's protection scripts to run and resolve. Lower values risk an incomplete fingerprint; 15 seconds gives the page's own JavaScript time to settle before the API returns the content.

Parameter Value Why
js true Runs Booking.com's fingerprint and content scripts
wait_for 15000 Gives scripts 15 s to resolve before the API returns the page
proxy_type rotating Default; passes at normal request volumes
proxy_country US Matches the target market for consistent results
block_resources true Default; blocks images and fonts, speeds up load without affecting content
auto_captcha_solve true Attempts to solve reCAPTCHA or hCaptcha if Booking.com presents one

When to step up to a higher proxy tier: the default rotating proxy handles normal volumes well. If you are running high-volume parallel requests and see a rising block rate, a premium proxy adds residential-grade IP rotation. A JavaScript-rendered call on the default proxy costs 5 credits; the same call on a premium proxy costs 25 credits. Confirm you need the upgrade before switching: the cost difference is 5x. See the Scrape API page for the full credit breakdown.

Takeaway: Start with js=true and wait_for=15000 on the default rotating proxy. Our health check data shows this combination passes Booking.com's detection reliably. Upgrade the proxy tier only if you see block rates rising at high volume.

How to Scrape Booking.com with a Recipe

A recipe call applies Ujeebu's validated extraction logic for a specific site and returns named fields as JSON. For Booking.com, three recipes are available via the Scrape API.

recipe=booking/listing takes a Booking.com city or destination URL and returns a list of hotels with structured fields: name, price, rating, review count, location and availability for the dates in the URL. Useful for price monitoring across cities and availability dashboards.

recipe=booking/detail takes a hotel page URL and returns the property's structured data: name, address, star rating, review score, amenities, room types with prices, and images. Useful for property data enrichment and amenity comparison pipelines.

recipe=booking/search accepts city and country parameters instead of a URL. The recipe builds the Booking.com search URL, runs it, and returns the same listing fields plus the URL it constructed. Useful when you do not have a pre-built Booking.com URL and want to search programmatically across multiple destinations.

One practical advantage of recipe calls over custom extract_rules: when Booking.com updates its page structure, the recipe is updated server-side, so your extraction logic does not need to change. If you write your own CSS selectors or XPaths against Booking.com's HTML, a page redesign will silently break them, returning empty fields or wrong values with no error. The recipe absorbs that maintenance cost. For a deeper look at when recipes save time versus custom selectors, see Build or Buy Scraping Recipes.

A Booking.com recipe call uses JavaScript rendering, which costs 5 credits on the default proxy. If every retry path returns a bot-check page, the request fails and you are not charged. Failed and blocked requests do not consume credits.

See the Booking.com recipe page for the full field list and sample responses, and the recipes catalogue for every supported site.

Takeaway: Use a recipe call rather than raw extract_rules for Booking.com. The recipe handles the JS timing and field mapping that would otherwise take several iterations to get right, and it stays current when Booking.com updates its page structure.

Python Code: Scrape Booking.com Listing, Detail and Search

Here is a quick curl test to confirm your API key and the listing recipe are working before running the full script:

curl -X GET \
  'https://api.ujeebu.com/scrape?url=https://www.booking.com/city/us/new-york.html&recipe=booking/listing&js=true&wait_for=15000' \
  -H "ApiKey: YOUR_API_KEY"

And the full Python script covering all three recipe types:

import requests
import time

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.ujeebu.com/scrape"
HEADERS = {"ApiKey": API_KEY}

# 1. City listing page
listing_resp = requests.get(
    BASE_URL,
    headers=HEADERS,
    params={
        "url": "https://www.booking.com/city/us/new-york.html",
        "recipe": "booking/listing",
        "js": "true",
        "wait_for": "15000",
        # "auto_captcha_solve": "true",  # uncomment if you see CAPTCHA challenges
    },
)
print("Listing credits used:", listing_resp.headers.get("Ujb-Credits"))
print("Listing result:", listing_resp.json())

# Pause between requests to avoid triggering session-based rate-limiting
time.sleep(3)

# 2. Hotel detail page
detail_resp = requests.get(
    BASE_URL,
    headers=HEADERS,
    params={
        "url": "https://www.booking.com/hotel/us/doubletree-by-hilton-new-york-times-square-west.html",
        "recipe": "booking/detail",
        "js": "true",
        "wait_for": "15000",
        # "auto_captcha_solve": "true",
    },
)
print("Detail credits used:", detail_resp.headers.get("Ujb-Credits"))
print("Detail result:", detail_resp.json())

time.sleep(3)

# 3. Search without a pre-built URL
# city and country are recipe-specific parameters for booking/search
search_resp = requests.get(
    BASE_URL,
    headers=HEADERS,
    params={
        "recipe": "booking/search",
        "city": "New York",
        "country": "us",
        "js": "true",
        "wait_for": "15000",
        # "auto_captcha_solve": "true",
    },
)
print("Search credits used:", search_resp.headers.get("Ujb-Credits"))
print("Search result:", search_resp.json())

A few notes on the script:

The time.sleep(3) calls between requests are not decorative. Booking.com's session analysis flags burst patterns, so spacing requests by a few seconds keeps your timing profile within the range of normal human browsing. For high-volume pipelines, increase the delay or distribute requests across sessions using proxy_session to avoid concentrating load on a single IP.

The city and country parameters in the booking/search call are recipe-specific: they tell the recipe which search URL to construct. They are not standard /scrape parameters, so you will not find them in the general API reference.

The Ujb-Credits response header tells you how many credits each call consumed. Logging it per request lets you track spend across a pipeline and catch unexpectedly expensive calls before they drain your balance.

Takeaway: Run the curl example first. If it returns JSON with hotel fields, your key and recipe are working. Then integrate the Python script and uncomment auto_captcha_solve=true if you start seeing challenge responses.

Handling Blocks Gracefully

When Booking.com pushes back, the API handles the immediate response so your pipeline does not silently ingest challenge pages as data.

Failed requests, including those where Booking.com returns a challenge page instead of content, are not billed. Check the response body for hotel data fields rather than assuming a 200 status means success. A response that contains a challenge page rather than structured hotel data is a signal to inspect the request configuration, not to retry immediately.

auto_captcha_solve=true instructs the API to attempt to solve reCAPTCHA or hCaptcha challenges if Booking.com presents one. Add it to any request where you want automatic challenge handling. The CAPTCHA solver page has the full details.

For your orchestration layer: a URL that returns multiple consecutive errors is a signal to pause and inspect the response body before retrying, not to retry immediately. Handle HTTP 403 and 429 responses with backoff logic, and treat a pattern of failures on the same URL as a configuration signal rather than a transient network issue.

Fields You Get Back and What to Do with Them

The recipe returns named fields as structured JSON, so you can plan your data schema before writing a line of pipeline code. The Booking.com recipe page lists the exact fields and a sample response for each recipe type.

For booking/listing, the fields cover the hotel name, URL, price, currency, rating, review count, location and availability. For booking/detail, you get the property's full profile: name, address, star rating, review score, amenities, room types with prices and cancellation policies, and images. For booking/search, you get the same listing fields plus the Booking.com search URL the recipe constructed, useful as input to a second round of detail calls.

The two-step pattern works well for building a rich dataset: run booking/search across a list of cities to collect hotel URLs, then run booking/detail on each URL to get the full property record. Each step is one API call per page, and the recipe handles the extraction on both sides.


Start with the free trial at https://ujeebu.com/signup: 5,000 credits, no credit card required. With JavaScript-rendered calls costing 5 credits each on the default proxy, you can run hundreds of recipe calls to validate your pipeline before committing to a plan.


FAQ

How do I avoid getting blocked while scraping Booking.com?

Enable JavaScript rendering (js=true) and set wait_for=15000. These two parameters give Booking.com's fingerprint scripts time to run and resolve, which is the primary check most scrapers fail. Add delays between requests in any loop to avoid triggering session-based rate-limiting, and let the API manage user-agent strings rather than setting a static one. If you see persistent blocks at high volume, switch to a higher proxy tier for residential-grade IP rotation.

Can web scraping be detected?

Yes. Sites use multiple signals to identify automated traffic: JavaScript fingerprinting (navigator properties, rendering behaviour), request timing patterns, IP reputation and session behaviour. A headless browser with default settings leaks several detectable signals. Modern scraping APIs patch the most obvious ones and add realistic timing, but detection is an ongoing arms race. See Mastering Web Scraping Proxies for a deeper look at the IP reputation side.

Is it illegal to scrape data from a website?

It depends on the jurisdiction, the data involved and how you use it. Scraping publicly visible data sits in a legal grey area in most countries. Booking.com's terms of service restrict automated access. The post Is Web Scraping Legal? covers the relevant legal frameworks and the cases that have shaped current practice.

What proxy type do I need to scrape Booking.com without getting blocked?

The default rotating proxy (proxy_type=rotating) passes Booking.com's detection reliably at normal volumes when combined with js=true and wait_for=15000. Our health checks show a 100% pass rate with this configuration across 21 checks over 7 days. Step up to a higher proxy tier only if you see a rising block rate at high-volume parallel requests. A premium proxy with JavaScript rendering costs 25 credits per call versus 5 for the default, a 5x difference worth confirming you need before switching.

Does the Booking.com recipe handle JavaScript rendering automatically?

The recipe applies its validated settings when called, but passing js=true and wait_for=15000 explicitly in your request is recommended for transparency and to ensure the settings are applied as expected. The code examples in this post include both parameters explicitly for that reason.

Can ChatGPT do web scraping?

Not directly. ChatGPT does not fetch live web pages on its own. For extracting structured data from specific Booking.com pages, the Scrape API with a recipe call is the right approach: it fetches the live page, handles bot detection and returns named fields as JSON in one request.

Try it yourself

Run this on your own pages

Get a free API key and make your first call in minutes. 5,000 free credits for 21 days, no card.

← Back to blog Read the docs →