Tripadvisor Scraper or API: What You Get
A Tripadvisor scraper is code you write and keep running to search Tripadvisor, open hotel, restaurant and attraction pages, and pull out names, ratings, review counts and reviews from the HTML. The alternative is three Tripadvisor endpoints, search, place and reviews, that return that data as JSON for 1 credit per successful call. This post compares the two on a recorded search, shows which fields you get without writing a parser, prices a recurring watch per place, and gives a verdict per use case.
What would a Tripadvisor scraper have to handle?
A Tripadvisor scraper has three jobs: turn a name or a phrase into the right listing, read that listing's current numbers, and collect its reviews over time. Each job is a parser you write against pages you don't control, plus the scheduling, retries and storage around it. Travel listings add one wrinkle: hotels, restaurants, attractions and destinations are different kinds of page, so a scraper that handles one type well often needs separate parsing for the others.
Resolving a listing is the first parser. A search returns several candidates, and your code has to pick the one you meant and record an identifier that stays stable when the name or the URL slug changes. Reading the numbers is a second parser, per page type. Collecting reviews is the third and the most work: a popular attraction has thousands of reviews across many pages, so a recurring run needs an order, a stopping rule and a way to recognise reviews it already stored.
Around those parsers sits the operational layer: request pacing, retries with backoff, alerts when a run returns empty fields for a place that had numbers yesterday, and storage that keeps reviewers' personal details out. Read Tripadvisor's terms before you build a collector, and if a site blocks or challenges your traffic, stop rather than work around it. None of this is hard to build once. The cost is keeping it working every week after that.
What does one Tripadvisor search call return?
One search call returns a ranked list of places, each with a location_id, its type, a human-readable location, the Tripadvisor url, an image, the rating and the review_count. Those are the fields a scraper's first parser would extract, already named and typed. The request takes a query q (up to 255 characters) and optional locale, limit and type. This is the recorded request:
curl "https://api.perceptlayer.com/v1/tripadvisor/search?q=pizza+rome&limit=3" \
-H "X-API-Key: $API_KEY"
And the recorded response, trimmed:
{
"success": true,
"data": {
"query": "pizza rome",
"results": [
{
"position": 1,
"location_id": 11449818,
"name": "Pompeii from Rome with Optional Mt. Vesuvius & Pizza Lunch",
"type": "attraction",
"location": "Rome, Lazio, Italy",
…
"url": "https://www.tripadvisor.com/AttractionProductReview-g187791-d11449818-Pompeii_from_Rome_with_Optional_Mt_Vesuvius_Pizza_Lunch-Rome_Lazio.html",
"rating": 4.7,
"review_count": 1617
},
{
"position": 2,
"location_id": 28122604,
"name": "Rome Pizza & Gelato Class with Wine by Cooking Italy",
"type": "attraction",
…
"rating": 5,
"review_count": 1492
}
]
},
"meta": {
"endpoint_family": "search",
"billable": true
}
}
What does the recording teach about the data?
Three details are worth building around. First, the query pizza rome returned a day tour and a cooking class, both type: attraction, not restaurants. A free-text search matches across place types, so set type=restaurant when you want pizzerias. Second, rating is 4.7 on one result and 5 on the other: read it as a number, not as a string with one decimal place. Third, location_id is an integer, and the url of each result contains it after a d (d11449818, d28122604). Store the location_id as your key and the url as a reference.
How do search, place and reviews fit together?
The three endpoints share one parameter name. Search results carry a location_id field, and both GET /v1/tripadvisor/place and GET /v1/tripadvisor/reviews require a location_id parameter. We only have a recorded search, so we can't show here what place or reviews return. Run both in the playground on the Tripadvisor API page with an ID from a search before you write code against their fields.
| Endpoint | Required | Optional |
|---|---|---|
/v1/tripadvisor/search |
q (up to 255 characters) |
locale (up to 10 characters), limit, type |
/v1/tripadvisor/place |
location_id (integer) |
locale (up to 10 characters) |
/v1/tripadvisor/reviews |
location_id (integer) |
offset, limit, language |
The type parameter takes one of hotel, restaurant, attraction or destination. The reviews endpoint pages with offset and limit and can narrow by language; check the page size you get in the playground rather than assuming one.
How do a Tripadvisor scraper and the endpoints compare?
A scraper costs engineering time, hosting and the risk of breaking when a page changes; the endpoints cost 1 credit per successful call and return the same named fields every time. The table compares them on a recurring job: tracking a set of hotels, restaurants or attractions for rating and review changes.
| DIY Tripadvisor scraper | Tripadvisor endpoints | |
|---|---|---|
| Finding a place | Parse search results, pick the right one | search with q, narrowed by type; match on location_id |
| Place types | A parser per page type | One response shape, with a type field per result |
| Rating and volume | Parsed from each page | rating and review_count in every search result |
| Stable key | Extracted from the URL or page | location_id, an integer |
| Reviews | Parsed per page, paging found by you | reviews with offset, limit and language |
| Localisation | Your own handling per site version | locale on search and place |
| When the page changes | Parsers return blanks until fixed | Same JSON fields; no parser of yours to fix |
| Failures | Yours to detect | HTTP status and error code; a failed call costs 0 credits |
| Cost | Hosting and your time | 1 credit per successful call |
What does tracking a place cost?
Cost follows calls, and every Tripadvisor call is 1 credit. Resolving each place is one search, done once. Tracking it can then go two ways. If you only need rating and review_count, a single search can return several places per call, so the cost per place depends on how many of your places one query returns. If you track a fixed list by ID, one place call per place per check is the predictable unit.
A worked example: a hotel group watching 40 competitor properties once a day spends 40 calls × 1 credit = 40 credits a day, 1,200 credits over 30 days and 14,600 over a year. The 100 free credits on signup cover the initial 40 searches and one day of the watch; after that you need a pack. The 50,000-credit Build pack covers the year with room for reviews calls. Adding a daily reviews call per place doubles the count to 80 credits a day. See pricing for what credits cost and the credits docs for how they're debited.
How do you snapshot search results in code?
Store one row per result per day, keyed on location_id, and compare today's rating and review_count with yesterday's. This Python script runs a search per query with type set, and writes the fields that appear in the recorded response to a CSV file. It reads nothing else, so an unexpected response shape fails loudly instead of writing guesses.
import csv
import datetime
import os
import requests
API = "https://api.perceptlayer.com/v1/tripadvisor/search"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}
QUERIES = [("pizza rome", "restaurant"), ("cooking class rome", "attraction")]
FIELDS = ["position", "location_id", "name", "type", "location", "url", "rating", "review_count"]
today = datetime.date.today().isoformat()
with open("tripadvisor_snapshot.csv", "a", newline="") as f:
writer = csv.writer(f)
for q, place_type in QUERIES:
r = requests.get(API, params={"q": q, "type": place_type}, headers=HEADERS, timeout=60)
r.raise_for_status()
print(q, "credits used:", r.headers.get("X-Credits-Used"))
for result in r.json()["data"]["results"]:
writer.writerow([today, q] + [result.get(k) for k in FIELDS])
raise_for_status() stops the run on an error before anything is written, and a failed call costs nothing. The JSON body names the problem: such as invalid_parameters (422) or rate_limited (429) with a Retry-After header. The errors docs list every code. A client timeout is the one case to handle with care: the request may have succeeded and been billed, so don't retry it in a tight loop.
Which route fits your job?
Pick by frequency and scope. A scraper's cost is ongoing upkeep across several page types; the endpoints' cost is one credit per call. These verdicts assume the job repeats. For a one-time look at a few places, open Tripadvisor in a browser.
- Watching a competitive set of hotels or restaurants: resolve each
location_idonce withsearchandtype, then check each place on a schedule. 1 credit per place per check. - Mapping a market by rating and volume: run
searchper category and city, storeratingandreview_countbylocation_id, and compare week to week. - Reading what guests say: call
reviewswithoffsetandlimit, andlanguageto keep one language per analysis run. Drop reviewers' names and profile details before you store anything. - Building a travel agent that recommends places: connect the Tripadvisor endpoints through the MCP server, as the AI agents docs describe, so the agent calls
searchwith atypeinstead of reading pages. - Learning to scrape: practise on a site built for it, not on a review platform with real people's posts.
For hotel prices rather than reviews, Hotel API: Expedia, Booking.com and Google Hotels covers rate data. Yelp Scraper or API runs the same comparison for local businesses, and the reviews APIs page lists the other review sources. To see the fields for a place you care about, run search and then place in the playground on the Tripadvisor API page, then get a free API key.
APIs in this post
Frequently asked questions
Is scraping Tripadvisor allowed?
That depends on Tripadvisor's terms, how you store and use the data, and the law where you operate, so read the terms and get legal advice for commercial use. Don't get around blocks or challenges. Ratings and review counts for a business are lower risk than personal data; leave reviewers' names, usernames and avatars out of anything you keep.
How do I find a location_id?
Run GET /v1/tripadvisor/search with the place's name and set type to narrow the results. Each result carries a location_id, an integer such as 11449818 in the recording. In that recording each result's url also contained its location_id after a d, but check that with your own links in the playground before relying on it.
Why did a pizza search return tours?
The recorded search for pizza rome set no type, and both results came back as type: attraction: a day tour with a pizza lunch and a pizza-making class. A free-text search matches across place types. Set type=restaurant for restaurants, hotel for hotels, or destination for destinations, and check the type field on each result.
Does a failed Tripadvisor call cost credits?
No. Only a successful response debits credits. A failed call returns an HTTP status and a JSON error with a code, a message and a request_id, plus X-Credits-Used: 0. Every successful response carries X-Credits-Used and X-Credits-Remaining, so a script can log what each run spent.
How fast can I run a daily Tripadvisor job?
Limits are per account, shared by all its keys, and counted per minute. A free account gets 1 request a second (60 a minute), so 40 daily calls finish within a minute. Paying accounts run at least 5 requests a second. The rate limits docs list the rate each pack includes.