Hotel Reviews

In addition to showing the aggregate ratings, it is also possible to query the individual ratings. You can access the reviews by passing the hotelId to the /data/reviews endpoint.

const options = {
  method: 'GET',
  headers: {
    accept: 'application/json',
    'X-API-Key': 'sand_c0155ab8-c683-4f26-8f94-b5e92c5797b9'
  }
};

fetch('https://api.liteapi.travel/v3.0/data/reviews?hotelId=lp3803c&timeout=4', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

The response will be in JSON with a data containing an array of all the individual reviews that can be iterated over and displayed.

{
  "data": [
    {
      "averageScore": 9,
      "country": "us",
      "type": "family with young children",
      "name": "Daisha",
      "date": "2024-06-20 04:10:14",
      "headline": "The stay was pleasant ,...",
      "language": "en",
      "pros": "it was beachfront , so it wasn’t a far walk at all .",
      "cons": "the kitchen area could have been more nicer ."
    },
    {
      "averageScore": 4,
      "country": "us",
      "type": "young couple",
      "name": "Diandra",
      "date": "2024-06-20 23:46:40",
      "headline": "Palette Myrtle Beach spares every...",
      "language": "en",
      "pros": "Spacious 1 bedroom Suite with a full kitchen. Comfy bed.",
      "cons": "Balcony door was stuck for duration of stay. Maintenance failed to fix on two attempts. Living room air conditioner was not producing cold air. The only other a c. unit in the suite was in the bedroom..."
    },
    ...
  ]
}
<h2>Reviews</h2>
<div>
  <h3>Daisha - The stay was pleasant,...</h3>
  <p>Score: 9/10</p>
  <p>Date: 2024-06-20</p>
  <p>Pros: it was beachfront, so it wasn’t a far walk at all.</p>
  <p>Cons: the kitchen area could have been nicer.</p>
</div>
<div>
  <h3>Diandra - Palette Myrtle Beach spares every...</h3>
  <p>Score: 4/10</p>
  <p>Date: 2024-06-20</p>
  <p>Pros: Spacious 1 bedroom Suite with a full kitchen. Comfy bed.</p>
  <p>Cons: Balcony door was stuck for duration of stay. Maintenance failed to fix on two attempts. Living room air conditioner was not producing cold air. The only other a/c unit in the suite was in the bedroom...</p>
</div>

Review Sentiment

To enable sentiment set the getSentiment flag to true when querying hotel reviews. This will return an AI sentiment analysis of the last 1000 reviews. These reviews are broken down into categories and given a 1-10 scale. A list of common pros and cons are also returned.

Example sentiment analysis:

"sentimentAnalysis": {
    "categories": [
      {
        "name": "Cleanliness",
        "rating": 5.9,
        "description": "Mixed reviews on cleanliness with some guests mentioning dirty rugs, uncomfortable beds, and rude staff, while others appreciated the cleanliness of the rooms."
      },
      {
        "name": "Service",
        "rating": 7.6,
        "description": "Service was a point of contention, with some guests praising the friendly staff and the efforts to accommodate guests, but others complained about rude staff and long wait times for elevators."
      },
      {
        "name": "Location",
        "rating": 8.3,
        "description": "The hotel's location was a standout feature, with many guests appreciating its proximity to key landmarks and attractions."
      },
      {
        "name": "Room Quality",
        "rating": 4.9,
        "description": "Rooms received mixed reviews, with complaints about outdated rooms, uncomfortable beds, and noisy renovations, alongside positive comments about clean bedrooms and comfortable beds."
      },
      {
        "name": "Amenities",
        "rating": 6.7,
        "description": "Guests were divided on amenities, with some highlighting the lack of basic facilities like restaurant and lounges, while others appreciated the clean bedrooms and gym facilities."
      },
      {
        "name": "Value for Money",
        "rating": 5.5,
        "description": "Opinions on value for money were split, with some guests feeling the hotel was overpriced for the services offered, while others found it reasonable given the location."
      },
      {
        "name": "Food and Beverage",
        "rating": 6.9,
        "description": "Feedback on food and beverage services was mixed, with some guests criticizing the limited breakfast options, while others found it satisfactory."
      },
      {
        "name": "Overall Experience",
        "rating": 6.3,
        "description": "Most guests had a mixed experience, with some enjoying their stay and recommending the hotel, while others reported disappointing experiences."
      }
    ],
    "pros": [
      "Location",
      "Friendly staff",
      "Near Times Square",
      "Clean rooms",
      "View",
      "Bed cleanliness"
    ],
    "cons": [
      "Limited parking",
      "Expensive breakfast",
      "No spa services",
      "Dated rooms",
      "Uncomfortable beds",
      "Rude staff",
      "Noisy renovations",
      "Lack of basic amenities",
      "Overpriced rooms",
      "Limited food options",
      "Unsatisfactory value for money",
      "Heating issues",
      "Stained towels and bathrooms",
      "Delayed deposit refund"
    ]
  }
}

Summary

Hotels commonly have over a thousand reviews; sentiment analysis is a helpful way to condense review data into digestible snippets and provide information on the categories most important to the guest. By providing a summary and allowing users to access the detailed reviews, they can choose the level of detail they want.