Skip to content
Scrappa Get API key
Trip.com API 1 credit / request

Trip.com Hotel Rooms API Documentation

GET https://scrappa.co/api/tripcom/hotels/rooms

Trip.com Hotel Rooms API Documentation 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. Rate data is available for a subset of hotels only (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.

Trip.com Hotel Rooms API Documentation 1 credit / request

Endpoint

Request preview
GET
https://scrappa.co/api/tripcom/hotels/rooms
Auth header
x-api-key
Cost
1 credit / request
hotel_id = 1234567890 check_in = example check_out = example
Response preview
200 OK
{
    "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,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

3 required parameters needed before sending a request.

4 optional filters available.

hotel_id string Required

Trip.com hotel id from the search or suggest endpoint. Example: 436887.

Example value 1234567890
check_in string Required

Check-in date, YYYY-MM-DD, today or later.

Example value example
check_out string Required

Check-out date, YYYY-MM-DD, after check-in.

Example value example
adults integer Optional

Adults, 1 to 9. Defaults to 2.

Example value 10
children_ages string Optional

Up to 6 ages from 0 to 17, separated by commas. Example: 4,9.

Example value example
currency string Optional

Price currency, for example EUR or USD. Defaults to USD.

Example value USD
locale string Optional

Site language, for example en or de. Defaults to en.

Example value en-US

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "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

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A query parameter is missing or invalid. This response is not billable.

{
    "errors": {
        "hotel_id": [
            "A hotel id is required. Take it from the suggest or search endpoint."
        ]
    },
    "message": "The request validation failed"
}
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.

{
    "meta": {
        "billable": false,
        "retryable": false,
        "endpoint_family": "hotel_rooms"
    },
    "error": {
        "code": "ROOMS_NOT_AVAILABLE",
        "message": "Trip.com does not publish room rates for this hotel. Rate data is available for a subset of hotels only."
    },
    "success": false
}
502

Unexpected Upstream Answer

Trip.com answered with a page or payload Scrappa cannot read. This response is not billable. Retry later.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "trip_com"
    },
    "error": {
        "code": "PARSER_DRIFT",
        "message": "The Trip.com API is temporarily unavailable. Please retry."
    },
    "success": false
}
503

Upstream Unavailable

Trip.com did not answer after one retry. This response is not billable. Retry later.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "trip_com"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "The Trip.com API is temporarily unavailable. Please retry."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.