Tony Wang6 min readHow to Scrape Trip.com in 2026 (API & Python)
Scrape Trip.com hotel search and detail data in 2026 — DIY, no-code, or a structured API, hotel-only coverage, plus the legal basics.
The fastest way to scrape Trip.com in 2026 is to call a structured API that returns normalized JSON for hotel search and hotel detail, instead of replicating Trip.com's internal endpoints yourself. Trip.com (Trip.com Group, formerly Ctrip) is one of the largest OTAs out of Asia, but this guide is upfront about scope: the coverage here is hotel search and hotel detail only. Unlike our Booking.com, Agoda, or Expedia guides, there's no flights, trains, car rental, or activities surface in this API — Trip.com sells those as separate, much larger products, and a self-serve read API for them doesn't exist. This guide covers all three approaches for what's actually available, plus the legal basics.
Why scrape Trip.com data?
Trip.com's hotel data supports a few recurring use cases:
- Hotel price and availability monitoring — track how a property's nightly rate moves over time.
- OTA rate-parity checks — compare a hotel's Trip.com price against Booking.com, Agoda, or Expedia for the same dates.
- Market research, especially APAC travel — Trip.com Group (Ctrip, Trip.com, Skyscanner) is one of the dominant OTAs across mainland China and broader Asia, so its hotel supply and pricing are a useful signal for regional travel demand.
- AI travel pipelines — feed normalized hotel search and detail JSON into an agent or itinerary tool instead of scraping HTML on the fly.
Is it legal to scrape Trip.com?
Option 1: DIY in Python (and why it breaks)
Trip.com's hotel search and detail pages render from internal calls behind client-side JavaScript, so a DIY scraper has to replicate those requests:
import requests
# Trip.com's hotel-list UI calls internal endpoints that aren't documented for public use
resp = requests.get(
"https://www.trip.com/hotels/bangkok-hotels-list-359/",
headers={"User-Agent": "Mozilla/5.0 (compatible; research-bot/1.0)"},
)
It demos and then breaks:
- No open self-serve API. Trip.com's real Partner API is a supplier/aggregator integration for travel agencies and OTAs, and the Affiliate Program's data feed is for approved publishers — neither is a signup form for pulling hotel data for research.
- robots.txt disallows the exact pages you'd scrape. Hotel detail pages and search-result pages are both blocked for general crawlers, and so are the internal API paths those pages call.
- Internal endpoints, no stability guarantee. The request shapes behind city hotel-list and hotel-detail pages aren't a public contract; Trip.com can change parameters, headers, or response fields without notice.
- City identifiers aren't obvious. Trip.com's own URLs encode a numeric city id (
bangkok-hotels-list-359) alongside a slug — you need both, and there's no public lookup endpoint to resolve a city name to that id.
Option 2: No-code / ready-made tools
A handful of marketplace scraper actors target Trip.com hotel listings for an occasional one-off pull, but they inherit the same anti-bot and internal-endpoint fragility as DIY, and none of them cover flights, trains, or activities — Trip.com's non-hotel products aren't really in scope for general-purpose scrapers.
Option 3: A structured Trip.com API
For a repeatable hotel-data workflow, a Trip.com scraping API returns normalized JSON with no browser fleet or endpoint reverse-engineering — but be clear-eyed that it's hotel search and detail only. Search hotels by city:
curl "https://api.crawlora.net/api/v1/tripcom/hotels/search?city_slug=bangkok&city_id=359" \
-H "x-api-key: $CRAWLORA_API_KEY"
Pull full detail for a hotel from that search result in Python:
import requests
h = {"x-api-key": "YOUR_API_KEY"}
base = "https://api.crawlora.net/api/v1"
search = requests.get(f"{base}/tripcom/hotels/search", headers=h, params={
"city_slug": "bangkok", "city_id": 359,
}).json()["data"]
hotel_id = search["hotels"][0]["hotel_id"]
detail = requests.get(f"{base}/tripcom/hotels/{hotel_id}", headers=h).json()["data"]
A hotel search result is normalized JSON (real fields — check the docs):
{
"code": 200,
"msg": "OK",
"data": {
"city_slug": "bangkok",
"city_id": "359",
"count": 9,
"hotels": [
{
"hotel_id": 39371462,
"name": "Divalux Resort and Spa Bangkok, Suvarnabhumi Airport-Free Shuttle",
"url": "https://www.trip.com/hotels/bang-sao-thong-district-hotel-detail-39371462/divalux-resort-and-spa-bangkok-suvarnabhumi-airport-free-shuttle/",
"star_rating": 5,
"rating_score": 8.7,
"review_count": 872,
"price": { "raw": "US$38", "currency": "US$", "amount": 38, "unit": "1 night" }
}
],
"source_url": "https://www.trip.com/hotels/bangkok-hotels-list-359/"
}
}
Hotel detail adds location (address, zone, lat/lng, transit description), a rating breakdown (cleanliness, amenities, location, service), policy (check-in/out, child policy), popular_facilities, images, and highlights. Store one row per hotel per pull date, and re-run on a schedule to track price movement.
What you can collect
Public hotel data only: search results (hotel id, name, url, star rating, review score and count, short description, source image, nightly price) and hotel detail (full address and geo-coordinates, open year, highlights, rating breakdown by category, check-in/child policy, popular facilities, image gallery, description, source URL). There is no flights, trains, car rental, activities, or reviews endpoint in this catalog group.
Limitations
- Hotels only. This is the narrowest catalog group in this how-to-scrape series — no flights, trains, car rental, or activities, unlike the Agoda or Expedia guides. If you need Trip.com flight or train data, that's a materially bigger integration this API doesn't cover.
- Search needs a known city id, not free text.
city_slugandcity_idare both required — you resolve those from a Trip.com city URL first; there's no keyword-to-city lookup here. - No open self-serve official API. Trip.com's Partner API and Affiliate data feed are both relationship-gated, not a fit for ad hoc research pulls.
- Rates and availability change constantly. A single pull only reflects the moment you searched — re-pull per date range you care about.
- Public data only. This collects what's publicly listed — never a way to complete or manipulate an actual booking.
Where this gets used
- Hotel price monitoring — track a specific property's rate over time.
- OTA rate-parity research — compare Trip.com pricing against Booking.com, Agoda, or Expedia for the same hotel and dates.
- APAC travel market research — gauge hotel supply and pricing in cities where Trip.com Group has strong regional share.
Sources
Start collecting
Try it first, free: run any public URL through the Free Web Scraper, or check whether a site blocks bots with the Anti-Bot Checker — no signup.
Test the search and hotel-detail endpoints in the Playground, check the schema in the API docs, and review pricing. Trip.com covers the APAC-heavy hotel side of OTA data; how to scrape Booking.com covers the largest global OTA by traffic, and how to scrape Agoda covers a similar APAC-first competitor with broader coverage (hotels, homes, activities, and flights). See also how to scrape Expedia, the broader travel & hospitality research use case, and is web scraping legal.
Part of our how-to-scrape guide series — every platform we cover, in one index.
Frequently asked questions
Does this Trip.com API cover flights or trains, not just hotels?
No — this catalog group covers hotel search and hotel detail only. Trip.com sells flights, trains, car rental, and activities as separate, much larger products, and there's no self-serve read API for them here. If you need those, budget for a separate integration.
Is there an official Trip.com API for reading hotel search results?
Not for open self-serve use. Trip.com's Partner API is a supplier/aggregator integration for travel agencies and OTAs, and its Affiliate Program offers a hotel data feed to approved publishers — both are gated relationships reached through an application, not a signup form for research or monitoring.
Is it legal to scrape Trip.com hotel data?
Public listing facts like a hotel's name, address, and star rating aren't copyrightable, and hiQ Labs v. LinkedIn held that accessing public data isn't a CFAA violation. But Trip.com's Terms and Conditions prohibit unauthorized access and excessive data loads on its network, and its robots.txt disallows crawling hotel detail and search-result pages for general bots. This isn't legal advice — see our is-web-scraping-legal guide for the fuller picture.
What data can I get from a Trip.com hotel search?
Hotel id, name, URL, star rating, review score and count, a short description, a source image, and nightly price for the searched city.
What does the Trip.com hotel detail endpoint return?
Full address and geo-coordinates, open year, highlights, a rating breakdown by category (cleanliness, amenities, location, service), check-in/child policy, popular facilities, an image gallery, description, and the source URL.
How do I find a city_id to search Trip.com hotels?
The search endpoint requires both city_slug and city_id, not a free-text query. Trip.com encodes both in its own hotel-list URLs (for example bangkok-hotels-list-359 gives slug "bangkok" and id 359) — there's no keyword-to-city lookup endpoint in this catalog group.
Why does the Trip.com guide cover less than the Agoda or Expedia guides?
This catalog group only has two endpoints — hotel search and hotel detail — so this guide is scoped to hotels only. Agoda and Expedia's guides also cover homes, activities, or flights because those catalog groups are broader.