Skip to content

Scrape real-time hotel data from Google using a free scraper or Bright Data’s Google Hotels API for large-scale, reliable data collection.

Notifications You must be signed in to change notification settings

luminati-io/google-hotels-api

Repository files navigation

Google Hotels Scraper

Promo

Learn how to scrape real-time hotel data from Google – one of the largest travel data aggregators. We cover two methods:

  1. Free Scraper: Ideal for small-scale needs.
  2. 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).

Table of Contents

Free Scraper

A quick-and-easy scraper for extracting Google Hotels data on a smaller scale.

free-google-hotels-scraper

Setup

Requirements:

Installation:

pip install pandas tqdm selenium beautifulsoup4 webdriver-manager

Note: 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.

Usage

Run the google-hotels-scraper.py script with the required parameters:

python3 google-hotels-scraper.py --location "Dubai" --max_hotels 200

Parameters:

  • location – the target location for hotel data
  • max_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.

Sample Output

google-hotels-scraper-csv-output

Limitations

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 Google Hotels API

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.

Key Features

  • 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

Prerequisites

  1. Create a Bright Data account (new users get $5 credit)
  2. Generate your API key
  3. Follow our step-by-step guide to configure the SERP API and access credentials
  4. To use the Google Hotels API, you'll need the entity ID of the hotel you want to query. You can find this by:
    1. Searching for the hotel name in Google
    2. Right-clicking and selecting "View page source"
    3. Searching for "/entity" on the page to find the entity ID

Direct API Access

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.

Native Proxy-Based Access

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.

Advanced Features

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.

Localization Parameters

bright-data-google-hotels-scraper-api-localization

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"

Booking Parameters

bright-data-google-hotels-scraper-api-booking-params

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"

Device Type Parameters

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"

Response Format

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"

Alternative Solutions

Beyond the Web Scraper APIs, Bright Data also provides ready-to-use datasets tailored to travel industry needs:

Support & Resources

About

Scrape real-time hotel data from Google using a free scraper or Bright Data’s Google Hotels API for large-scale, reliable data collection.

Topics

Resources

Stars

Watchers

Forks