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

Trip.com Hotel Filters API Documentation

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

Trip.com Hotel Filters API Documentation List the filters and sorts that the hotel search accepts for one city and stay. Each filter has the name of the search parameter and its options with the label of the site in the chosen locale. Use the values as parameters of the hotel search: stars, guest_score_min, free_cancellation, breakfast and sort. The list has ids and labels only. Trip.com gives no hotel count per filter and no district or zone ids. Cost: 1 credit. A failed request is not billed.

Trip.com Hotel Filters API Documentation 1 credit / request

Endpoint

Request preview
GET
https://scrappa.co/api/tripcom/hotels/filters
Auth header
x-api-key
Cost
1 credit / request
city_id = 1234567890 check_in = example check_out = example
Response preview
200 OK
{
    "data": {
        "count": 5,
        "locale": "en",
        "city_id": "192",
        "filters": [
            {
                "options": [
                    {
                        "label": "5",
                        "value": 5
                    },
                    {
                        "label": "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.

2 optional filters available.

city_id string Required

Trip.com city id from the suggest endpoint. Example: 192 for Paris.

Example value 1234567890
check_in string Required

Check-in date, YYYY-MM-DD, today or later. Example: 2027-03-14.

Example value example
check_out string Required

Check-out date, YYYY-MM-DD, after check-in, at most 30 nights. Example: 2027-03-16.

Example value example
currency string Optional

Price currency: USD, EUR, GBP, JPY or KRW. Defaults to USD. Every price in the answer has this currency.

Example value USD
locale string Optional

Site language: en, en-gb, de, fr, ja, ko or zh-hk. 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": {
        "count": 5,
        "locale": "en",
        "city_id": "192",
        "filters": [
            {
                "options": [
                    {
                        "label": "5",
                        "value": 5
                    },
                    {
                        "label": "4",
                        "value": 4
                    },
                    {
                        "label": "3",
                        "value": 3
                    },
                    {
                        "label": "2",
                        "value": 2
                    },
                    {
                        "label": "1",
                        "value": 1
                    }
                ],
                "multiple": true,
                "parameter": "stars"
            },
            {
                "options": [
                    {
                        "label": "Great 9+",
                        "value": 9
                    },
                    {
                        "label": "Very Good 8+",
                        "value": 8
                    },
                    {
                        "label": "Good 7+",
                        "value": 7
                    },
                    {
                        "label": "Pleasant 6+",
                        "value": 6
                    }
                ],
                "multiple": false,
                "parameter": "guest_score_min"
            },
            {
                "options": [
                    {
                        "label": "Free cancellation",
                        "value": true
                    }
                ],
                "multiple": false,
                "parameter": "free_cancellation"
            },
            {
                "options": [
                    {
                        "label": "Breakfast included",
                        "value": true
                    }
                ],
                "multiple": false,
                "parameter": "breakfast"
            },
            {
                "options": [
                    {
                        "label": "Trip.com recommended",
                        "value": "popularity"
                    },
                    {
                        "label": "Price (low to high)",
                        "value": "price_asc"
                    },
                    {
                        "label": "Price (high to low)",
                        "value": "price_desc"
                    },
                    {
                        "label": "Top reviewed",
                        "value": "top_reviewed"
                    },
                    {
                        "label": "Star rating",
                        "value": "stars"
                    },
                    {
                        "label": "Distance",
                        "value": "distance"
                    }
                ],
                "multiple": false,
                "parameter": "sort"
            }
        ],
        "check_in": "2027-03-14",
        "currency": "USD",
        "check_out": "2027-03-16"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "hotel_filters"
    },
    "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": {
        "city_id": [
            "A city id is required. Take it from the suggest endpoint, e.g. 192 for Paris."
        ]
    },
    "message": "The request validation failed"
}
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.