GET

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

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
Browse documentation