GET
# Trip.com Hotel Search API

Find hotels for a city and stay, compare source prices, then use a returned hotel\_id for reviews.

## Overview

Authenticate with `X-API-Key: YOUR_API_KEY`. The MCP equivalent is `tripcom_search_hotels`.

### Endpoint URL

GET https://api.stayapi.com/v1/tripcom/hotels/search 

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| city\_id | integer | Required | Positive Trip.com city ID; Shanghai is 2 and Hangzhou is 17. |
| check\_in | date | Required | YYYY-MM-DD; today or later. |
| check\_out | date | Required | After check-in; maximum 30 nights. |
| hotel\_name | string | Optional | Native hotel-name keyword, trimmed 1–200 characters; no control characters. City and dates remain required. |
| currency | string | Optional | Currency code; default USD, normalized to uppercase. |
| adults | integer | Optional | 1–6; default 2. |
| rooms | integer | Optional | 1–6; default 1. |
| limit | integer | Optional | 1–20; default 10. First page only. |

Use the numeric city ID from a Trip.com city URL. No city-name resolver, children, sorting, additional filters, or later pages are supported.

The response echoes normalized `hotel_name`, or null when omitted. Name matching follows the source and does not guarantee an exact match. Verified no matches return successful empty results. For example, add `hotel_name=Hilton` to a city/stay search.

## Price meaning and limits

- `price.amount` is the displayed advertised price. Its nightly/stay basis and tax inclusion are unspecified; it may be rounded. Do not multiply it to calculate a stay total.
- `total_amount` and `taxes_and_fees` preserve source payment-breakdown amounts for the requested rooms and nights, or null when unavailable. Totals can exclude charges payable locally at the property. `total_display` and `explanation` preserve source text; `details` preserves source title/content fields. `notes` preserves additional-charge notices: a quoted prepayment can exclude amounts due at the hotel.
- The example's USD 37 advertised display differs from its USD 77.64 quoted payment amount; the explanation rounds the total to USD 78.
- `price` is null when no usable public price is returned. Missing metadata is nullable. Neither a missing price nor a search card proves availability or bookability.
- `prices_included` is true if any returned hotel has a price. `returned` counts cards; `total` is the upstream count. Only `page: 1` is exposed.
- Prices may change before booking. Trip.com identifiers are provider-specific.

## Selected room and hotel-card context

`selected_room` describes the first offer on the search card, the same offer used for `price`. It is not full room inventory and is null when absent. Room names retain complete source wording, including qualifiers such as “Non Smoking” when supplied.

- `room_id` and `name` are nullable strings. `beds` contains source bed text; `bed_details` contains nullable `room_name` and a `beds` list.
- `displayed_guests.adults` and `displayed_guests.children` are nullable displayed counts, not capacity or occupancy guarantees.
- `badges`, `promotions`, `discount_labels` and `activity_labels` are source labels. Do not infer refundable, breakfast or smoking policies. `trip_coins` preserves nullable title/content text, not a derived cash value.
- Hotel `category`, `position_description` and `is_sponsored` are nullable; `areas`, feature-title `highlights` and `awards` are string lists. Missing lists are empty.
- `price.original_amount` and `price.original_display` preserve source crossed-out values, or null. No discount arithmetic or additional price-basis inference is applied.

## Errors

Non-2xx errors use RFC 7807 Problem Details with `provider: "tripcom"` and a correlation ID. Invalid inputs return 400 or 422; upstream failures or mismatched request context return 502; timeouts return 504.

[Read reviews for a returned hotel ID](/docs/endpoints/tripcom/hotel-reviews)

Illustrative example; room offers and prices vary by stay.

Request

```curl
curl 'https://api.stayapi.com/v1/tripcom/hotels/search?city_id=17&check_in=2026-11-14&check_out=2026-11-16&currency=USD&adults=2&rooms=1&limit=1' -H 'X-API-Key: YOUR_API_KEY'
```

Response

```json
{
  "success": true,
  "city_id": 17,
  "hotel_name": null,
  "check_in": "2026-11-14",
  "check_out": "2026-11-16",
  "adults": 2,
  "rooms": 1,
  "currency": "USD",
  "hotels": [
    {
      "hotel_id": 106246641,
      "name": "Hangzhou Xixi Rezen Hotel",
      "name_en": "Hangzhou Xixi Rezen Hotel",
      "star_rating": 5,
      "guest_rating": 9.3,
      "review_count": 4589,
      "review_summary": "Very Good",
      "address": "Xixi Wetland Park Area",
      "city_id": 17,
      "city": "Hangzhou",
      "latitude": 30.230964410736657,
      "longitude": 120.04509614968305,
      "image": "https://ak-d.tripcdn.com/images/1mc6o12000b19wjmk693A_R_600_600_R5_D.jpg_.webp",
      "url": "https://www.trip.com/hotels/detail/?hotelId=106246641",
      "price": {
        "amount": 37.0,
        "currency": "USD",
        "basis": "advertised_price",
        "taxes_included": null,
        "total_amount": 77.64,
        "taxes_and_fees": 4.36,
        "total_display": "US$77.64",
        "explanation": "Total price: US$78\n1 room × 2 nights incl. taxes & fees",
        "notes": [],
        "details": {
          "total": {
            "title": "Prepay Online",
            "content": "US$77.64"
          },
          "payTax": {
            "title": "Taxes & fees",
            "content": "US$4.36"
          }
        },
        "original_amount": 52.0,
        "original_display": "US$52"
      },
      "category": "Hotel",
      "position_description": "Near Xixi National Wetland Park | Zhejianggongye University (pingfengxiaoqu)",
      "areas": [
        "Xixi Wetland Park Area"
      ],
      "highlights": [],
      "awards": [],
      "is_sponsored": true,
      "selected_room": {
        "room_id": "1880932053",
        "name": "Designer Space Red",
        "beds": [
          "1 queen bed"
        ],
        "bed_details": [
          {
            "room_name": "Bedroom 1",
            "beds": [
              "1 queen bed (1.8m wide)"
            ]
          }
        ],
        "displayed_guests": {
          "adults": 2,
          "children": 0
        },
        "badges": [
          "Free Cancellation"
        ],
        "promotions": [
          "China travel deal",
          "Surprise Savings",
          "Multi-night Discount"
        ],
        "discount_labels": [
          "28% off"
        ],
        "activity_labels": [
          "Last booked 1 hr ago"
        ],
        "trip_coins": {
          "title": "Receive after stay",
          "content": "Earn 39 Trip Coins (≈US$0.39)"
        }
      }
    }
  ],
  "returned": 1,
  "total": 100,
  "page": 1,
  "prices_included": true
}
```

```json
{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "Invalid request parameters",
  "instance": "/v1/tripcom/hotels/search",
  "provider": "tripcom",
  "correlation_id": "example-correlation-id"
}
```
