POST/v1/hotels/search

搜索可订酒店

按位置、日期、入住人数和商业筛选条件搜索可订酒店,并应用公司级价格规则。

分享

按位置、日期、入住人数和商业筛选条件搜索可订酒店,并应用公司级价格规则。

接口

方法路径认证
POST/v1/hotels/search需要 API key
必需请求头:
Header说明
AuthorizationBearer <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-TypeUse application/json for requests with a body.

Request Parameters

不需要路径参数或查询参数。

请求体结构

language
enum
eneszh
否
Default en
checkIn
string
Format: YYYY-MM-DD
是
checkOut
string
Format: YYYY-MM-DD
是
location
object是
locationsearchBy
enum
coords
是
locationlatitude
number是
locationlongitude
number是
searchRadius
number否
Minimum value: 1
countryCode
string
Format: 2 digits
是
nationality
string
Format: 2 digits
是
maxHotels
number否
Maximum value: 2000
minRate
number否
maxRate
number否
minCategory
enum
12345
否
maxCategory
enum
12345
否
refundable
enum
allrefundablenon-refundable
是
rooms
array是
rooms[]adults
number是
Minimum value: 1, Maximum value: 4
rooms[]children
number否
Minimum value: 0, Maximum value: 4
rooms[]childrenAges
array是
rooms[]childrenAges[]
number[]是
currency
enum
EURUSDCNY
否
Default EUR
retrieveBookingLink
boolean否
Default false

成功响应

返回 hotel results, availability, min rates and optional booking links.

响应体结构

hotels
array是
hotels[]gdsprovider
number是
hotels[]offerLink
string否
hotels[]hotelId
string是
hotels[]code
string是
hotels[]name
string是
hotels[]description
object是
hotels[]descriptionlang
enum
eneszh
是
hotels[]descriptiondescription
string是
hotels[]starRating
number是
hotels[]reviewCount
number否
hotels[]accommodationType
string是
hotels[]chain
string可为空
hotels[]address
object是
hotels[]addressstreet
string否
hotels[]addresscountryCode
string否
hotels[]addresscountry
string否
hotels[]addressdestination
string否
hotels[]addresszone
string否
hotels[]location
object是
hotels[]locationtype
string是
hotels[]locationcoordinates
array是
hotels[]locationcoordinates[]
number[]
Format: [longitude, latitude]
是
hotels[]latitude
number是
hotels[]longitude
number是
hotels[]roomsNames
array是
hotels[]roomsNames[]
string[]是
hotels[]boardTypes
array是
hotels[]boardTypes[]
string[]是
hotels[]hasRefundableRooms
boolean是
hotels[]images
array是
hotels[]images[]
string[]是
hotels[]amenities
array是
hotels[]amenities[]
string[]是
hotels[]minPrice
number是
hotels[]roomCount
number否
liveMode
boolean是
True when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.

示例

bash
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>'