TripAdvisor API endpoint
Returns TripAdvisor typeahead suggestions for the required query `q`, optionally narrowed by `limit`, `locale`, `scope_geo_id` and a `type` hint. Each result has its id, title, type, URL, image, parent location and coordinates, and may carry nested search shortcuts. Results can be locations, hotels, restaurants or attractions.
/tripadvisor/autocompleteMCP tool: tripadvisor_autocomplete
Query parameters: q is required. limit, locale, scope_geo_id, and type are optional. Advanced replay parameters search_session_id, typeahead_id, and route_uid may be supplied when reproducing a captured public request, but are not required for normal use.
Returns TripAdvisor typeahead candidates. Results may include locations, hotels, restaurants, attractions, and nested search shortcuts when TripAdvisor includes them.
| Field | Filled in, of 4 checked | Values in the sample |
|---|---|---|
| id | 1 | |
| document_id | 4 | |
| title | 4 | “California” and 3 other values |
| type | 4 | “geo” and 3 other values |
| url | 3 | tripadvisor.com |
| image | 1 | dynamic-media-cdn.tripadvisor.com |
| parent | 3 | “United States, North America” |
| latitude | 1 | |
| longitude | 1 | |
| nested_results | 1 | median 2 entries |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| q | string | Yes | Autocomplete query | hong kong | |
| limit | integer | No | Maximum results | 5 | |
| locale | string | No | TripAdvisor locale | en-HK | |
| scope_geo_id | integer | No | Optional scoped geo id | 294217 | |
| type | string | No | Optional result type hint | attraction | |
| search_session_id | string | No | Optional captured search session id | ||
| typeahead_id | string | No | Optional captured typeahead id | ||
| route_uid | string | No | Optional captured route uid | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/tripadvisor/autocomplete?q=hong+kong&limit=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"query": "california",
"locale": "en-HK",
"scope_geo_id": 294217,
"results": [
{
"id": "28926",
"document_id": "loc;28926;g28926",
"title": "California",
"type": "geo",
"url": "https://www.tripadvisor.com/Tourism-g28926-California-Vacations.html",
"image": "https://dynamic-media-cdn.tripadvisor.com/media/photo.jpg",
"parent": "United States, North America",
"latitude": 37.511375,
"longitude": -121.07013,
"nested_results": [
{
"title": "Things to Do",
"type": "attraction_search",
"query": "california things to do",
"url": "https://www.tripadvisor.com/Attractions-g28926-Activities-California.html"
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/tripadvisor.tripadvisorAutocompleteResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | tripadvisor.AutocompleteResponse | No | ||||
| data.locale | string | No | en-HK | Locale code the suggestions were returned in, for example `en-HK`. | ||
| data.query | string | No | hong kong | Search text that was run. | ||
| data.results | array | No | Suggested locations and places for the search text, one entry per suggestion. | |||
| data.results[].document_id | string | No | loc;294217;g294217 | TripAdvisor document id of the suggestion, for example `loc;294217;g294217`. | ||
| data.results[].id | string | No | 294217 | TripAdvisor id of the suggested place or location. | ||
| data.results[].image | string | No | URL of an image for the suggestion. | |||
| data.results[].latitude | number | No | 22.28331 | Latitude of the suggestion in decimal degrees. | ||
| data.results[].longitude | number | No | 114.15874 | Longitude of the suggestion in decimal degrees. | ||
| data.results[].nested_results | array | No | Search shortcuts TripAdvisor offers under the suggestion, such as hotels or things to do in that location. | |||
| data.results[].nested_results[].query | string | No | hong kong hotels | Search text the shortcut runs, for example `hong kong hotels`. | ||
| data.results[].nested_results[].title | string | No | Hotels | Label of the shortcut, for example `Hotels`. | ||
| data.results[].nested_results[].type | string | No | hotel_search | Kind of search the shortcut opens, for example `hotel_search`. | ||
| data.results[].nested_results[].url | string | No | https://en.tripadvisor.com.hk/Hotels-g294217-Hong_Kong-Hotels.html | TripAdvisor page URL of the shortcut. | ||
| data.results[].parent | string | No | China, Asia | Parent locations of the suggestion, for example `China, Asia`. | ||
| data.results[].title | string | No | Hong Kong | Name of the suggested place or location. | ||
| data.results[].type | string | No | geo | Kind of suggestion, for example `geo` for a destination. | ||
| data.results[].url | string | No | https://en.tripadvisor.com.hk/Tourism-g294217-Hong_Kong-Vacations.html | TripAdvisor page URL of the suggestion. | ||
| data.scope_geo_id | integer | No | 60763 | TripAdvisor geo id the suggestions were limited to. Defaults to `60763` when no scope is given. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/tripadvisor/autocomplete?q=hong+kong&limit=10" \
-H "x-api-key: $CRAWLORA_API_KEY"