Discover/Ctrip API
live

Ctrip APIhotels.ctrip.com

Access Ctrip (携程酒店) hotel data via 7 endpoints: search by city or keyword, retrieve room types, pricing, policies, and paginated guest reviews.

Endpoint health
verified 6d ago
get_hotel_detail
search_hotels
get_city_list
get_hotel_rooms
get_review_summary
7/7 passing latest checkself-healing
Endpoints
7
Updated
22d ago

What is the Ctrip API?

The Ctrip Hotels API provides 7 endpoints covering hotel search, property details, room availability, and guest reviews from China's Ctrip platform (携程酒店). Use search_hotels to query listings by city ID and date range, or get_hotel_detail to pull policies, facilities, nearby POIs, and reservation tips for a specific property. City IDs are resolved via get_city_list, which returns Chinese domestic cities ready to plug into other endpoints.

Try it

No input parameters required.

api.parse.bot/scraper/b25cb0e8-6958-4837-9980-1645cec5a4ce/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/b25cb0e8-6958-4837-9980-1645cec5a4ce/get_city_list' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace hotels-ctrip-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""
Ctrip Hotels API - Search hotels, browse details, rooms, and reviews.

Demonstrates city listing, hotel search, detail fetching, room availability,
review summary, and paginated review browsing.
"""
from parse_apis.ctrip_hotels_api import Ctrip, NotFoundError

ctrip = Ctrip()

# List available cities for hotel search
for city in ctrip.cities.list(limit=5):
    print(city.city_name, city.city_id, city.country_name)

# Search hotels in Shanghai via constructible City
shanghai = ctrip.city(city_id=2)
for hotel in shanghai.hotels.search(limit=3):
    print(hotel.hotel_id, hotel.hotel_name, hotel.star)

# Keyword search within Beijing
beijing = ctrip.city(city_id=1)
for result in beijing.hotels.search_by_keyword(keyword="希尔顿", limit=5):
    print(result.keyword_id, result.keyword)

# Get hotel detail with typed error handling
try:
    hotel = ctrip.hotels.get(hotel_id="445563")
    print(hotel.hotel_id, hotel.hotel_name)
except NotFoundError as exc:
    print(f"Hotel not found: {exc}")

# Get room availability and review summary for a hotel
target = ctrip.hotel(hotel_id="445563")
summary = target.get_review_summary()
print(summary.total_count, summary.comment_rating)

rooms = target.get_rooms()
print(rooms.physic_room_map, rooms.room_filter_info)

# Browse paginated reviews
for group in target.reviews.list(limit=1):
    print(group.data_type, group.record_count)
    for review in group.comment_list:
        print(review.id, review.rating, review.room_name)

print("exercised: cities.list / hotels.search / search_by_keyword / hotels.get / get_rooms / get_review_summary / reviews.list")
All endpoints · 7 totalmissing one? ·

Get popular Chinese domestic cities for hotel search. Returns city names, IDs, province IDs, and country names. Use city IDs as input to search_hotels and other endpoints.

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "cities": "array of city objects with cityName, cityId, provinceId, countryName"
  },
  "sample": {
    "data": {
      "cities": [
        {
          "cityId": 1,
          "cityName": "北京",
          "provinceId": 0,
          "countryName": "中国"
        },
        {
          "cityId": 2,
          "cityName": "上海",
          "provinceId": 0,
          "countryName": "中国"
        }
      ]
    },
    "status": "success"
  }
}

About the Ctrip API

Hotel Search and Discovery

The get_city_list endpoint returns an array of Chinese domestic cities, each with cityName, cityId, provinceId, and countryName. These IDs feed directly into search_hotels, which accepts a city_id, checkin/checkout dates in either YYYYMMDD or YYYY-MM-DD format, and pagination controls (page_index, page_size). The response includes a hotelList array with per-property pricing and room details, plus hotelListAddtionInfo for pagination metadata. For name- or landmark-based lookups, search_hotels_by_keyword accepts a free-text keyword and returns mainKeywordList with matched hotels and locations within the target city.

Property Details and Room Inventory

get_hotel_detail returns a data object covering hotelPolicy, hotelReservationTips, hotelFacility, hotelPoiInfo, guest comment summaries, and hotelIntroduction for a given hotel_id. Dates are optional but affect policy and availability context. get_hotel_rooms goes deeper into inventory: it returns physicRoomMap (physical room configurations), saleRoomMap (purchasable room options with prices), roomFilterInfo, calendarInfo, and extraInfo. This endpoint is useful for building date-specific availability checks or rate-comparison tools.

Reviews and Ratings

get_hotel_reviews returns paginated reviews via commentList inside groupList, alongside commentTagList, travelTypeList, commentRating, and totalCount. Both page_index and page_size are supported. get_review_summary covers similar ground — commentTagList, commentRating, travelTypeList, filterDateList, totalCount — and additionally includes aiSummaryEntities, which provides AI-generated highlight tags not present in the paginated review endpoint. Together these two endpoints give both high-level sentiment signals and raw review text.

Reliability & maintenanceVerified

The Ctrip API is a managed, monitored endpoint for hotels.ctrip.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when hotels.ctrip.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official hotels.ctrip.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
6d ago
Latest check
7/7 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a hotel price-comparison tool for Chinese cities using search_hotels with date and city parameters
  • Aggregate guest review sentiment across hotel categories by pulling commentTagList and commentRating from get_review_summary
  • Populate a travel app with property amenities, policies, and nearby POI data via get_hotel_detail
  • Display room type breakdowns and per-night pricing using physicRoomMap and saleRoomMap from get_hotel_rooms
  • Enable landmark-based hotel discovery by passing location names to search_hotels_by_keyword
  • Track review volume trends over time using totalCount and filterDateList from get_review_summary
  • Resolve city names to Ctrip city IDs programmatically using get_city_list before running batch hotel searches
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does Ctrip offer an official developer API?+
Ctrip has a partner program (Ctrip Open Platform) aimed at affiliated travel businesses, but it is not a publicly accessible self-serve API. Access requires a business partnership agreement. This Parse API covers the public hotel data without requiring a partner account.
What does `get_hotel_rooms` return beyond just prices?+
get_hotel_rooms returns physicRoomMap describing the physical room configurations (bed type, size, floor, etc.), saleRoomMap for purchasable options with rates, roomFilterInfo for available filter dimensions, calendarInfo for date-specific pricing context, and extraInfo for supplementary metadata. All fields are date-sensitive — pass checkin and checkout to get accurate availability and pricing.
Does the API cover international hotels outside China?+
Not currently. get_city_list returns Chinese domestic cities and their IDs; the search and detail endpoints are scoped to those cities. International Ctrip hotel listings are not covered. You can fork this API on Parse and revise it to add an endpoint targeting Ctrip's international hotel coverage.
What is the difference between `get_hotel_reviews` and `get_review_summary`?+
get_hotel_reviews is paginated and returns individual review comments inside commentList, making it suitable for reading full review text in batches. get_review_summary does not paginate reviews but adds aiSummaryEntities (AI-generated highlight tags) and filterDateList, which are absent from the paginated endpoint. Use both together if you need both raw reviews and summary-level signals.
Can I filter hotel search results by star rating, price range, or amenities?+
The search_hotels endpoint accepts city_id, date range, and pagination parameters but does not expose filter parameters for star rating, price band, or facilities in its current form. get_hotel_rooms returns roomFilterInfo at the property level. You can fork this API on Parse and revise it to add filter parameters to the search endpoint.
Page content last updated . Spec covers 7 endpoints from hotels.ctrip.com.
Related APIs in TravelSee all →
hk.trip.com API
Search and compare flights, hotels, trains, and attractions across Hong Kong's travel marketplace, with access to hotel reviews and trending destinations. Plan your complete trip by browsing real-time availability and pricing for all major transportation and accommodation options.
hotels.com API
Search for hotels across millions of properties, view room availability and pricing, and get detailed information about accommodations at specific destinations. Get location suggestions and discover popular travel spots to help plan your next getaway.
tripadvisor.com API
Search for travel destinations and discover hotels with detailed information like ratings, reviews, and amenities. Get comprehensive place details to help plan your perfect trip and compare accommodation options.
hotelscan.ai API
Search and compare hotels with detailed guest reviews, room availability, and pricing information across flexible dates. Find similar properties, get autocomplete suggestions for locations, and access comprehensive hotel details all in one place.
zh.airbnb.com API
Search for Airbnb accommodations and retrieve detailed information including property descriptions, guest reviews, availability calendars, and experience listings from the Chinese Airbnb platform. View comprehensive stay options with real-time availability data and verified guest feedback to help plan your next booking.
expedia.com API
Search for hotels and flights across Expedia while viewing detailed property information to compare prices and amenities for your travel plans. Get comprehensive travel options all from one integration without manually browsing the website.
agoda.com API
agoda.com API
trivago.com.br API
Search hotels across Trivago by destination, dates, and guest count. Filter by price range and currency, get autocomplete suggestions for locations, and retrieve detailed hotel information including star ratings, guest reviews, and pricing from multiple booking sites.