# Trip.com Hotel Search API Documentation

<p><strong>Trip.com Hotel Search API Documentation</strong> List the hotels of a city for a stay. Each hotel has the id, name, stars, guest score, review count, address, coordinates, price per night, original price, total price for the stay, currency, free cancellation, the room of the cheapest offer, images and an advertisement flag. Page 1 is the list page of the site. Set page to 2 or higher for the next hotels (up to page 400). Set pages (2 to 6) to read several pages in one call, starting at page 2 or higher. Rows from page 2 on have price_basis per_night_excl_taxes_and_fees: the price per night before taxes and fees. Page 1 rows have no price_basis. Do not compare prices of page 1 with prices of later pages. total_price on page 2 and later is the stay total with taxes and fees, and only when the site shows it for the stay you asked for and the amount fits the nightly price. Otherwise it is null (never the nightly price). Page 1 always has the stay total when the site shows it. free_cancellation is true or null from page 2 on: null means the site did not say. Hotels of page 1 are not repeated on page 2 and later. An ad that repeats is returned once. Filters: stars, min_price, max_price, guest_score_min (6 to 9), free_cancellation, breakfast and sort (popularity, price_asc, price_desc, top_reviewed, stars, distance). A search with guest_score_min, free_cancellation, breakfast or a sort other than popularity and price_asc is served by the paged list from page 1 on. Price sorts put the rows of one answer in exact price order. Across pages the order follows Trip.com and can overlap a little. Rows that break a filter are never returned. Use the filters endpoint for the labels. Only one room is supported. Room rate plans are not available. Cost: page 1 is 1 credit. Each page from the paged list is 3 credits, so pages=5 is 15 credits. Failed requests, empty pages and the end of the list are not billed.</p>

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

## 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 |
| --- | --- | --- | --- |
| `city_id` | string | Yes | Trip.com city id from the suggest endpoint. Example: 192 for Paris. |
| `check_in` | string | Yes | Check-in date, YYYY-MM-DD, today or later. Example: 2027-03-14. |
| `check_out` | string | Yes | Check-out date, YYYY-MM-DD, after check-in, at most 30 nights. Example: 2027-03-16. |
| `adults` | integer | No | Number of adults, 1 to 9. Defaults to 2. |
| `children_ages` | string | No | Comma separated ages of the children, 0 to 17, at most 4. Example: 5,9. |
| `stars` | string | No | Comma separated star classes, 1 to 5. Only hotels of these classes are returned. Example: 4,5. |
| `min_price` | integer | No | Minimum price per night in the chosen currency. Whole number. |
| `max_price` | integer | No | Maximum price per night in the chosen currency. Whole number. |
| `page` | integer | No | Page number, 1 to 400. Page 1 is the list page. Page 2 and later come from the paged list. Defaults to 1. |
| `pages` | integer | No | Pages to read in one call, 1 to 6. Needs page 2 or higher, or one of the paged list options. Costs 3 credits per page read. Defaults to 1. |
| `guest_score_min` | integer | No | Minimum guest score: 6, 7, 8 or 9. Only hotels with this score or higher are returned. |
| `free_cancellation` | boolean | No | Set to 1 to get hotels with free cancellation only. |
| `breakfast` | boolean | No | Set to 1 to get hotels with an offer that includes breakfast only. |
| `sort` | string | No | popularity (default), price_asc, price_desc, top_reviewed, stars or distance. price_desc, top_reviewed, stars and distance are served by the paged list. |
| `currency` | string | No | Price currency: USD, EUR, GBP, JPY or KRW. Defaults to USD. Every price in the answer has this currency. |
| `locale` | string | No | Site language: en, en-gb, de, fr, ja, ko or zh-hk. Defaults to en. |

## Example response

```json
{
    "data": {
        "page": 1,
        "sort": "popularity",
        "count": 4,
        "total": 6503,
        "adults": 2,
        "hotels": [
            {
                "bed": "1 queen bed",
                "url": "https://www.trip.com/hotels/detail/?hotelId=718146",
                "city": "Paris",
                "name": "Hotel R\u00e9gence Etoile",
                "zone": "Champs Elys\u00e9es",
                "is_ad": false,
                "stars": 4,
                "images": [
                    "https://ak-d.tripcdn.com/images/0582t12000jbiuxe0A6C0_R_600_600_R5_D.jpg_.webp",
                    "https://ak-d.tripcdn.com/images/200v11000000rkn07BFC6_R_600_600_R5_D.jpg_.webp"
                ],
                "nights": 2,
                "address": "Champs Elys\u00e9es",
                "city_id": "192",
                "name_en": "Hotel R\u00e9gence Etoile",
                "category": "Hotel",
                "currency": "USD",
                "hotel_id": "718146",
                "latitude": 48.876537,
                "position": 1,
                "longitude": 2.292983,
                "room_name": "Classic Room",
                "guest_score": 9.2,
                "total_price": 547.96,
                "review_count": 562,
                "location_hint": "Near Arc de Triomphe de l\u2019Etoile | Charles de Gaulle - \u00e9toile Metro Station",
                "price_per_night": 232,
                "free_cancellation": true,
                "guest_score_label": "Great",
                "original_price_per_night": 357
            },
            {
                "bed": "1 double bed or 2 single beds",
                "url": "https://www.trip.com/hotels/detail/?hotelId=717490",
                "city": "Paris",
                "name": "Hotel de l'Aqueduc",
                "zone": "Near Paris North Station|Le Marais",
                "is_ad": false,
                "stars": 3,
                "images": [
                    "https://ak-d.tripcdn.com/images/1mc1p12000rpkwjys2F52_R_600_600_R5_D.jpg_.webp",
                    "https://ak-d.tripcdn.com/images/0586h12000sn61efqEF75_R_600_600_R5_D.jpg_.webp"
                ],
                "nights": 2,
                "address": null,
                "city_id": "192",
                "name_en": "Hotel de l'Aqueduc",
                "category": "Hotel",
                "currency": "USD",
                "hotel_id": "717490",
                "latitude": 48.881377,
                "position": 2,
                "longitude": 2.362014,
                "room_name": "Classic Room",
                "guest_score": 8.1,
                "total_price": 214.04,
                "review_count": 388,
                "location_hint": "Near Paris North Station | Le Marais",
                "price_per_night": 86,
                "free_cancellation": false,
                "guest_score_label": "Very good",
                "original_price_per_night": 147
            }
        ],
        "locale": "en",
        "city_id": "192",
        "check_in": "2027-03-14",
        "currency": "USD",
        "check_out": "2027-03-16"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "hotel_search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid. This response is not billable. |
| 404 | Resource Not Found | The id is unknown. This response is not billable. |
| 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)
