Trip.com Hotel Search API
Find hotels for a city and stay, compare source prices, then use a returned hotel_id for reviews.
Copy for your AI agent
Paste into Claude, ChatGPT, Cursor or Copilot — endpoint, parameters, response fields and a curl example in Markdown.
Overview
Authenticate with X-API-Key: YOUR_API_KEY. The MCP equivalent is tripcom_search_hotels.
Endpoint URL
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.amountis 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_amountandtaxes_and_feespreserve source payment-breakdown amounts for the requested rooms and nights, or null when unavailable. Totals can exclude charges payable locally at the property.total_displayandexplanationpreserve source text;detailspreserves source title/content fields.notespreserves 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.
priceis 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_includedis true if any returned hotel has a price.returnedcounts cards;totalis the upstream count. Onlypage: 1is 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_idandnameare nullable strings.bedscontains source bed text;bed_detailscontains nullableroom_nameand abedslist.displayed_guests.adultsanddisplayed_guests.childrenare nullable displayed counts, not capacity or occupancy guarantees.badges,promotions,discount_labelsandactivity_labelsare source labels. Do not infer refundable, breakfast or smoking policies.trip_coinspreserves nullable title/content text, not a derived cash value.- Hotel
category,position_descriptionandis_sponsoredare nullable;areas, feature-titlehighlightsandawardsare string lists. Missing lists are empty. price.original_amountandprice.original_displaypreserve 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.