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
| Name | Type | Required | Description |
|---|---|---|---|
city_id | integer | Yes | Positive Trip.com city ID; Shanghai is 2 and Hangzhou is 17. |
check_in | date | Yes | YYYY-MM-DD; today or later. |
check_out | date | Yes | After check-in; maximum 30 nights. |
currency | string | No | Currency code; default USD, normalized to uppercase. |
adults | integer | No | 1–6; default 2. |
rooms | integer | No | 1–6; default 1. |
limit | integer | No | 1–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¤cy=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.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.