方法名称
hotel.static.city
使用说明
通过该接口获取酒店城市、行政区、标示物、商圈等数据。
输入参数
| 节点 | 名称 | 类型 | 可为空 | 说明 |
|---|---|---|---|---|
| CountryType | 国家类型 | Int | Y | 默认0:所有城市、 1:国内 、2:国际 |
| CityIdType | 城市Id类型 | Int | Y | 默认0:所有Id,即搜索id+内容id;1:只返回内容Id 注:搜索id、内容Id均支持hotel.list这样的动态接口搜索某个城市下的酒店; 搜索Id不支持hotel.static.list静态接口搜索酒店,只有内容id支持hotel.static.list搜索酒店。 以上只针对国内城市有效,国际可不传。 |
| IsNeedLocation | 是否需要Location | Boolean | Y | 默认:false,Location数据包括,行政区、商圈、标示物 |
| PageSize | 每页数据量 | Int | Y | 默认:200,范围1~200,每页抓去的数据量 |
| PageIndex | 页码 | Int | Y | 从1开始 |
响应结果
| 节点 | 名称 | 类型 | 可为空 | 说明 |
|---|---|---|---|---|
| Count | 城市数量 | Int | N | 酒店数量 |
| Citys | 城市结果就 | City[] | Y | 包含多个City节点 |
City节点
| 节点 | 名称 | 类型 | 可为空 | 说明 |
|---|---|---|---|---|
| CityId | 城市ID | String | N | |
| CityName | 城市中文名称 | String | N | |
CityNameEn | 城市英文名称 | String | Y | |
| CityLatitude | 城市纬度 | String | Y | 高德坐标系经纬度 |
| CityLongitude | 城市经度 | String | N | 高德坐标系经纬度 |
| ProvinceID | 省份ID | String | Y | |
| ProvinceName | 省份中文名称 | String | Y | |
| ProvinceNameEn | 省份英文名称 | String | N | |
| CountryID | 国家ID | String | N | |
| CountryCode | 国家编码 | String | Y | |
| CountryName | 国家中文名称 | String | N | |
| CountryNameEn | 国家英文名称 | String | N | |
| Locations | Location数据 | Location[] | Y | Location数据,包含行政区、商圈、标示物 |
Location节点
| 节点 | 名称 | 类型 | 可为空 | 说明 |
|---|---|---|---|---|
| LocationID | LocationID | String | N | |
| LocationName | Location中文名称 | String | N | |
| LocationNameEn | Location英文名称 | String | Y | |
| LocationType | Location类型 | Int | N | 1:行政区2:商圈3:标示物 |
输入参数示例
https://api-test.elong.com/rest?timestamp=1490001050&format=json
&method=hotel.static.city&signature=d19ce1e910def16453801405581c9d7c
&user={userid}&data={"Version":"1.33","Local":"zh_CN","Request":{"IsNeedLocation":true,}}输出参数示例
{
"Code": "0",
"Result": {
"Citys": [
{
"CityID": "0101",
"CityName": "北京",
"CityNameEn": "beijing",
"ProvinceID": "0100",
"ProvinceName": "北京市",
"ProvinceNameEn": "Beijing",
"CountryID": 3800,
"CountryCode":"CHN"
"CountryName": "中国",
"CountryNameEn": "CHN",
"Locations": 0,
"Locations": [{
"LocationID": "0003",
"LocationName":"朝阳区",
"LocationNameEn":"chaoyangqu",
"LocationType":1
},{
"LocationID": "010103",
"LocationName":"天安门/王府井地区",
"LocationNameEn":"Tiananmen Square / Wangfujing Business District",
"LocationType":2
},{
"LocationID": "154926",
"LocationName":"首都机场T1航站楼",
"LocationNameEn":"shoudoujichangT1hangzhanlou",
"LocationType":3
}
],
"filterType": -1,
"filterId": 50101002,
"sugActInfo": "3109294890299507326|jproxy|region|0|0|4"
}
]
},
"Guid": "5e3e79d7-9617-45b6-aab4-63de6bc45986"
}注意事项
本接口返回信息较多,请根据实际情况使用,不要为了使用某个字段而去开发功能。
