Hotel Reviews
Ce contenu n’est pas encore disponible dans votre langue.
Overview
Section titled “Overview”The Hotel Reviews resource provides fake hotel review data with ratings, titles, comments, and user associations.
Endpoints
Section titled “Endpoints”| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/hotel-reviews | List all hotel reviews |
| GET | /v1/hotel-reviews/:id | Get a specific hotel review |
Hotel Review Object
Section titled “Hotel Review Object”{ "id": 1, "hotelId": 1, "userId": 1, "rating": 5, "title": "Amazing stay!", "comment": "The service was exceptional and the room was pristine.", "createdAt": "2026-01-15T10:30:00.000Z", "updatedAt": "2026-01-15T10:30:00.000Z"}| Field | Type | Description |
|---|---|---|
id |
number |
Unique identifier |
hotelId |
number |
ID of the hotel |
userId |
number |
ID of the user |
rating |
number |
Rating (1–5) |
title |
string |
Review title |
comment |
string |
Review comment |
createdAt |
string |
ISO 8601 timestamp |
updatedAt |
string |
ISO 8601 timestamp |
List Hotel Reviews
Section titled “List Hotel Reviews”curl https://api.phantomjson.app/v1/hotel-reviewsQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page |
number |
1 |
Page number |
limit |
number |
20 |
Items per page (max: 100) |
sort |
string |
— | Sort field and direction |
q |
string |
— | Search query |
fields |
string |
— | Fields to return |
Response
Section titled “Response”{ "data": [ { "id": 1, "hotelId": 1, "userId": 1, "rating": 5, "title": "Amazing stay!", "comment": "The service was exceptional." } ], "meta": { "total": 150, "page": 1, "limit": 20, "totalPages": 8 }}Get Hotel Review by ID
Section titled “Get Hotel Review by ID”curl https://api.phantomjson.app/v1/hotel-reviews/1Response
Section titled “Response”{ "data": { "id": 1, "hotelId": 1, "userId": 1, "rating": 5, "title": "Amazing stay!", "comment": "The service was exceptional and the room was pristine." }}Examples
Section titled “Examples”Search Hotel Reviews
Section titled “Search Hotel Reviews”curl "https://api.phantomjson.app/v1/hotel-reviews?q=exceptional"Sort by Rating
Section titled “Sort by Rating”# Lowest firstcurl "https://api.phantomjson.app/v1/hotel-reviews?sort=rating:asc"
# Highest firstcurl "https://api.phantomjson.app/v1/hotel-reviews?sort=rating:desc"Sort by Date
Section titled “Sort by Date”# Oldest firstcurl "https://api.phantomjson.app/v1/hotel-reviews?sort=createdAt:asc"
# Newest firstcurl "https://api.phantomjson.app/v1/hotel-reviews?sort=createdAt:desc"Field Selection
Section titled “Field Selection”curl "https://api.phantomjson.app/v1/hotel-reviews?fields=id,hotelId,rating,title"Relations
Section titled “Relations”- Hotel — Each review belongs to a hotel (
hotelId) - User — Each review belongs to a user (
userId)
