GET
TripAdvisor Hotel Reviews API
Extract comprehensive hotel reviews from TripAdvisor using the hotel's location ID.
Overview
Rich Review Data
Get detailed reviews with user profiles, ratings, photos, trip information, and engagement metrics.
The TripAdvisor Hotel Reviews endpoint provides access to detailed review data including reviewer information, stay dates, ratings, review text, photos, helpful votes, and management responses.
Endpoint URL
GET https://api.stayapi.com/v1/tripadvisor/hotel/reviews/{location_id}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| location_id | string | Required | TripAdvisor location ID (path parameter) |
| page | integer | Optional | Page number, starts at 1 (default: 1) |
| per_page | integer | Optional | Number of reviews per page (1-50, default: 10) |
| language | string | Optional | Language filter (default: "en" for English) |
Response Structure
Review Information
review_id- Unique review identifiertitle- Review titletext- Full review textrating- Overall rating (1-5)published_date- When review was postedstay_date- When the reviewer stayed
Reviewer Details
- Username and display name
- Location
- Contribution count and helpful votes
- Profile photo URL
Additional Data
- Trip type (business, couples, family, etc.)
- Review photos
- Helpful vote count
- Management response (if available)
- Room tip information
- Language of review
Finding the Location ID
Need the Location ID?
Use the /location/extract-id endpoint to extract the location ID from any TripAdvisor hotel URL.
The location ID can be found in TripAdvisor URLs. For example:
https://www.tripadvisor.com/Hotel_Review-g1224250-d305165-Reviews-Hotel.html
The location ID is 305165 (the number after "d").
Request
curl -X GET "https://api.stayapi.com/v1/tripadvisor/hotel/reviews/305165?page=1&per_page=10" \ -H "x-api-key: YOUR_API_KEY"
const locationId = "305165"; const params = new URLSearchParams({ page: "1", per_page: "10", language: "en" }); const response = await fetch( `https://api.stayapi.com/v1/tripadvisor/hotel/reviews/${locationId}?${params}`, { headers: { "x-api-key": "YOUR_API_KEY" } } ); const data = await response.json(); // Check pagination info console.log(`Page ${data.pagination.page} of ${data.pagination.total_pages}`); console.log(`Total reviews: ${data.total_count}`); // Display reviews data.reviews.forEach(review => { console.log(`${review.rating}/5 - ${review.title}`); console.log(`By: ${review.user.display_name}`); console.log(`Review: ${review.text.substring(0, 200)}...`); console.log("---"); }); // Get next page if available if (data.pagination.has_next) { console.log("More reviews available on next page"); }
import requests location_id = "305165" url = f"https://api.stayapi.com/v1/tripadvisor/hotel/reviews/{location_id}" headers = {"x-api-key": "YOUR_API_KEY"} params = { "page": 1, "per_page": 10, "language": "en" } response = requests.get(url, headers=headers, params=params) data = response.json() # Display pagination info pagination = data["pagination"] print(f"Page {pagination['page']} of {pagination['total_pages']}") print(f"Total reviews: {data['total_count']}\n") # Display individual reviews for review in data["reviews"]: print(f"{review['rating']}/5 - {review['title']}") print(f"By: {review['user']['display_name']}") print(f"Review: {review['text'][:200]}...") print("-" * 50) # Fetch next page if available if pagination["has_next"]: params["page"] = 2 next_response = requests.get(url, headers=headers, params=params) print("\nFetched page 2...")
Response
{ "success": true, "reviews": [ { "id": 874521963, "rating": 5, "title": "Exceptional luxury hotel with outstanding service", "text": "From the moment we arrived, we were treated like royalty. The staff went above and beyond to ensure our stay was perfect.", "language": "en", "created_date": "2024-01-10", "published_date": "2024-01-10", "helpful_votes": 8, "user": { "id": "ABC123", "display_name": "Sarah M", "username": "SarahM_London", "is_verified": false, "contribution_count": 47, "hometown": "London, UK", "avatar_url": "https://media-cdn.tripadvisor.com/..." }, "trip_info": { "stay_date": "2023-12-15", "trip_type": "COUPLES" }, "additional_ratings": { "value": 5, "service": 5, "cleanliness": 5 }, "photos": [], "review_url": "https://www.tripadvisor.com/ShowUserReviews-..." } ], "total_count": 336, "review_count": 10, "location_id": 305165, "pagination": { "page": 1, "per_page": 10, "total_count": 336, "total_pages": 34, "has_next": true, "has_previous": false } }
{ "error": "Hotel not found", "detail": "No hotel found with location ID: 999999", "status_code": 404 }