Trip.com API endpoint
Use Crawlora's Search Trip.com hotels by city API to extract supported public Trip.com data as structured JSON. This page includes request parameters, cURL examples, response schema, error behavior, credit cost, and a Playground link for testing before integration.
/tripcom/hotels/searchReturns Trip.com's own top-hotels page for a city: normalized hotel summaries (name, location, star rating, guest rating, review count, image, display price) for the hotels Trip.com features on that city's hotel-list page. Trip.com does not expose a credential-free free-text city search, so callers supply the exact city_slug and city_id pair from a known Trip.com hotel-list URL of the form https://www.trip.com/hotels/{city_slug}-hotels-list-{city_id}/. Credential-free public data sourced from Trip.com's own server-rendered hotel-list page. Developers commonly use this endpoint for data enrichment, monitoring, research dashboards, internal automation, and agent-native workflows that need repeatable structured public web data. Authentication uses the documented Crawlora headers, and usage is metered with the credit cost shown on this page.
Request parameters are generated from the active endpoint catalog. Required values must be sent before Crawlora can call the upstream public web data source.
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| city_slug | string | Yes | Trip.com city slug, the text segment of a /hotels/{city_slug}-hotels-list-{city_id}/ URL | ||
| city_id | string | Yes | Trip.com numeric city id, the trailing number of a /hotels/{city_slug}-hotels-list-{city_id}/ URL | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/tripcom/hotels/search" \ -H "x-api-key: $CRAWLORA_API_KEY"
Send your scraping API key in the x-api-key header. Use the console API Keys page to rotate or select the active key.
Endpoint usage is metered in credits. The plan prices, included credits, limits, and overage rates below match the active backend billing configuration.
| Plan | Price | Included credits | Daily cap | Rate limit | Overage |
|---|---|---|---|---|---|
| Free | $0/mo | 2,000 | 500 daily credits | 5/min | No overage |
| Starter | $9/mo | 20,000 | 5,000 daily credits | 15/min | $0.75/1,000 overage credits when enabled |
| Growth | $29/mo | 100,000 | 25,000 daily credits | 45/min | $0.45/1,000 overage credits when enabled |
| Pro | $79/mo | 400,000 | No daily cap | 120/min | $0.30/1,000 overage credits |
| Business | $199/mo | 1,200,000 | No daily cap | 300/min | $0.20/1,000 overage credits |
| Enterprise | $499/mo | 5,000,000 | No daily cap | 1,000/min | $0.12/1,000 overage credits |
This endpoint is executed through Crawlora's managed scraping infrastructure.
Some targets require real browser execution because the data is loaded through JavaScript, dynamic rendering, or interaction-like browser behavior.
For supported endpoints, Crawlora can route requests through a managed browser cluster. This allows Crawlora to execute JavaScript, load dynamic content, apply browser-level request behavior, and normalize the rendered result into JSON.
You do not need to operate your own Playwright, Puppeteer, Chrome, proxy, queue, or retry infrastructure.
- Both `city_slug` and `city_id` must be exactly correct — Trip.com's own page 404s on a mismatched slug even when the id is valid, and this endpoint surfaces that as a `404`. - `hotels` is Trip.com's own curated top-hotels page for the city, not a fully paginated search — Trip.com does not expose page/offset parameters credential-free on this page. `count` reports exactly how many hotels this page returned, not a citywide total. - Each hotel's `price` is the list page's display price for the shown stay length (usually one night), not a full rate breakdown. - `hotel_id` in each result is the numeric Trip.com hotel id to pass to the hotel-detail endpoint. Example response: ```json { "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/", "image_url": "https://ak-d.tripcdn.com/images/0585b12000sq6ih4c6345.jpg", "location": "88 Moo3, Sriwaree Road, Sisa Chokhe Noi, Bang Sao Thong District, Srisa Chorakhe Noi, Bang Sao Thong", "star_rating": 5, "rating_score": 8.7, "review_count": 872, "description": "The hotel has a relaxing wellness atmosphere, and the staff are friendly and provide excellent service.", "price": {"raw": "US$38", "currency": "US$", "amount": 38, "unit": "1 night"} } ], "source_url": "https://www.trip.com/hotels/bangkok-hotels-list-359/" } } ```
Crawlora does not silently return bad data when the upstream page cannot be used.
| Status | Common failure case |
|---|---|
| 400 | Invalid input or missing required parameter |
| 429 | Plan or endpoint rate limit exceeded |
| 500 | Internal execution error |
| 502 | Upstream platform failed, returned unusable HTML, or served a challenge page that could not be resolved |
When possible, Crawlora returns structured error context so your integration can retry, back off, or inspect the request.
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 500 | Internal Server Error | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
{
"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/",
"image_url": "https://ak-d.tripcdn.com/images/0585b12000sq6ih4c6345.jpg",
"location": "88 Moo3, Sriwaree Road, Sisa Chokhe Noi, Bang Sao Thong District, Srisa Chorakhe Noi, Bang Sao Thong",
"star_rating": 5,
"rating_score": 8.7,
"review_count": 872,
"description": "The hotel has a relaxing wellness atmosphere, and the staff are friendly and provide excellent service.",
"price": {
"raw": "US$38",
"currency": "US$",
"amount": 38,
"unit": "1 night"
}
}
],
"source_url": "https://www.trip.com/hotels/bangkok-hotels-list-359/"
}
}Request schema
No body schema
Response schema
#/definitions/tripcom.searchResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | tripcom.SearchResponse | No | ||||
| data.city_id | string | No | 359 | |||
| data.city_slug | string | No | bangkok | |||
| data.count | integer | No | 9 | |||
| data.hotels | array | No | ||||
| data.hotels[].description | string | No | The hotel has a relaxing wellness atmosphere... | |||
| data.hotels[].hotel_id | integer | No | 39371462 | |||
| data.hotels[].image_url | string | No | https://ak-d.tripcdn.com/images/0585b12000sq6ih4c6345.jpg | |||
| data.hotels[].location | string | No | 88 Moo3, Sriwaree Road, Sisa Chokhe Noi, Bang Sao Thong District, Srisa Chorakhe Noi, Bang Sao Thong | |||
| data.hotels[].name | string | No | Divalux Resort and Spa Bangkok, Suvarnabhumi Airport-Free Shuttle | |||
| data.hotels[].price | tripcom.Price | No | ||||
| data.hotels[].price.amount | number | No | 38 | |||
| data.hotels[].price.currency | string | No | US$ | |||
| data.hotels[].price.raw | string | No | US$38 | |||
| data.hotels[].price.unit | string | No | 1 night | |||
| data.hotels[].rating_score | number | No | 8.7 | |||
| data.hotels[].review_count | integer | No | 872 | |||
| data.hotels[].star_rating | integer | No | 5 | |||
| data.hotels[].url | string | No | https://www.trip.com/hotels/bang-sao-thong-district-hotel-detail-39371462/divalux-resort-and-spa-bangkok-suvarnabhumi-airport-free-shuttle/ | |||
| data.source_url | string | No | https://www.trip.com/hotels/bangkok-hotels-list-359/ | |||
| msg | string | No | OK |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/tripcom/hotels/search" \
-H "x-api-key: $CRAWLORA_API_KEY"Crawlora is designed for responsible structured public web data workflows. Customers are responsible for using Crawlora in compliance with applicable laws, third-party rights, target-platform rules, and Crawlora terms.
Read Crawlora terms