文档中心 > API类目 > 酒店导购API

taobao.xhotel.info.list.get (酒店详细信息查询)

获取酒店详情信息

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
city_code Number 必须 100100 城市code
shid Number 可选 1000000 标准酒店id,如果需要查询单条酒店的信息,需要传入此参数
current_page Number 可选 1 分页参数:当前页数,从1开始计数。 默认值:1
page_size Number 可选 10 分页参数:每页酒店数量。最小值1,最大值为50。默认值:20
pid String 可选 mm_2000059001_20312022_20470013 pid

响应参数

名称 类型 示例值 描述
total_results Number 1500 酒店总数
hotels SHotelInfoObject [] 标准酒店信息
  • └ shid
  • Number
  • 1000256
  • 标准酒店ID
  • └ name
  • String
  • 北京大饭店
  • 酒店名称
  • └ type
  • String
  • 1,2
  • 酒店类型
  • └ province
  • Number
  • 100000
  • 省的code
  • └ city
  • Number
  • 100100
  • 市的code
  • └ district
  • Number
  • 100000
  • 地区的值
  • └ address
  • String
  • 崇文门西大街1号
  • 酒店地址
  • └ lat
  • String
  • 18.264846
  • 纬度
  • └ lng
  • String
  • 109.50098
  • 纬度
  • └ star
  • String
  • 1
  • 酒店星级,1-5星,0是客栈
  • └ opening_time
  • String
  • 2000
  • 酒店开业时间
  • └ decorate_time
  • String
  • 2000-01-01
  • 酒店装修时间
  • └ tel
  • String
  • 0086-010-85322688
  • 电话,包括三种类型: 1.固定电话,例如:0086-010-85322688 2.移动电话,例如:13869696363 3.400或800电话,例如:0086-4006123928
  • └ rate_number
  • Number
  • 18
  • 评论数
  • └ rate_score
  • String
  • 4.5
  • 评分
  • └ description
  • String
  • 酒店描述
  • 酒店描述
  • └ pic_urls
  • String
  • http://img08.taobaocdn.com/bao/uploaded/i8/T1v5JOFptbXXaAGmMT_013104.jpg,http://img04.taobaocdn.com/bao/uploaded/i4/T1TPVNFwFcXXaAGmMT_013104.jpg
  • 图片url,多张图片使用","隔开
  • └ hotel_facilities
  • String
  • 酒店设施
  • 酒店设施
  • └ services
  • String
  • 服务设施
  • 服务设施
  • └ brand
  • String
  • 品牌
  • 酒店品牌
  • └ status
  • Number
  • 0
  • 酒店状态,0,营业中;-1,筹建中;-2,暂停营业;-3,已停业;
  • └ h5_detail_url
  • String
  • http://h5.m.taobao.com/trip/hotel/detail/detail.html?hid=0&shid=10107739&checkin=2014-05-12&checkout=2014-05-13&curcitycode=110100
  • H5的detail页面的URL
  • └ pc_detail_url
  • String
  • http://kezhan.trip.taobao.com/hotel_detail2.htm?shid=10004405&searchBy=yisou&requestId=1232322313
  • 酒店detail页面的url
  • rooms
  • SRoomType []
  • 房型信息
  • └ srid
  • Number
  • 123456
  • 匹配的标准房型
  • └ shid
  • Number
  • 123456
  • shid
  • └ name
  • String
  • aaa
  • 房型名
  • └ floor
  • String
  • 7-8层
  • 楼层
  • └ bed
  • String
  • [{"bedType":"大床","bedSize":"1.5m"},{"bedType":"双床","bedSize":"1.2m"}]
  • 床型。json格式:[{"bedType":"大床","bedSize":"1.5m"},{"bedType":"双床","bedSize":"1.2m"}]
  • └ internet
  • String
  • aaa
  • 宽带服务 "0","有线上网(免费), "1","有线上网(无)", "2","有线上网(收费)", "3","有线上网(部分有且免费)", "4","有线上网(部分有且收费)"
  • └ pic_url
  • String
  • aaa
  • pic_url
  • └ facility
  • String
  • aaa
  • facility
  • └ area
  • String
  • 16-30平米
  • 面积
  • └ max_occupancy
  • Number
  • 1
  • 最大入住人数
  • └ window_type
  • String
  • 有窗
  • 窗型
  • └ status
  • Number
  • 0
  • 状态
  • └ bnb_hotel
  • Boolean
  • false
  • 是否为民宿类型
  • └ check_in_time
  • String
  • 入住时间
  • └ check_out_time
  • String
  • 离店时间
  • └ pet_info
  • String
  • 宠物信息
  • └ foreign_type
  • Number
  • 外宾类型
  • └ foreign_desc
  • String
  • 外宾描述

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelInfoListGetRequest req = new XhotelInfoListGetRequest();
req.setCityCode(100100L);
req.setShid(1000000L);
req.setCurrentPage(1L);
req.setPageSize(10L);
req.setPid("mm_2000059001_20312022_20470013");
XhotelInfoListGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<xhotel_info_list_get_response>
    <total_results>1500</total_results>
    <hotels>
        <s_hotel_info_object>
            <shid>1000256</shid>
            <name>北京大饭店</name>
            <type>1,2</type>
            <province>100000</province>
            <city>100100</city>
            <district>100000</district>
            <address>崇文门西大街1号</address>
            <lat>18.264846</lat>
            <lng>109.50098</lng>
            <star>1</star>
            <opening_time>2000</opening_time>
            <decorate_time>2000-01-01</decorate_time>
            <tel>0086-010-85322688</tel>
            <rate_number>18</rate_number>
            <rate_score>4.5</rate_score>
            <description>酒店描述</description>
            <pic_urls>http://img08.taobaocdn.com/bao/uploaded/i8/T1v5JOFptbXXaAGmMT_013104.jpg,http://img04.taobaocdn.com/bao/uploaded/i4/T1TPVNFwFcXXaAGmMT_013104.jpg</pic_urls>
            <hotel_facilities>酒店设施</hotel_facilities>
            <services>服务设施</services>
            <brand>品牌</brand>
            <status>0</status>
            <h5_detail_url>http://h5.m.taobao.com/trip/hotel/detail/detail.html?hid=0&amp;shid=10107739&amp;checkin=2014-05-12&amp;checkout=2014-05-13&amp;curcitycode=110100</h5_detail_url>
            <pc_detail_url>http://kezhan.trip.taobao.com/hotel_detail2.htm?shid=10004405&amp;searchBy=yisou&amp;requestId=1232322313</pc_detail_url>
            <rooms>
                <s_room_type>
                    <srid>123456</srid>
                    <shid>123456</shid>
                    <name>aaa</name>
                    <floor>7-8层</floor>
                    <bed>[{&quot;bedType&quot;:&quot;大床&quot;,&quot;bedSize&quot;:&quot;1.5m&quot;},{&quot;bedType&quot;:&quot;双床&quot;,&quot;bedSize&quot;:&quot;1.2m&quot;}]</bed>
                    <internet>aaa</internet>
                    <pic_url>aaa</pic_url>
                    <facility>aaa</facility>
                    <area>16-30平米</area>
                    <max_occupancy>1</max_occupancy>
                    <window_type>有窗</window_type>
                    <status>0</status>
                </s_room_type>
            </rooms>
            <bnb_hotel>false</bnb_hotel>
            <check_in_time></check_in_time>
            <check_out_time></check_out_time>
            <pet_info></pet_info>
            <foreign_type></foreign_type>
            <foreign_desc></foreign_desc>
        </s_hotel_info_object>
    </hotels>
</xhotel_info_list_get_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案
isv.invalid-parameter:ERROR 参数不正确:页数小于0,pagesize参数过大等 检查参数
isp.remote-service-error 系统错误 请稍后重试
isp.service-unavailable 服务不可用 重试或找对应开发

API工具

如何获得此API

FAQ

返回
顶部