Trip.com

Search Trip.com hotels by city

Returns Trip.com's own top-hotels page for a city: 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 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}/.

get/tripcom/hotels/search

Request

  • Base URL: https://api.crawlora.net/api/v1
  • URL: https://api.crawlora.net/api/v1/tripcom/hotels/search
  • Auth: API key in header x-api-key

Query parameters

city_slugstring required

Trip.com city slug, the text segment of a /hotels/{city_slug}-hotels-list-{city_id}/ URL

city_idstring required

Trip.com numeric city id, the trailing number of a /hotels/{city_slug}-hotels-list-{city_id}/ URL

Headers

x-api-keystring required

API key required

Response

OK

codeinteger
msgstring

Example response

{
  "code": 200,
  "data": {
    "city_id": "359",
    "city_slug": "bangkok",
    "count": 9,
    "hotels": [
      {
        "description": "The hotel has a relaxing wellness atmosphere...",
        "hotel_id": 39371462,
        "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",
        "name": "Divalux Resort and Spa Bangkok, Suvarnabhumi Airport-Free Shuttle",
        "price": {
          "amount": 38,
          "currency": "US$",
          "raw": "US$38",
          "unit": "1 night"
        },
        "rating_score": 8.7,
        "review_count": 872,
        "star_rating": 5,
        "url": "https://www.trip.com/hotels/bang-sao-thong-district-hotel-detail-39371462/divalux-resort-and-spa-bangkok-suvarnabhumi-airport-free-shuttle/"
      }
    ],
    "source_url": "https://www.trip.com/hotels/bangkok-hotels-list-359/"
  },
  "msg": "OK"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.