# Trip.com Hotel Rooms API Documentation

<p><strong>Trip.com Hotel Rooms API Documentation</strong> Get the room rates of one hotel for one stay. Each room has an id, name, bed, a photo and its rates. Each rate has the price per night and the total for the stay as numbers in the requested currency, taxes, breakfast, cancellation terms, payment type and rooms left. Take the hotel id from the hotel search or suggest endpoint. <strong>Rate data is available for a subset of hotels only</strong> (about 25 percent in our test): for every other hotel Trip.com publishes no rates and the call answers 404 ROOMS_NOT_AVAILABLE. That answer costs nothing and is remembered for 3 hours, so a repeat call is fast. A call with rates takes up to about 40 seconds because a browser must start first. Only the rates that Trip.com shows on its own page are listed. Cost: 10 credits per successful call. Failed calls, ROOMS_NOT_AVAILABLE and empty answers cost 0.</p>

- **Documentation:** [https://scrappa.co/docs/tripcom-api/tripcom_hotels_rooms](https://scrappa.co/docs/tripcom-api/tripcom_hotels_rooms)
- **API group:** Trip.com API
- **Endpoint:** `GET https://scrappa.co/api/tripcom/hotels/rooms`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `hotel_id` | string | Yes | Trip.com hotel id from the search or suggest endpoint. Example: 436887. |
| `check_in` | string | Yes | Check-in date, YYYY-MM-DD, today or later. |
| `check_out` | string | Yes | Check-out date, YYYY-MM-DD, after check-in. |
| `adults` | integer | No | Adults, 1 to 9. Defaults to 2. |
| `children_ages` | string | No | Up to 6 ages from 0 to 17, separated by commas. Example: 4,9. |
| `currency` | string | No | Price currency, for example EUR or USD. Defaults to USD. |
| `locale` | string | No | Site language, for example en or de. Defaults to en. |

## Example response

```json
{
    "data": {
        "rooms": [
            {
                "bed": "3 single beds",
                "name": "Triple Room",
                "rates": [
                    {
                        "meal": "Meals not included",
                        "payment": "Prepay Online",
                        "rate_id": "1846957914",
                        "bookable": true,
                        "currency": "EUR",
                        "rooms_left": 4,
                        "price_total": 490.43,
                        "cancellation": "Non-refundable",
                        "taxes_included": 81.74,
                        "price_per_night": 245.22,
                        "free_cancellation": false,
                        "breakfast_included": false
                    }
                ],
                "room_id": "328536850",
                "photo_url": "https://example.com/room.jpg",
                "cheapest_price": 490.43
            }
        ],
        "total": 1,
        "adults": 2,
        "locale": "en",
        "nights": 2,
        "check_in": "2027-03-14",
        "currency": "EUR",
        "hotel_id": "436887",
        "check_out": "2027-03-16",
        "children_ages": []
    },
    "meta": {
        "credits": 10,
        "billable": true,
        "endpoint_family": "hotel_rooms"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid. This response is not billable. |
| 404 | Rooms Not Available | Trip.com publishes room rates for a subset of hotels only. This hotel is not in it. This response is not billable and is remembered for 3 hours. |
| 502 | Unexpected Upstream Answer | Trip.com answered with a page or payload Scrappa cannot read. This response is not billable. Retry later. |
| 503 | Upstream Unavailable | Trip.com did not answer after one retry. This response is not billable. Retry later. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
