Tripadvisor API — Hotel & Restaurant Photo Gallery
Documentation menu
FetchLayer FetchLayer API

Get a place's photos

Page through a place's gallery. Each photo comes back as a Tripadvisor URL with its caption, pixel dimensions, media type and credit, plus a download URL that streams the file itself through this API.

POST /location-photos Photos
https://api.fetchlayer.dev/tripadvisor/location-photos
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

location string required

Tripadvisor location id, or the URL of a hotel, restaurant or attraction page. Use /search-locations to turn a name into an id.

limit number optional

Maximum photos returned (max 200), or -1 for everything available. (default: 20)

cursor string optional

Resume from a previous response's nextCursor.

format string optional

json or markdown. (default: json)

Response Fields

location-photos

Get a place's photos

photos object[]

The gallery photos.

photos[].photoId string

Tripadvisor photo id.

photos[].caption string

Caption, where one is published.

photos[].url string

Original Tripadvisor image URL.

photos[].downloadUrl string

FetchLayer download URL — pass it to GET /media to stream the bytes.

photos[].width number

Pixel width.

photos[].height number

Pixel height.

photos[].attribution string

Who supplied the photo — the property, or a traveller.

photoCount number

Number of photos in this response.

nextCursor string

Pass back as cursor to continue, or null when the gallery is exhausted.

hasNextPage boolean

Whether more photos are available.

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/location-photos" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"location":"298106","limit":50}'

Response

{
  "locationId": "298106",
  "photoCount": 50,
  "hasNextPage": true,
  "photos": [
    {
      "photoId": "512348891",
      "caption": "Deluxe King room, 52nd floor",
      "url": "https://media-cdn.tripadvisor.com/media/photo-o/…",
      "width": 1600,
      "height": 1067,
      "attribution": "Management"
    }
  ],
  "notes": []
}