Tripadvisor search
Resolve a hotel name to Tripadvisor's locationId.
/v1/ota/tripadvisor/searchTripadvisor 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
https://api.scrapercompany.com/v1/ota/tripadvisor/searchAuthenticate 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 50Maximum 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).
{
"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.
| Status | Meaning | Retry? |
|---|---|---|
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
- Export your key:
export SCRAPERCOMPANY_API_KEY=sk_...(no key yet? request access). - Copy the cURL example above and run it in a terminal.
- Or open the interactive playground on api.scrapercompany.com, paste your key and pick this endpoint.