Purpose
Find available Booking.com properties and prices for a supplied search query, date range, guest composition, and optional currency, returning structured hotel-card details suitable for comparison.
When to Use
Use when the caller needs Booking.com availability or prices for {property-query} or {destination}, {checkin}, {checkout}, {adults}, {children}, and the children's ages. Run separate searches when comparing distinct property-name queries such as multiple hotel brands, then combine the extracted results.
Workflow
- Construct the direct Booking.com results URL; do not visit the homepage or type into the search form:
https://www.booking.com/searchresults.html?ss={url-encoded-query}&checkin={YYYY-MM-DD}&checkout={YYYY-MM-DD}&group_adults={adults}&group_children={children}&age={child-age-1}&age={child-age-2}&no_rooms={rooms}Repeatage=once for every child. Omit the age parameters only when{children}=0. - Optionally append
&selected_currency={ISO-4217-code}when the caller requests a display currency; otherwise retain Booking.com's default currency. - In the same browser-agent call,
gotothe constructed URL withwaitUntil: domcontentloaded, then run thisevaluate()on the loaded results page:
(() => {
const clean = (s) => (s || "").replace(/\s+/g, " ").trim();
const kitchenPattern = /kitchen|kitchenette|küche|kochnische|cocina|cuisine/i;
const cards = [...document.querySelectorAll('[data-testid="property-card"]')];
return cards
.map((card) => {
const link = card.querySelector(
'a[data-testid="title-link"], h3 a, a[href*="/hotel/"]',
);
const text = clean(card.textContent);
const price = clean(
card.querySelector(
'[data-testid="price-and-discounted-price"], [data-testid="price-for-x-nights"], span[class*="price"]',
)?.textContent,
);
const room = clean(
card.querySelector(
'[data-testid="property-card-unit-configuration"], [data-testid="unit-configuration"]',
)?.textContent,
);
const address = clean(
card.querySelector('[data-testid="address"]')?.textContent,
);
const score = clean(
card.querySelector('[data-testid="review-score"]')?.textContent,
);
return {
name: clean(card.querySelector('[data-testid="title"], h3')?.textContent),
url: link?.href || null,
price: price || null,
roomDetails: room || null,
address: address || null,
reviewScore: score || null,
mentionsKitchen: kitchenPattern.test(text),
};
})
.filter((x) => x.name || x.price);
})();- If a kitchen requirement is specified, use
mentionsKitchenandroomDetailsas an initial screen, and report that Booking.com availability must be verified at the room level; do not assume every room in a kitchen-equipped property includes a kitchen. - If pagination is present, repeat the same extraction after navigating through the results pages and concatenate results, deduplicating by
url. If no cards load, inspect the returned page for a consent, sign-in, bot-check, or error overlay and retry only after dismissing a blocking overlay.
Site-Specific Gotchas
- The reusable search endpoint is
/searchresults.html; the important parameters aress,checkin,checkout,group_adults, repeatedage,group_children, andno_rooms. - Child ages are material to Booking.com pricing and must be supplied individually with repeated
ageparameters. selected_currency={code}changes displayed currency but may be absent from the default URL.- Booking.com can redirect to an index/error page or show a sign-in/consent overlay; that is a session or anti-automation response, not evidence that the property has no availability.
- A transient sign-in information overlay may be dismissible with
button[aria-label="Dismiss sign-in info."]before continuing; this is optional and only needed when it blocks interaction. - The result-card selectors use Booking's
data-testidattributes and are more reliable than visual text. Price and room-detail markup can vary, so null values are valid. - A hotel-name search may return similarly named properties or nearby locations; validate the extracted address and property URL before comparing prices.
Expected Output
Return a list of objects with name, url, price, roomDetails, address, reviewScore, and mentionsKitchen. Preserve the requested dates, occupancy, child ages, currency, and search query alongside the list when presenting results.