Tripadvisor API — Search Hotels, Restaurants, Places
Documentation menu
FetchLayer FetchLayer API

Find places by name

Search Tripadvisor for hotels, restaurants, attractions, tours, cities and regions by name. Each match comes back with the location id the other endpoints take, the kind of place it is, where it sits, its rating and its review count. It returns the closest matches rather than every place that could match, so this is a resolver, not a directory crawl.

POST /search-locations Places
https://api.fetchlayer.dev/tripadvisor/search-locations
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

query string required

Name of a hotel, restaurant, attraction, city or region.

locationTypes string[] optional

Narrow to all, hotel, restaurant, attraction, activity and/or geo. (default: all)

limit number optional

Maximum places returned (max 50), or -1 for everything available. (default: 10)

latitude number optional

Bias results towards this point (-90 to 90). Pass longitude too.

longitude number optional

Bias results towards this point (-180 to 180).

format string optional

json or markdown. (default: json)

Response Fields

search-locations

Find places by name

locations object[]

The matching places, closest match first.

locations[].locationId string

Pass this as location to the profile, reviews and photos endpoints.

locations[].name string

The place name as Tripadvisor publishes it.

locations[].locationType string

hotel, restaurant, attraction, activity, geo, airline, or other.

locations[].rawPlaceType string

Tripadvisor's own wording for the kind of place.

locations[].parentHierarchy string

Where the place sits, as Tripadvisor writes it: "Asakusa, Tokyo Prefecture, Japan".

locations[].city string

City the place sits in.

locations[].country string

Country the place sits in.

locations[].parentGeoId string

Tripadvisor id of that city — the handle for destination-level work.

locations[].latitude number

Latitude, where Tripadvisor publishes one.

locations[].longitude number

Longitude, where Tripadvisor publishes one.

locations[].rating number

Average rating out of 5.

locations[].reviewCount number

Every review Tripadvisor holds for the place.

locationCount number

Number of places in this response.

notes string[]

Caveats about this specific result — a walk cut short, a field Tripadvisor does not publish for this place, an upstream limit that was hit. Read it: a response can be well-formed and still incomplete, and this array is where that is said.

requestedUrl string

The Tripadvisor page this result corresponds to.

scrapedAt string

ISO-8601 timestamp of when the data was collected.

blocked boolean

Always false on a successful response.

Request

curl -X POST "https://api.fetchlayer.dev/tripadvisor/search-locations" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"Park Hyatt Tokyo","locationTypes":["hotel"],"limit":5}'

Response

{
  "locationCount": 5,
  "locations": [
    {
      "locationId": "298106",
      "name": "Park Hyatt Tokyo",
      "locationType": "hotel",
      "parentHierarchy": "Shinjuku, Tokyo, Japan",
      "city": "Tokyo",
      "country": "Japan",
      "rating": 4.5,
      "reviewCount": 2184
    }
  ],
  "notes": []
}