GET
# TripAdvisor Hotel Subratings API

Retrieve a hotel's aggregate TripAdvisor category ratings by location ID.

## Overview

#### Six category scores

Returns Location, Rooms, Value, Cleanliness, Service, and Sleep Quality on TripAdvisor's 1–5 rating scale.

Use subratings to compare the parts of the guest experience that an overall bubble rating hides. Values are returned as numbers rounded to two decimal places. A category can be `null` when TripAdvisor has not published enough data for it.

### Endpoint URL

GET https://api.stayapi.com/v1/tripadvisor/hotel/subratings/{location\_id} 

## Path parameter

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| location\_id | integer | Yes | The number after `d` in a TripAdvisor hotel URL, for example `236154`. |

## Response fields

The `data` object always contains these keys:

- `location`
- `rooms`
- `value`
- `cleanliness`
- `service`
- `sleep_quality`

## Errors

- **404** — no category ratings were found for the location ID.
- **502** — TripAdvisor returned unavailable or malformed rating data.
- **503 / 504** — the service is temporarily busy or the request timed out; retry shortly.

Request

```curl
curl -X GET "https://api.stayapi.com/v1/tripadvisor/hotel/subratings/236154" \
  -H "x-api-key: YOUR_API_KEY"
```

Response

```json
{
  "success": true,
  "location_id": 236154,
  "data": {
    "location": 4.86,
    "rooms": 4.36,
    "value": 4.38,
    "cleanliness": 4.65,
    "service": 4.59,
    "sleep_quality": 4.55
  },
  "message": "Successfully retrieved TripAdvisor hotel subratings",
  "retrieved_at": "2026-07-13T11:06:07.976853Z"
}
```

```json
{
  "type": "https://api.stayapi.com/errors/not-found",
  "title": "Hotel Subratings Not Found",
  "status": 404,
  "detail": "No category ratings found for this TripAdvisor location ID.",
  "error_code": "NOT_FOUND",
  "provider": "tripadvisor",
  "location_id": 999999
}
```
