Travel: Hotels

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]}
        ]
    }'

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.

ParameterDescriptionDefault Value

source

Sets the scraper.

google_travel_hotels

query

UTF-encoded keyword.

"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.

-

render

Enables JavaScript rendering when set to html. More info.

-

callback_url

URL to your callback endpoint. More info.

-

user_agent_type

Device type and browser. The full list can be found here.

desktop

- mandatory parameter

Localization

Adapt search results to specific geographical locations, domains, and languages.

ParameterDescriptionDefault Value

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.

-

domain

Domain localization for Google. The full list of available domains can be found here.

com

locale

Accept-Language header value which changes your Google search page web interface language. More info.

-

NOTE: "geo_location": "United States" and other wide-area locations are not supported. Use city-level geo_location, e.g., Seattle,Washington,United States

Pagination

Controls for managing the pagination.

ParameterDescriptionDefault Value

start_page

Starting page number.

1

Filtering

Advanced options for tailoring and refining the search context.

ParameterDescriptionDefault Value

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

...
"context": [
    {
        "key": "filter",
        "value": "0"
    }
]
...

Output example

{
    "results": [
        {
            "content":"<!doctype html>\n<html lang=\"en\">\n<head>
            ...
            </script></body>\n</html>\n",            
            "created_at": "2024-02-13 11:30:09",
            "updated_at": "2024-02-13 11:30:36",
            "page": 2,
            "url": "https://www.google.com/travel/search?q=hotels%20in%20Paris&qs=OAA&hrf=OAI4AzgEWAGSAQIgAbABAA&ap=EgNDQXcwAGgA&ts=CAEaFhIUEhIKBwjnDxAKGAESBwjnDxAKGAo&uule=w%20CAIQICINdW5pdGVkIHN0YXRlcw&gl=us&hl=en&ved=0CAAQ5JsGahcKEwjIwci_m6iEAxUAAAAAHQAAAAAQew",
            "job_id": "7163132237108506625",
            "status_code": 200
        }
    ]
}

Last updated