Tripadvisor API — Parse a Tripadvisor URL to IDs
Documentation menu
FetchLayer FetchLayer API

Parse a Tripadvisor URL

Turn any Tripadvisor URL into the identifiers it encodes — the location id, the geo id of the city or region, a review id, a photo id, the position in the review list it points at, and the kind of place. Use it to go from a link somebody pasted to the id the other endpoints need. Parsing a URL does not consume a credit.

POST /resolve-url Utility
https://api.fetchlayer.dev/tripadvisor/resolve-url
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

Any Tripadvisor URL, to be parsed into structured identifiers.

format string optional

json or markdown. (default: json)

Response Fields

resolve-url

Parse a Tripadvisor URL

kind string

What the URL points at: location, review, photo, geo, or unknown.

locationId string

The place the URL names — pass it straight to the other endpoints.

geoId string

The city or region the URL names.

reviewId string

Present when the URL points at one review.

photoId string

Present when the URL points at one photo.

reviewOffset number

Position in the review list the URL points at.

pageType string

Tripadvisor's own name for the page.

locationType string

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

slug string

The readable name in the URL. Not an identifier.

Request

curl -X POST "https://api.fetchlayer.dev/tripadvisor/resolve-url" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.tripadvisor.com/Hotel_Review-g1066443-d298106-Reviews-Park_Hyatt_Tokyo-Shinjuku_Tokyo_Tokyo_Prefecture_Kanto.html"}'

Response

{
  "kind": "location",
  "locationId": "298106",
  "geoId": "1066443",
  "locationType": "hotel",
  "slug": "Park_Hyatt_Tokyo"
}