Browse documentation

Trip.com Hotel Search API

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

Endpoint

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

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

Parameters

NameTypeRequiredDescription
city_idintegerYesPositive Trip.com city ID; Shanghai is 2 and Hangzhou is 17.
check_indateYesYYYY-MM-DD; today or later.
check_outdateYesAfter check-in; maximum 30 nights.
currencystringNoCurrency code; default USD, normalized to uppercase.
adultsintegerNo1–6; default 2.
roomsintegerNo1–6; default 1.
limitintegerNo1–10; default 10. First page only.

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

Request example

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'

Success response

Illustrative example; room offers and prices vary by stay.

{
  "success": true,
  "city_id": 17,
  "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
}

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