TL;DR
- This guide shows how to collect Booking.com hotel data with Python’s
requestslibrary and Scrapingdog’s APIs. Both examples return structured JSON. - Use the Booking.com Search API to find hotels by destination, travel dates, and guest count. Get prices, ratings, and availability.
- Use the Booking.com Place API to look up a specific hotel by URL. Get room types, amenities, and booking offers with prices, taxes, and cancellation terms.
- Both examples include Python code and sample responses you can use to build a hotel price tracker or comparison tool.
Booking.com hosts over 28 million listings across hotels, apartments, and vacation rentals, making it one of the richest sources of travel pricing data on the internet. Whether you’re building a price monitoring tool, training an ML model on hospitality data, or tracking competitor rates across cities, scraping Booking.com is the fastest way to get that data at scale.
In this guide, you’ll learn how to scrape Booking.com using Python, the Booking.com Place API, and the Booking.com Search API.
Why Scrape Booking.com?
Booking.com has millions of property listings worldwide, making it a valuable source of travel and hotel data. Here are some common use cases:
Price Monitoring: Track hotel price changes and adjust your pricing based on demand and competition.
Price Comparison: Build travel comparison tools that help users find the best hotel deals.
Market Research: Analyze pricing trends, room availability, and popular travel destinations.
Machine Learning: Use hotel data to train dynamic pricing models, forecast demand, and build recommendation systems.
Setting Up Your Python Environment
We need Python 3.x for this tutorial, and I am assuming that you have already installed it on your computer; if not, then you can download it from here.
Sign up for the trial pack of Scrapingdog and install the requests library for making HTTP connections with the Scrapingdog APIs.
Now, first create a folder and then install the requests library.
1mkdir booking2pip install requestsHow to Scrape Booking.com Search Results with Python
For this tutorial, we are going to collect data for London.
1import requests2 3url = "https://api.scrapingdog.com/booking/search"4 5params = {6 "api_key": "your_api_key",7 "query": "london",8 "check_in_date": "2026-11-27",9 "check_out_date": "2026-11-28",10 "adults": "2",11 "rooms": "1",12 "sort_by": "popularity",13 "offset": "0",14 "free_cancellation": "false"15}16 17response = requests.get(url, params=params)18 19if response.status_code == 200:20 data = response.json()21 print(data)22else:23 print(f"Request failed with status code: {response.status_code}")This Python script uses Scrapingdog’s Booking.com Search API to extract hotel search results.
Import requests: Imports the
requestslibrary to make HTTP requests.Define API URL: Specifies the API endpoint for scraping Booking.com search results.
Set parameters: Defines the search requirements, including the destination (London), check-in and check-out dates, number of adults, and rooms. It also sorts hotels by popularity, starts from the first page (
offset=0), and does not apply the free cancellation filter.Send GET request: Uses
requests.get()to send the request to the API along with the defined parameters.Handle response: If the API returns a
200status code, the script converts the response into JSON and prints the extracted hotel data. Otherwise, it prints an error message with the HTTP status code.
Make sure to replace your_api_key with your actual Scrapingdog API key before running the script.
1{2 "position": 3,3 "property_id": 4123895,4 "name": "The Pack And Carriage London",5 "link": "https://www.booking.com/hotel/gb/the-pack-and-carriage-london.html?group_adults=2&no_rooms=1&group_children=0&checkin=2026-11-27&checkout=2026-11-28&order=popularity",6 "type": "Hotel",7 "hotel_class": 3,8 "preferred_partner": true,9 "location": "Camden, London",10 "address": "162 Eversholt Street Euston",11 "distance": "1.7 miles from downtown",12 "public_transport": "Mornington Crescent station is within 400 yards",13 "gps_coordinates": {The JSON response contains structured property data extracted from Booking.com using Scrapingdog’s Booking.com Search API. The API returned 29 properties out of 1,852 available results in just 1.19 seconds.
Here is a breakdown of the response:
search_metadata: Contains the request status, Booking.com search URL, and response time.search_parameters: Includes the destination, check-in and check-out dates, number of guests, rooms, sorting options, and filters.search_information: Provides the destination name, destination ID, type, and total available results.scrapingdog_pagination: Contains the current and next API URLs to retrieve additional search results.properties: Contains detailed information about each property, including:Property name, ID, type, and star classification.
Address, GPS coordinates, and nearby public transport.
Guest ratings and review counts.
Current price, original price, taxes, and fees.
Room types, room IDs, and bed configurations.
Available deals and discounts.
Cancellation policies, prepayment requirements, and availability.
Property images and sustainability certifications.
Sponsored and featured listing status.
The structured JSON response makes it easy for developers to build hotel price comparison tools, track competitor pricing, monitor property availability, and conduct travel market research.
Scraping Hotel Data from Booking.com
Here we will use Scrapingdog's Booking.com Places API. This API will help us collect individual hotel data listed on Booking.com. Using this API, you can collect data on all the rooms available in a hotel, pricing of the rooms, address, reviews, ratings, etc.
We will pull live prices, ratings, and other data for The July Hotel.
1import requests2 3url = "https://api.scrapingdog.com/booking/place"4 5params = {6 "api_key": "your_api_key",7 "url": "https://www.booking.com/hotel/gb/the-july-london-victoria.html",8 "check_in_date": "2026-11-27",9 "check_out_date": "2026-11-28",10 "adults": "2",11 "rooms": "1",12 "language": "en-us",13 "currency": "USD"14}15 16response = requests.get(url, params=params)17 18if response.status_code == 200:19 data = response.json()20 print(data)21else:22 print(f"Request failed with status code: {response.status_code}")In the above code, we are making a GET request to the /booking/place endpoint.
1{2 "search_metadata": {3 "status": "Success",4 "total_time_taken": 2.045 },6 "search_parameters": {7 "engine": "booking_place",8 "check_in_date": "2026-11-27",9 "check_out_date": "2026-11-28",10 "adults": 2,11 "rooms": 1,12 "currency": "USD"13 },14 "place_result": {15 "id": 13236105,16 "name": "The July - London Victoria",17 "type": "HOTEL",18 "stars": 4,19 "address": "282 Vauxhall Bridge Road, London, United Kingdom",20 "latitude": 51.4950574,21 "longitude": -0.1413371,22 "reviewScore": 9.2,23 "reviewCount": 1067,24 "petsAllowed": "YES",25 "highlights": [26 "Non-smoking rooms",27 "Spa and wellness center",28 "Fitness center",29 "Restaurant",30 "Bar"31 ],32 "facilitiesCount": 72,33 "rooms": [34 {35 "id": 1323610501,36 "name": "Studio Apartment",37 "sizeM2": 22,38 "maxGuests": 2,39 "facilities": [40 "Refrigerator",41 "Coffee machine",42 "Kitchen",43 "City view",44 "Flat-screen TV"45 ],46 "offers": [47 {48 "blockId": "1323610501_405034169_2_2_0",49 "mealPlan": "BREAKFAST_EXCLUDED",50 "occupancy": 2,51 "price": {52 "currency": "USD",53 "total": 367.35,54 "originalTotal": 408.17,55 "taxesAndFeesExcluded": 73.47,56 "discounts": [57 {58 "name": "Genius discount",59 "amount": 40.8260 }61 ],62 "badges": [63 "10% off",64 "Genius reward"65 ]66 },67 "cancellationType": "non_refundable",68 "cancellation": "Non-refundable",69 "prepayment": "Pay the property before arrival"70 }71 ]72 }73 ]74 }75}Here is what you can expect from the JSON response:
Property details: Property ID, name, description, star rating, address, and GPS coordinates.
Ratings and reviews: Overall guest rating, review count, guest reviews, and category-wise ratings for cleanliness, comfort, staff, location, and more.
Facilities and amenities: Hotel and room facilities, including restaurants, fitness centers, Wi-Fi, parking information where available, and accessibility features.
Room details: Room IDs, room types, descriptions, room sizes, maximum occupancy, bed configurations, and amenities.
Pricing information: Current and original room prices, currency, taxes, additional fees, and available discounts.
Booking offers: Meal plans, cancellation policies, prepayment requirements, and booking conditions.
Property policies: Check-in and check-out times, pet policies, damage deposits, and other house rules.
Images: Property and room-specific image URLs.
Availability: Sold-out status and available room offers for the requested dates.
Search metadata: Request status, search parameters, Booking.com URL, and API response time.
Conclusion
Scraping Booking.com using Python is a great way to collect hotel prices, room details, and availability. However, IP blocks and anti-bot measures make scraping at scale challenging.
With Scrapingdog, you can scrape Booking.com at scale without worrying about IP blocks or managing complex scraping infrastructure.
You can also check out my guide on how to scrape Expedia using Python.
Frequently Asked Questions (FAQs)
1. How can I scrape Booking.com hotel prices with Python?
You can scrape Booking.com hotel prices with Python, Requests, and BeautifulSoup. Fetch the hotel page, parse the HTML, and extract details like price, room type, hotel name, and rating.
2. What data can a Booking.com scraper collect?
A Booking.com scraper can collect hotel name, address, rating, room type, room price, and facilities. With extra parsing, it can also collect reviews and amenities.
3. Why does Booking.com block Python scrapers?
Booking.com blocks scrapers to prevent bot traffic and repeated automated requests. If you scrape too many pages from one IP, your script can hit rate limits or IP bans.
4. Is it legal to scrape Booking.com hotel prices?
Scraping publicly available hotel data is usually possible, but you should still check Booking.com’s terms and scrape responsibly. Avoid heavy request volumes or anything that could disrupt the platform.
Additional Resources
Here are a few additional resources that you may find helpful during your web scraping journey: