Google Hotels Autocomplete API
Google Hotels Autocomplete API allows to provide suggestions based on partial user input.
Suggestions can include a title, street address (subtitle), and Knowledge Graph ID (kgmid).
The type field is hotel for hotel listings, destination for locations or hotel chains, or query for general search suggestions.
Hotel suggestions with a listing ID (ludocid) also include a property_token that the Google Hotels Property API accepts directly. Destination and query suggestions omit this token.
API Parameters
Search Query
-
- Name
-
q - Required
- Required
- Description
-
Search query that would produce autocomplete suggestions.
Localization
-
- Name
-
hl - Required
- Optional
- Description
-
The default parameter
en-USdefines the interface language of the search. Check the full list of supported Google Travelhllanguages.
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
google_hotels_autocomplete.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Locations
https://www.searchapi.io/api/v1/search?engine=google_hotels_autocomplete&q=Hilton+Hawaiian+Village+Waikiki+Beach+Resort
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_hotels_autocomplete",
"q": "Hilton Hawaiian Village Waikiki Beach Resort"
}
response = requests.get(url, params=params)
print(response.text)
{
"suggestions": [
{
"type": "query",
"title": "hilton hawaiian village waikiki beach resort"
},
{
"type": "query",
"title": "hilton hawaiian village waikiki beach resort map"
},
{
"type": "hotel",
"kgmid": "/m/03cmsg",
"ludocid": "12777359080708391472",
"property_token": "ChYIsITxqa-Mk6mxARoJL20vMDNjbXNnEAE",
"title": "Hilton Hawaiian Village Waikiki Beach Resort",
"subtitle": "2005 Kālia Rd, Honolulu",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSPqfiVQa-8dSk47T6gpcmexr__H1hRADISmp0gUDrqRmiMIy8G"
},
{
"type": "query",
"title": "hilton hawaiian village waikiki beach resort rainbow tower"
},
...
]
}