Recommendations

Returns AI-powered Location recommendations for a natural-language query.

Accepts a free-text query plus optional geographic context, category filters, and a result limit, and returns a ranked set of recommended Locations (and Experiences), each with supporting review citations. Built on Tripadvisor's user-generated content and metadata for use in agentic workflows.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Recommendations requests

A Recommendations request takes a natural-language query and a geographic scope, and returns a ranked set of recommended Locations and Experiences. Each result may include the review snippets that support it. Recommendations only supports POST requests.

A request is an HTTP POST to a URL in the form:

https://terra.tripadvisor.com/api/recommendations/search

Pass all fields in the JSON request body. For example:

curl -X POST "https://terra.tripadvisor.com/api/recommendations/search?version=1" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: API_KEY" \
  -d '{
    "query": "quiet wine bar with outdoor seating for an anniversary",
    "geo": { "id": 187147 },
    "top_level_categories": ["Eat & Drink"],
    "limit": 5,
    "response_preference": "quality"
  }'

The request body is strict. A field the schema does not define returns 400 rather than being ignored.

query

Required, and must not be empty. The natural-language request. Express constraints in the query text — for example "kid-friendly", "under €30", "walkable from the station". There are no separate parameters for them.

geo

Required. The geographic scope, given in one of three forms:

  • search_area — an explicit centroid and radius.
  • id — a Tripadvisor Geo ID, resolved with Geo Details.
  • name — a destination name, such as "Paris", "Boston MA" or "Brooklyn, New York, USA".

Each field is individually optional, and when more than one is supplied they are applied in that order of precedence: search_area overrides both id and name, and id overrides name.

The geo object itself is required, but it may be empty. An empty geo causes Tripadvisor to infer the destination from the query text. Supplying any form of geo overrides whatever the query text implies.

top_level_categories

Filters results by category. One or more of Accommodation, Eat & Drink, Attraction, Experience. If omitted, all categories are eligible.

limit

The maximum number of Locations to return. Defaults to 5.

exclude_location_ids

Location IDs to omit from the results. Pass the IDs returned by a previous request to retrieve further results for the same query.

response_preference

The trade-off between response speed and recommendation quality. One of quality (default) or speed.

Recommendations responses

The response contains a search_results array. Each entry has a type of either location or experience, and populates the corresponding object. An experience result carries its own providers and tags, so both shapes must be handled.

Each entry may carry a review_sources array of supporting review snippets. The array can be empty; a recommendation is not guaranteed to have citations.

Billing

Each call is billed as one entity, regardless of limit. See Usage-based Pricing.

Note: review snippets must be shown with attribution and linked back to Tripadvisor, as with any review content. See Linking Policy.

Examples

Recommend restaurants in a named city

curl -X POST "https://terra.tripadvisor.com/api/recommendations/search?version=1" \
  -H "Content-Type: application/json" -H "X-API-Key: API_KEY" \
  -d '{ "query": "family-friendly lunch near the museum district",
        "geo": { "name": "Amsterdam" },
        "top_level_categories": ["Eat & Drink"] }'

Retrieve the next set of results

curl -X POST "https://terra.tripadvisor.com/api/recommendations/search?version=1" \
  -H "Content-Type: application/json" -H "X-API-Key: API_KEY" \
  -d '{ "query": "family-friendly lunch near the museum district",
        "geo": { "name": "Amsterdam" },
        "exclude_location_ids": [190420, 190421, 190422] }'

Favour latency over ranking quality

curl -X POST "https://terra.tripadvisor.com/api/recommendations/search?version=1" \
  -H "Content-Type: application/json" -H "X-API-Key: API_KEY" \
  -d '{ "query": "rooftop bar with a view",
        "geo": { "id": 187147 },
        "response_preference": "speed" }'

Related

Query Params
locale
array of strings

preferred locales for localized fields in the recommended results, in priority order;
falls back to the default locale when omitted

locale
Body Params
exclude_location_ids
array of int32s

List of location ids to filter from the response set. Can be used to simulate pagination.

Exclude Location Ids
geo
object
required
int32
Defaults to 5

Maximum number of locations to return.

string
required

Free-text search query from the user. If no destination name, geo_id, or search area is provided,
Tripadvisor will attempt to infer the destination context from the free-text query.

string
enum
Defaults to quality
Allowed:
top_level_categories
array of objects, unique

A set of top level categories (aka PlaceTypes) to filter or focus the search
(e.g., ['Eat & Drink', 'Accommodation'], ['Attraction']).

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json