GET
# Trip.com Hotel Reviews API

Extract comprehensive hotel reviews from Trip.com with detailed ratings, guest feedback, and filter options for sentiment analysis.

## Overview

#### Multi-Provider Reviews

Each review includes source: tripcom, ctrip, expedia, hotelscom, tripadvisor, or unknown. Attribution follows explicit review evidence; aggregate Expedia rating counts do not identify individual review origin. Token and signature fields are excluded; public aggregate rating metadata is retained.

The Trip.com Hotel Reviews endpoint provides access to comprehensive review data including guest ratings, detailed comments, check-in dates, and sentiment filters. Reviews can be filtered by positive, negative, or those with photos/videos.

### Endpoint URL

GET https://api.stayapi.com/v1/tripcom/hotel/reviews/{hotel\_id} 

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| hotel\_id | integer | Required | Trip.com hotel ID (path parameter, e.g., 702258) |
| page | integer | Optional | Page number for pagination (starts at 1, default: 1) |
| page\_size | integer | Optional | Number of reviews per page (default: 10, max: 50) |
| currency | string | Optional | Currency code (default: USD) |
| locale | string | Optional | Locale string (default: en-XX) |

## Response Format

### Success Response

total\_reviews is the hotel aggregate, not the number of reviews guaranteed to be retrievable. pageable\_reviews is the current feed count (totalCountForPage); it can be lower than the aggregate. A positive aggregate with zero pageable reviews returns an empty successful page. Missing or malformed upstream review payloads return 502. An out-of-range page also returns an empty reviews array with the totals preserved. A complete response with zero aggregate and zero pageable reviews is also a successful empty page.

```
{
  "success": true,
  "hotel_id": 702258,
  "data": {
    "total_reviews": 919,
    "totalCountForPage": 850,
    "pageable_reviews": 850,
    "reviews": [...],
    "filterList": [...],
    "imageDomain": "ak-d.tripcdn.com"
  },
  "retrieved_at": "2025-01-23T12:00:00Z"
}
```

### Review Object Structure

#### Core Fields

- `id` - Review identifier from Trip.com
- `rating` - Review score (1-10 scale)
- `title` - Rating label (e.g., "Very good", "Great")
- `text` - Full review text
- `date` - Review creation date
- `stay_date` - Guest's check-in date
- `reviewer_name` - Guest name
- `room_type` - Room type booked
- `travel_type` - Trip type (e.g., "Business traveler", "Family")
- `images` - Array of review image URLs

#### Filter List Object

- `id` - Filter identifier
- `name` - Filter name (e.g., "Positive reviews", "Negative reviews")
- `commentCount` - Number of reviews matching filter
- `filterType` - Type of filter (1 = sentiment, 2 = category)

## Error Responses

400
### Bad Request

Invalid hotel ID or parameter values

401
### Unauthorized

Missing or invalid API key

500
### Internal Server Error

Failed to fetch reviews from Trip.com

## Usage Tips

#### Pagination Info

Use page\_size up to 50 reviews per request. Calculate current feed pages by rounding up pageable\_reviews (the alias of totalCountForPage) divided by page\_size. total\_reviews is the hotel aggregate, not a pagination bound.

### Best Practices

- Start with page 1 and increment sequentially for pagination
- Use the filterList to understand review sentiment distribution
- Use pageable\_reviews (totalCountForPage) to bound pagination; stop on an empty page and do not paginate toward the hotel aggregate total\_reviews
- Cache review data as it doesn't change frequently
- Use each review’s source: tripcom, ctrip, expedia, hotelscom, tripadvisor, or unknown
- Use page\_size=50 for fewer API calls when fetching the available review feed

Request

```curl
curl -X GET "https://api.stayapi.com/v1/tripcom/hotel/reviews/702258?page=1&page_size=10" \
  -H "X-API-Key: YOUR_API_KEY"
```

Response

```json
{
  "success": true,
  "hotel_id": 702258,
  "data": {
    "imageDomain": "ak-d.tripcdn.com",
    "total_reviews": 919,
    "totalCountForPage": 850,
    "pageable_reviews": 850,
    "filterList": [
      {
        "id": 1,
        "name": "All reviews",
        "commentCount": 919,
        "filterType": 1
      },
      {
        "id": 2,
        "name": "Positive reviews",
        "commentCount": 863,
        "filterType": 1
      }
    ],
    "reviews": [
      {
        "id": 1622571051,
        "source": "tripcom",
        "rating": 9,
        "title": "Great",
        "text": "Generally it was a pleasant stay and experience. It is next to a premium Mall...",
        "date": "2025-11-05 10:30:00",
        "stay_date": "2025-11-01 00:00:00",
        "reviewer_name": "John D.",
        "room_type": "Deluxe Room",
        "travel_type": "Business traveler",
        "images": [],
        "owner_response": {
          "text": "Dear John, thank you for the great review! We are delighted you enjoyed the location and look forward to welcoming you back.",
          "published_date": "2025-11-08 09:00:00",
          "author": null
        }
      },
      {
        "id": 1622572098,
        "source": "unknown",
        "rating": 8,
        "title": "Very good",
        "text": "Great location, friendly staff, and clean rooms. Would definitely recommend!",
        "date": "2025-09-20 14:22:00",
        "stay_date": "2025-09-15 00:00:00",
        "reviewer_name": "Sarah M.",
        "room_type": "Standard Room",
        "travel_type": "Family",
        "images": ["https://ak-d.tripcdn.com/images/example.jpg"],
        "owner_response": null
      }
    ]
  },
  "retrieved_at": "2025-01-23T12:00:00Z"
}
```

```json
{
  "error": {
    "code": "INVALID_HOTEL_ID",
    "message": "The provided hotel ID is invalid or not found",
    "status": 400
  }
}
```
