Updated Oct 2026
Tripadvisor API in Python: the Content API, the 5 reviews, and your own listing
Tripadvisor’s only public API is the Content API, built to put Tripadvisor content on your site: a location’s details, its rating, photos and up to 5 reviews, always with a link back. It is not an owner API: no full review list for your own hotel or restaurant, and no replies. This guide shows what it does return in Python, the errors, and the options when you manage the listing. The limits per platform are in the State of Review Platform APIs.
pip install requestsApply for a key on the Tripadvisor developer portal; approval checks your intended use and the domains or IPs that will call it.
1. Find the location ID
import os, requests
KEY = os.environ["TRIPADVISOR_API_KEY"]
BASE = "https://api.content.tripadvisor.com/api/v1"
r = requests.get(f"{BASE}/location/search", params={"key": KEY, "searchQuery": "Hotel Las Arenas Valencia", "category": "hotels", "language": "en"}, timeout=30)
r.raise_for_status()
for loc in r.json()["data"]:
print(loc["location_id"], loc["name"], loc["address_obj"].get("address_string"))
LOCATION_ID = r.json()["data"][0]["location_id"]category takes hotels, restaurants, attractions or geos. You can also pass latLong to search around a point.
2. Read the details and the 5 reviews
d = requests.get(f"{BASE}/location/{LOCATION_ID}/details", params={"key": KEY, "language": "en", "currency": "EUR"}, timeout=30).json()
print(d["name"], d.get("rating"), d.get("num_reviews"), d.get("ranking_data", {}).get("ranking_string"), d["web_url"])
rv = requests.get(f"{BASE}/location/{LOCATION_ID}/reviews", params={"key": KEY, "language": "en"}, timeout=30).json()
for rev in rv["data"]:
print(rev["rating"], rev["published_date"], rev["title"], rev["text"][:100], rev["url"])details gives the aggregate rating, num_reviews and the ranking_string; reviews gives at most 5 recent reviews with rating, title, text, published_date, the trip type, the user’s name and a url to the full review. Tripadvisor’s terms require showing its logo and linking back when you display them, and don’t allow caching beyond the allowed period.
3. Errors and quotas
| Error | Meaning | Fix |
|---|---|---|
| 401 | Key missing, wrong, or calling from a non-whitelisted IP or referrer | Check the key’s allowed domains and IPs in the portal |
| 404 | Unknown location_id | Use the id from location/search |
| 429 | Monthly allowance used | Cache; upgrade the plan |
4. When you manage the listing and need every review
The Content API can’t help there, and Tripadvisor has no owner API or reply API. What works:
- Management Center: every review and the management response, by hand, one listing at a time.
- Prisma: connect the public Tripadvisor page of the hotel, restaurant or attraction you manage (no login shared) and Prisma reads its reviews on a schedule, read-only, into the same JSON as Google, Booking.com, Expedia and 40+ more, with each review’s URL so you answer in the Management Center.
H = {"Authorization": f"Bearer {os.environ['PRISMA_API_KEY']}"}
r = requests.get("https://api.prismareviews.com/v1/reviews", headers=H, params={"platform": "tripadvisor", "has_reply": "false", "limit": 100}, timeout=30)
for rev in r.json()["data"]:
print(rev["rating"], rev["author"], rev["title"], rev["text"], rev["url"])Connecting: POST /v1/connections with platform: "tripadvisor" and the listing_url (Connections). Tripadvisor is in beta, read-only, and included from the Beam plan up or on Spark with a read pack, because page reads are paid on Prisma’s side (Pricing). A review.created webhook fires per new review. The hotel reviews API page covers the other travel platforms.
FAQ
How many reviews does the Tripadvisor API return?
The Content API’s location reviews endpoint returns up to 5 recent reviews per location, meant for display with a link back to Tripadvisor. There is no endpoint for all reviews, and no owner endpoint.
Can I reply to Tripadvisor reviews through the API?
No. Tripadvisor has no reply API; management responses are written in the Management Center. Prisma returns each review with its URL so you answer there.
Is the Tripadvisor Content API free?
There is a free tier with a monthly call allowance for approved uses (displaying Tripadvisor content with attribution); you apply for a key on the developer portal. Commercial and higher-volume use is paid.
Tripadvisor, Booking.com, Google and 40+ more, one JSON.
2 locations free. Test keys return sample reviews from every platform.