Travel: Hotels
Scrape Google Travel: Hotels results with guest count, dates, and star rating filters. Flexible API integration with comprehensive parameter options.
The google_travel_hotels data source is designed to retrieve Google Travel service's hotel search results.
To ensure optimal utilization of this service, include the "render": "html" parameter in your request.
Request samples
In this example, we make a request to retrieve the 2nd results page for hotel availability for 2 adult guests between 2023-10-01 and 2023-10-10 for 2 to 4-star hotels in Paris from google.com.
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "google_travel_hotels",
"domain": "com",
"start_page": 2,
"query": "hotels in Paris",
"render": "html",
"context": [
{"key": "adults", "value": 2},
{"key": "hotel_dates", "value": "2023-10-01,2023-10-10"},
{"key": "hotel_classes", "value": [2, 3, 4]}
]
}'import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google_travel_hotels',
'domain': 'com',
'query': 'hotels in Paris',
'start_page': 2,
'render': 'html',
'context': [
{'key': 'adults', 'value': 1},
{'key': 'hotel_dates', 'value': '2023-10-01,2023-10-10'},
{'key': 'hotel_classes', 'value': [2,3,4]},
],
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
We use synchronous Realtime integration method in our examples. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration, refer to the integration methods section.
Request parameter values
Generic
Basic setup and customization options for scraping Google Travel: Hotels results.
source
Sets the scraper.
google_travel_hotels
query
The keyword or phrase to search for.
"query": "hotels" will result in a list of hotels in a given geo_location.
"query": "hotels in <Location>" will result in a list of hotels for <Location>. For example, "query": "hotels in Paris" will list hotels in Paris, regardless of the given geo_location.
-
- mandatory parameter
Localization
Adapt search results to specific geographical locations, domains, and languages.
geo_location
The geographical location that the result should be adapted for. Using this parameter correctly is extremely important to get the right data. Please note that this source can accept a limited number of geo_location values - please check this section to see geo_location values that don't yield accurate results.
-
locale
Accept-Language header value which changes your Google search page web interface language. More info.
-
Pagination
Controls for managing the pagination.
start_page
Starting page number.
1
Filtering
Advanced options for tailoring and refining the search context.
context:adults
Number of adult guests
2
context:children
Number of children guests
-
context:
hotel_classes
Filter results by # of hotel stars. You may specify one or more values between 2 and 5. Example: [3,4]
-
context:
hotel_dates
Dates for staying at the hotel, from - to. Example: 2023-07-12,2023-07-13
-
Context parameters
All context parameters should be added to the context array as objects with key and value pairs, e.g.:
Output example

Last updated
Was this helpful?

