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