Learn how to scrape real-time hotel data from Google – one of the largest travel data aggregators. We cover two methods:
- Free Scraper: Ideal for small-scale needs.
- Bright Data Google Hotels API: An enterprise-grade solution for collecting public Google Hotels data at scale with a single API call (part of the SERP Scraping API).
- Free Scraper
- Bright Data Google Hotels API
- Advanced Features
- Alternative Solutions
- Support & Resources
A quick-and-easy scraper for extracting Google Hotels data on a smaller scale.
Requirements:
- Python 3.9+
- Selenium for browser automation
- BeautifulSoup for parsing HTML
- Other helper libraries like
pandas,tqdm,webdriver-manager
Installation:
pip install pandas tqdm selenium beautifulsoup4 webdriver-managerNote: If you're new to web scraping, we recommend starting with our Python web scraping for beginners tutorial or our Guide to Web Scraping With Selenium.
Run the google-hotels-scraper.py script with the required parameters:
python3 google-hotels-scraper.py --location "Dubai" --max_hotels 200Parameters:
location– the target location for hotel datamax_hotels– the number of hotels to scrape
💡 Pro Tip: Comment out the line options.add_argument("--headless=new") in the script to reduce detection by Google's anti-scraping systems.
The Free Scraper has several constraints:
- High risk of IP blocks
- Limited request volume
- Frequent CAPTCHAs
- Unreliable for large-scale scraping
Consider Bright Data's dedicated solution below for larger and more reliable data collection 👇
Bright Data's Google Hotels API is part of the SERP Scraping API and uses our advanced proxy network. It helps you collect public Google Hotels data at scale – without worrying about CAPTCHA or IP blocks.
- Global Location Accuracy: Tailor results to specific locations
- Pay-Per-Success Model: Only pay for successful requests
- Real-Time Data: Get up-to-date hotel information in seconds
- Scalability: Handle unlimited requests with no volume restrictions
- Cost Efficiency: Save on infrastructure and maintenance costs
- High Reliability: Consistent performance with built-in anti-blocking measures
- 24/7 Support: Expert help whenever you need it
- Create a Bright Data account (new users get $5 credit)
- Generate your API key
- Follow our step-by-step guide to configure the SERP API and access credentials
- To use the Google Hotels API, you'll need the entity ID of the hotel you want to query. You can find this by:
- Searching for the hotel name in Google
- Right-clicking and selecting "View page source"
- Searching for "/entity" on the page to find the entity ID
Make a direct request to the API endpoint.
cURL Example:
curl https://api.brightdata.com/request \
-H "Content-Type: application/json" \
-H "Authorization: Bearer API_TOKEN" \
-d '{
"zone": "ZONE_NAME",
"url": "https://www.google.com/travel/hotels/entity/CgoIyNaqqL33x5ovEAE/prices?brd_json=1",
"format": "raw"
}'Python Example:
import requests
import json
url = "https://api.brightdata.com/request"
headers = {"Content-Type": "application/json", "Authorization": "Bearer API_TOKEN"}
payload = {
"zone": "ZONE_NAME",
"url": "https://www.google.com/travel/hotels/entity/CgoIyNaqqL33x5ovEAE/prices?brd_json=1",
"format": "raw",
}
response = requests.post(url, headers=headers, json=payload)
with open("serp-direct-api.json", "w") as file:
json.dump(response.json(), file, indent=4)
print("Response saved to 'serp-direct-api.json'.")👉 See the full JSON output.
Note: Use brd_json=1 for parsed JSON or brd_json=html for parsed JSON + full nested HTML.
You can also use Bright Data's proxy routing method:
cURL Example:
curl -i \
--proxy brd.superproxy.io:33335 \
--proxy-user "brd-customer-<customer-id>-zone-<zone-name>:<zone-password>" \
-k \
"https://www.google.com/travel/hotels/entity/CgoIyNaqqL33x5ovEAE/prices?brd_json=html"Python Example:
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
host = "brd.superproxy.io"
port = 33335
username = "brd-customer-<customer-id>-zone-<zone-name>"
password = "<zone-password>"
proxy_url = f"http://{username}:{password}@{host}:{port}"
proxies = {"http": proxy_url, "https": proxy_url}
url = "https://www.google.com/travel/hotels/entity/CgoIyNaqqL33x5ovEAE/prices?brd_json=html"
response = requests.get(url, proxies=proxies, verify=False)
with open("serp-native-proxy.html", "w", encoding="utf-8") as file:
file.write(response.text)
print("Response saved to 'serp-native-proxy.html'.")👉 See the full JSON output.
Note: For production environments, load Bright Data's SSL certificate as described in the SSL Certificate Guide.
Bright Data's API supports many advanced parameters for fine-tuning your Google Hotels data extraction. Below are examples using Native Proxy-Based Access, but you can apply them via Direct API Access as well.
These parameters define the country and language of the search:
| Parameter | Description | Example |
|---|---|---|
| gl | Two-letter country code | gl=us (United States) |
| hl | Two-letter language code | hl=en (English) |
Example: Search for hotels in the United States with results in English:
curl --proxy brd.superproxy.io:33335 --proxy-user brd-customer-<customer-id>-zone-<zone-name>:<zone-password> \
"https://www.google.com/travel/hotels/entity/CgoI4NzJmsPmkpU6EAE/prices?gl=us&hl=en"These parameters help refine results based on dates, number of guests, free cancellation, and accommodation type:
| Parameter | Description | Format | Example |
|---|---|---|---|
| brd_dates | Check-in and check-out dates | YYYY-MM-DD,YYYY-MM-DD | brd_dates=2025-08-15,2025-08-20 |
| brd_occupancy | Number of guests (adults + children) | <adults>,<child1_age>,<child2_age> |
brd_occupancy=3,6,9 (3 adults, 2 children aged 6 & 9) |
| brd_free_cancellation | Only show refundable bookings | true or false | brd_free_cancellation=true |
| brd_accomodation_type | Type of stay | hotels or vacation_rentals | brd_accomodation_type=vacation_rentals |
| brd_currency | Currency for displaying prices | 3-letter currency code | brd_currency=GBP (British Pounds) |
Example: Search for a hotel stay with specific parameters:
curl --proxy brd.superproxy.io:33335 \
--proxy-user brd-customer-<customer-id>-zone-<zone-name>:<zone-password> \
"https://www.google.com/travel/hotels/entity/CgoIyNaqqL33x5ovEAE/prices\
?brd_dates=2025-04-15,2025-04-20\
&brd_occupancy=3,6,9\
&brd_free_cancellation=true\
&brd_currency=GBP"By default, requests mimic a desktop user-agent, but you can change it to mobile:
| Parameter | Description |
|---|---|
brd_mobile=0 |
Random desktop user-agent (default) |
brd_mobile=1 |
Random mobile user-agent |
brd_mobile=ios |
iPhone user-agent |
brd_mobile=android |
Android phone user-agent |
brd_mobile=ipad |
iPad user-agent |
brd_mobile=android_tablet |
Android tablet user-agent |
Example: Fetch hotel data with an Android phone user-agent:
curl --proxy brd.superproxy.io:33335 --proxy-user brd-customer-<customer-id>-zone-<zone-name>:<zone-password> \
"https://www.google.com/travel/hotels/entity/CgoIyNaqqL33x5ovEAE/prices?brd_mobile=android"By default, responses are in HTML, but you can request a JSON response:
| Parameter | Description |
|---|---|
brd_json=1 |
Returns JSON response instead of HTML |
brd_json=html |
JSON + full nested HTML |
Example: Get hotel price data in JSON format:
curl --proxy brd.superproxy.io:33335 --proxy-user brd-customer-<customer-id>-zone-<zone-name>:<zone-password> \
"https://www.google.com/travel/hotels/entity/CgoIyNaqqL33x5ovEAE/prices?brd_json=1"Beyond the Web Scraper APIs, Bright Data also provides ready-to-use datasets tailored to travel industry needs:
- Hotel Datasets
- Airbnb Dataset
- Expedia Datasets
- Tourism Datasets
- Booking.com Datasets
- TripAdvisor Datasets
- Documentation: SERP API Docs
- Explore Related Guides:
- Helpful Articles:
- Use Cases:
- Contact: Need help? Email us at support@brightdata.com




