按位置、日期、入住人数和商业筛选条件搜索可订酒店,并应用公司级价格规则。
接口
| 方法 | 路径 | 认证 |
|---|---|---|
POST | /v1/hotels/search | 需要 API key |
| Header | 说明 |
|---|---|
Authorization | Bearer <secret_key>. The secret is shown only once when the credential is created. |
X-Travelandz-Id | <public_key>:<profile_code>. The profile_code is the dp_-prefixed Developer Profile code shown in your dashboard. This binds the request to a profile and credential. |
Content-Type | Use application/json for requests with a body. |
Request Parameters
不需要路径参数或查询参数。
请求体结构
languageDefault en
checkIncheckOutlocationlocationsearchBylocationlatitudelocationlongitudesearchRadiusMinimum value: 1
countryCodenationalitymaxHotelsMaximum value: 2000
minRatemaxRateminCategorymaxCategoryrefundableroomsrooms[]adultsMinimum value: 1, Maximum value: 4
rooms[]childrenMinimum value: 0, Maximum value: 4
rooms[]childrenAgesrooms[]childrenAges[]currencyDefault EUR
retrieveBookingLinkDefault false
成功响应
返回 hotel results, availability, min rates and optional booking links.
响应体结构
hotelshotels[]gdsproviderhotels[]offerLinkhotels[]hotelIdhotels[]codehotels[]namehotels[]descriptionhotels[]descriptionlanghotels[]descriptiondescriptionhotels[]starRatinghotels[]reviewCounthotels[]accommodationTypehotels[]chainhotels[]addresshotels[]addressstreethotels[]addresscountryCodehotels[]addresscountryhotels[]addressdestinationhotels[]addresszonehotels[]locationhotels[]locationtypehotels[]locationcoordinateshotels[]locationcoordinates[]hotels[]latitudehotels[]longitudehotels[]roomsNameshotels[]roomsNames[]hotels[]boardTypeshotels[]boardTypes[]hotels[]hasRefundableRoomshotels[]imageshotels[]images[]hotels[]amenitieshotels[]amenities[]hotels[]minPricehotels[]roomCountliveModeTrue when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.
示例
bash
curl -X POST https://api.sandbox.travelandz.com/v1/hotels/search \
-H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
-H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
-H "Content-Type: application/json" \
-d '<request_body_json>'