Skip to content
Tripadvisor

Tripadvisor search

Resolve a hotel name to Tripadvisor's locationId.

POST/v1/ota/tripadvisor/search
1 credit

Not available yet

Tripadvisor name search is not implemented in the current release: this operation always returns 502 with {"detail": "TripadvisorError"} (not charged). Take the locationId from the hotel's Tripadvisor URL instead — the digits after -d in /Hotel_Review-g{geoId}-d{locationId}-... — and pass it to POST /v1/ota/tripadvisor. The 200 example below shows the planned response shape.

Tripadvisor uses locationId for both search and availability queries. Store recommended_match.location_id for pricing calls. It is null when only weak or ambiguous candidates were found.

Request

POSThttps://api.scrapercompany.com/v1/ota/tripadvisor/search

Authenticate with your API key in the x-api-key header (see Authentication).

Body

JSON object. Unknown fields are rejected with 422.

  • querystringrequiredmin length 1

    Hotel name or location to search for.

  • limitintegerdefault 10min 1, max 50

    Maximum results to return.

Example request

curl -X POST "https://api.scrapercompany.com/v1/ota/tripadvisor/search" \
  -H "x-api-key: $SCRAPERCOMPANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Moxy Boston Downtown"
  }'

Response

200 — Tripadvisor location search results with locationId. Metered responses carry x-credits-charged and x-credits-remaining headers (see credit headers).

200 response
{
  "query": "Moxy Boston Downtown",
  "matches": [
    {
      "location_id": "97679",
      "title": "Moxy Boston Downtown",
      "secondary_text": "Boston, MA",
      "place_type": "HOTEL",
      "hierarchy": "Massachusetts > Boston"
    }
  ],
  "recommended_match": {
    "location_id": "97679",
    "title": "Moxy Boston Downtown",
    "secondary_text": "Boston, MA",
    "place_type": "HOTEL",
    "hierarchy": "Massachusetts > Boston"
  },
  "wire_bytes": 3245
}

Errors

Errors return a JSON body with a detail field. Failed requests are not charged. See Errors for the full list and retry advice.

StatusMeaningRetry?
401Unauthorized

Missing or invalid API key.

{"detail":"missing or invalid API key"}
No, fix the request
402Payment Required

Not enough credits for this request. Only returned once credit enforcement is switched on; during the beta metering runs in shadow mode and never blocks.

{"detail":"insufficient credits: this request costs 5, 0 available. Credits renew 2026-11-01."}
No, fix the request
422Unprocessable Content

Request validation failed.

{"detail":[{"loc":["body","token"],"msg":"Field required","type":"missing"}]}
No, fix the request
429Too Many Requests

Too many requests: the key's requests-per-minute limit was exceeded, or (once credit enforcement is on) the plan's concurrent-request limit. No rate-limit or Retry-After headers are sent; back off and retry.

{"detail":"rate limit 60/min exceeded"}
Yes, with backoff
502Bad Gateway

The upstream source failed, blocked the request or returned an unusable answer. Safe to retry later; failed requests are not charged.

{"detail":"RuntimeError"}
Yes, with backoff

Try it

  1. Export your key: export SCRAPERCOMPANY_API_KEY=sk_... (no key yet? request access).
  2. Copy the cURL example above and run it in a terminal.
  3. Or open the interactive playground on api.scrapercompany.com, paste your key and pick this endpoint.

Credits

1 credit per successful call. Failed, blocked and empty results are free. Credit metering is in beta and does not block requests yet.