全国景点查询
<p>[TOC]</p>
<h3>接口调用说明</h3>
<h4>请求方式</h4>
<p>如接口没有单独说明,所有接口均为:<strong>POST</strong></p>
<h4>请求格式</h4>
<p>如接口没有单独说明,所有接口均为:<strong>application/x-www-form-urlencoded</strong></p>
<h4>请求参数</h4>
<p>请求参数包括公共参数和业务参数(业务参数见具体接口说明)
调用接口时,需要把<strong>公共参数</strong>和<strong>业务参数</strong>一并放在<strong>请求参数</strong>中提交</p>
<h5>公共请求参数</h5>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>appId</td>
<td>String</td>
<td>是</td>
<td>服务商分配的唯一标识</td>
</tr>
<tr>
<td>timestamp</td>
<td>Long</td>
<td>是</td>
<td>当前时间戳(毫秒)</td>
</tr>
<tr>
<td>sign</td>
<td>String</td>
<td>是</td>
<td>签名,详见<a href="#签名算法">签名算法说明</a></td>
</tr>
</tbody>
</table>
<p><a name="签名算法"></a></p>
<h5>签名算法说明</h5>
<pre><code>sign = sha256(appId + appSecret + timestamp)</code></pre>
<p>用服务商分配的 <strong>appId</strong>、服务商分配的 <strong>appSecret</strong>,当前时间戳(毫秒) <strong>timestamp</strong>,按上述顺序拼接成字符串,再进行 <strong>sha256</strong> 哈希得到。如下:</p>
<pre><code class="language-java">String appId = &quot;xyzxy2121zxyz&quot;;
String timestamp = &quot;1555378976238&quot;;
String appSecret = &quot;efcefcef1121cefcefc1212121&quot;;
String str = appId + appSecret + timestamp;
String sign = sha256(str);</code></pre>
<h4>返回说明</h4>
<h5>公共返回字段说明</h5>
<p>所有接口均返回以下公共字段:</p>
<table>
<thead>
<tr>
<th>字段名</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>返回码,详见:code返回码说明</td>
</tr>
<tr>
<td>msg</td>
<td>code对应的描述</td>
</tr>
<tr>
<td>charge</td>
<td>计费标志 true为计费,false为不计费</td>
</tr>
<tr>
<td>taskNo</td>
<td>本次请求号</td>
</tr>
<tr>
<td>data</td>
<td>返回具体结果,object类型,详见data返回字段描述</td>
</tr>
</tbody>
</table>
<p><a name="公共code返回码说明"></a></p>
<h5>公共code返回码说明</h5>
<p>所有接口公共返回码如下:</p>
<table>
<thead>
<tr>
<th>code</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>成功</td>
</tr>
<tr>
<td>400</td>
<td>参数错误</td>
</tr>
<tr>
<td>404</td>
<td>接口地址不正确</td>
</tr>
<tr>
<td>500</td>
<td>系统维护,请稍候再试</td>
</tr>
<tr>
<td>601</td>
<td>接口未开通</td>
</tr>
<tr>
<td>602</td>
<td>账号停用</td>
</tr>
<tr>
<td>604</td>
<td>接口停用</td>
</tr>
<tr>
<td>606</td>
<td>调用超限,请稍候再试</td>
</tr>
<tr>
<td>607</td>
<td>ip不在白名单</td>
</tr>
<tr>
<td>609</td>
<td>请求过于频繁,请稍候再试</td>
</tr>
<tr>
<td>610</td>
<td>请求超时</td>
</tr>
<tr>
<td>999</td>
<td>其他,以实际返回为准</td>
</tr>
</tbody>
</table>
<h3>景点查询接口</h3>
<h4>接口描述</h4>
<ul>
<li>根据省、市、县名称及景点名称查询景点信息,返回坐标、地址、描述、图片列表、门票价等信息。</li>
</ul>
<h4>请求地址</h4>
<p><code>https://api.jumdata.com/area/scenic-spots</code></p>
<h4>业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:400px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>keyword</td>
<td>String</td>
<td>否</td>
<td>景点名称</td>
</tr>
<tr>
<td>proId</td>
<td>String</td>
<td>否</td>
<td>省级id</td>
</tr>
<tr>
<td>cityId</td>
<td>String</td>
<td>否</td>
<td>城市id</td>
</tr>
<tr>
<td>areaId</td>
<td>String</td>
<td>否</td>
<td>镇id</td>
</tr>
<tr>
<td>page</td>
<td>String</td>
<td>否</td>
<td>第几页</td>
</tr>
</tbody>
</table>
<h4>成功返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;成功&quot;,//code对应的描述
&quot;code&quot;: 200,//返回码,详见code返回码说明
&quot;taskNo&quot;: &quot;968545275134169633742173&quot;,//本次唯一请求号
&quot;charge&quot;: true, //计费标志
&quot;data&quot;: {
&quot;allNum&quot;: &quot;33&quot;,//总数量
&quot;allPages&quot;: &quot;2&quot;,//总页数,每页20条
&quot;currentPage&quot;: &quot;2&quot;,//当前页
&quot;maxResult&quot;: &quot;20&quot;,//每页最大条目数
&quot;list&quot;: [
{
&quot;summary&quot;: &quot;大士岩位于云龙山西麓,为徐州知州姜焯所建。康熙五十八 年(1719年),姜于此处得异石一块,遂命工匠雕又盖庙宇,故名曰大士岩。院内两株参天古柏,粗可合围,沧劲 挺拔,虬枝翠叶,犹如两名卫士,屹立于大殿&quot;,//景点描述
&quot;address&quot;: &quot;电话:0516-3843454\r\n地址:徐州市云龙山\r\n邮编:221001&quot;,//景点地址
&quot;cityId&quot;: &quot;230&quot;,//城市id
&quot;priceList&quot;: [],//图片列表
&quot;areaId&quot;: &quot;532&quot;,//镇id
&quot;cityName&quot;: &quot;徐州&quot;,//城市名
&quot;areaName&quot;: &quot;徐州市区&quot;,//镇名称
&quot;picList&quot;: [ //门票价格列表
{
&quot;entityList&quot;: [ //门票信息集合
{
&quot;AmountAdvice&quot;: &quot;100&quot;,//渠道价
&quot;PriceId&quot;: 231408,//价格id
&quot;TicketTypeId&quot;: 179033,//票id
&quot;Amount&quot;: &quot;148&quot;,//票面价
&quot;TicketName&quot;: &quot;大理西湖国家湿地公园成人票&quot;,//门票名称
&quot;PriceInSceneryId&quot;: 26416,//景区id
&quot;EndDate&quot;: &quot;2015-12-31&quot;,//票结束销售的日期
&quot;PriceName&quot;: &quot;&quot;,//价格优惠名称
&quot;BeginDate&quot;: &quot;2015-07-22&quot;//票开始销售日期
},
{
&quot;AmountAdvice&quot;: &quot;100&quot;,
&quot;PriceId&quot;: 231409,
&quot;TicketTypeId&quot;: 179034,
&quot;Amount&quot;: &quot;148&quot;,
&quot;TicketName&quot;: &quot;大理西湖国家湿地公园成人票&quot;,
&quot;PriceInSceneryId&quot;: 26416,
&quot;EndDate&quot;: &quot;2015-12-31&quot;,
&quot;PriceName&quot;: &quot;&quot;,
&quot;BeginDate&quot;: &quot;2015-07-22&quot;
}
],
&quot;type&quot;: &quot;成人票&quot;//门票分类
}
],
&quot;proId&quot;: &quot;16&quot;,//省级id
&quot;name&quot;: &quot;大士岩&quot;,//景点名称
&quot;location&quot;: {//坐标
&quot;lon&quot;: &quot;117.18797330&quot;,
&quot;lat&quot;: &quot;34.25199824&quot;
},
&quot;id&quot;: &quot;10612&quot;,
&quot;proName&quot;: &quot;江苏&quot;, //省级名称
&quot;coupon&quot;: &quot;&quot;,//优惠政策
&quot;star&quot;: &quot;&quot;,//景点星级
&quot;opentime&quot;: &quot;&quot;,//开放时间
&quot;content&quot;: &quot;&quot;,//景点描述
&quot;attention&quot;: &quot;&quot;,//温馨提示
&quot;ct&quot;: &quot;&quot;//可忽略
}
]
}
}</code></pre>
<h4>失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;参数不正确&quot;,
&quot;code&quot;: 400
}</code></pre>
<h3>省份列表</h3>
<h4>接口描述</h4>
<ul>
<li>景点查询的辅助接口,查询各省或直辖市对应的ID。</li>
</ul>
<h4>请求地址</h4>
<p><code>https://api.jumdata.com/area/province</code></p>
<h4>业务参数</h4>
<p>无</p>
<h4>成功返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;成功&quot;,//code对应的描述
&quot;code&quot;: 200,//返回码,详见code返回码说明
&quot;taskNo&quot;: &quot;968545275134169633742173&quot;,//本次唯一请求号
&quot;charge&quot;: true, //计费标志
&quot;data&quot;: {
&quot;list&quot;: [
{
&quot;name&quot;: &quot;上海&quot;,
&quot;id&quot;: &quot;25&quot;
},
{
&quot;name&quot;: &quot;江苏&quot;,
&quot;id&quot;: &quot;16&quot;
}
]
}
}</code></pre>
<h4>失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;参数不正确&quot;,
&quot;code&quot;: 400
}</code></pre>
<h3>城市列表</h3>
<h4>接口描述</h4>
<ul>
<li>根据一级区域id查询省或直辖市的下级区域ID。</li>
</ul>
<h4>请求地址</h4>
<p><code>https://api.jumdata.com/area/city</code></p>
<h4>业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:400px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>proId</td>
<td>String</td>
<td>是</td>
<td>省级id</td>
</tr>
</tbody>
</table>
<h4>成功返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;成功&quot;,//code对应的描述
&quot;code&quot;: 200,//返回码,详见code返回码说明
&quot;taskNo&quot;: &quot;968545275134169633742173&quot;,//本次唯一请求号
&quot;charge&quot;: true, //计费标志
&quot;data&quot;: {
&quot;list&quot;: [
{
&quot;proId&quot;: &quot;2&quot;,//省份id
&quot;name&quot;: &quot;合肥&quot;,//名称
&quot;id&quot;: &quot;42&quot;,
&quot;proName&quot;: &quot;安徽&quot; //省份名称
},
{
&quot;cityName&quot;: &quot;合肥&quot;,
&quot;proId&quot;: &quot;2&quot;,
&quot;name&quot;: &quot;蜀山区&quot;,
&quot;id&quot;: &quot;3597&quot;,
&quot;proName&quot;: &quot;安徽&quot;,
&quot;cityId&quot;: &quot;42&quot;
},
{
&quot;cityName&quot;: &quot;合肥&quot;,
&quot;proId&quot;: &quot;2&quot;,
&quot;name&quot;: &quot;经济开发区&quot;,
&quot;id&quot;: &quot;5822&quot;,
&quot;proName&quot;: &quot;安徽&quot;,
&quot;cityId&quot;: &quot;42&quot;
}
]
}
}</code></pre>
<h4>失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;参数不正确&quot;,
&quot;code&quot;: 400
}</code></pre>
<h3>区县列表</h3>
<h4>接口描述</h4>
<ul>
<li>根据地级市的ID,查询下级区域ID。</li>
</ul>
<h4>请求地址</h4>
<p><code>https://api.jumdata.com/area/district</code></p>
<h4>业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:400px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>cityId</td>
<td>String</td>
<td>是</td>
<td>城市id</td>
</tr>
</tbody>
</table>
<h4>成功返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;成功&quot;,//code对应的描述
&quot;code&quot;: 200,//返回码,详见code返回码说明
&quot;taskNo&quot;: &quot;968545275134169633742173&quot;,//本次唯一请求号
&quot;charge&quot;: true, //计费标志
&quot;data&quot;: {
&quot;list&quot;: [
{
&quot;cityName&quot;: &quot;合肥&quot;,//城市名称
&quot;proId&quot;: &quot;2&quot;,//省份id
&quot;name&quot;: &quot;蜀山区&quot;,//名称
&quot;id&quot;: &quot;3597&quot;,
&quot;proName&quot;: &quot;安徽&quot;,//省份名称
&quot;cityId&quot;: &quot;42&quot; //城市id
},
{
&quot;cityName&quot;: &quot;合肥&quot;,
&quot;proId&quot;: &quot;2&quot;,
&quot;name&quot;: &quot;经济开发区&quot;,
&quot;id&quot;: &quot;5822&quot;,
&quot;proName&quot;: &quot;安徽&quot;,
&quot;cityId&quot;: &quot;42&quot;
}
]
}
}</code></pre>
<h4>失败返回样例</h4>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;参数不正确&quot;,
&quot;code&quot;: 400
}</code></pre>