接口调用地址
说明:直接访问 https://api.apihz.cn/getapi.php 获取当前最优IP接口地址。由普通负载集群服务器组成,通过IP接口地址调用,如果单个服务器过载可自行切换IP接口地址尝试其他负载服务器。IP并非永久固定且容易遭受攻击,平台可能不定期更换。
说明:域名接口会自动分发请求到普通集群服务器均衡负载,该域名TTL值为60秒,表示你的请求会每60秒实现自动轮换负载服务器,但也可能因你的网络服务商存在DNS缓存造成短时间内无法自动切换负载。如果某个负载服务器出现故障,也可能会造成个别地区存在一定时间的故障期。
说明:VIP专线在普通集群组的基础上额外增加独享大带宽集群组,每次请求自动均衡负载,自动故障切换,抗攻击,全球智能CDN加速。超高稳定性!最低30¥/月,彩钻以上会员专属,登录后购买。注:VIP线路是指调用接口的线路更有保障以及每分钟拥有更高的调用频次等,并非收费接口包月使用。
请求示例
[GET]请求示例:(请登录后使用自己的KEY独享频次)
复制参数
复制全部
[POST]请求示例:(请根据开发语言自行POST,参考【GET/POST教程】,或下载【超级客户端】调试。)
请求参数说明
注意:请求编码为UTF8,否则带中文请求可能失败。一般参数不能带+号,会被自动替换为空格。参数内容较大的必须用POST,不能GET。
提示:如发现接口有BUG,可加服务QQ群及时向我们反馈。
提示:请求参数里的开发者ID与KEY,登录后台菜单【个人资料】里查看。
提示:如发现接口有BUG,可加服务QQ群及时向我们反馈。
提示:请求参数里的开发者ID与KEY,登录后台菜单【个人资料】里查看。
| 名称 | 参数 | 必填 | 说明 |
|---|---|---|---|
| 开发者ID | id | 是 | 用户中心的数字ID,例:id=10000000 |
| 开发者KEY | key | 是 | 用户中心通讯秘钥,例:key=15he5h15ty854j5sr152hs2 |
| 起点经度 | starlon | 是 | 起点经度,例:starlon=121.4279 |
| 起点纬度 | starlat | 是 | 起点纬度,例:starlat=31.20872 |
| 终点经度 | endlon | 是 | 起点经度,例:endlon=121.313079 |
| 终点纬度 | endlat | 是 | 终点纬度,例:endlat=31.195667 |
| 线路策略 | linetype | 否 | 线路策略,例如时间最少,地铁优先,排除地铁,步行最少等。传参1-15,默认1=默认策略。具体请自行调试,建议保持默认。例:linetype=1 |
| 简化数据 | type | 否 | 0=返回简略数据,包含各方案线路,分段站点,站点坐标,分段耗时等。1=返回详细数据,包括线路uuid,同时增加了更详细的路线步进坐标等各类信息,较为复杂,适用于导航预览。默认0,如非必要建议保持默认返回简略数据。例:type=0 |
| 动态秘钥 | dkey | 否 | 开发者开启动态秘钥验证后需传此参数,主要针对直接在客户端调用接口的场景。请在官网后台菜单【个人资料】里配置。例:dkey=0cd2a494831736587c33f30d1e544371 |
| 用户IP | uip | 否 | 接口调用者IP,用于后台统计IP地域分布,ISP运营商,时段IP数统计等,如不传该参数则默认为接口请求端IP,该参数主要用于使用后端服务器/中间件请求接口的方式使用。例:uip=123.123.123.123。该参数彩钻/炫钻/焱钻会员专享。 |
返回参数说明
| 名称 | 参数 | 说明 |
|---|---|---|
| 状态码 | code | 200成功,400错误 |
| 消息内容 | msg | 信息提示。 |
| 整体数据集 | datas | 整体数据集。 |
| 方案规划 | datas.lineName | 某个方案线路规划,以竖杠隔开换成线路。 |
| 分段数据集 | datas.segments | 某个方案下整条线路所有分段的数据集,即途径的各站点数据,即某某站到某某站的数据。 |
| 分段起点数据集 | datas.segments.stationStart | 某一个分段起点数据集。含站点名称,站点编号,站点坐标。注意第一站的起点坐标一般为传参的起点坐标,第一站的终点坐标一般为上车点坐标,也就是上车点车站。 |
| 分段终点数据集 | datas.segments.stationEnd | 某一个分段终点数据集。含站点名称,站点编号,站点坐标。 |
| 分段耗时 | datas.segments.segmentTimes | 即该分段路程需要的时间,单位:分钟。 |
返回数据示例
示例:{"code":400,"msg":"查询失败,请重试。"}
示例:
{
"code": 200,
"datas": [{
"lineName": "地铁10号线 |",
"segments": [{
"stationStart": {
"name": "",
"uuid": "",
"lonlat": "121.4279,31.2087"
},
"stationEnd": {
"name": "交通大学站6号口",
"uuid": "1429089",
"lonlat": "121.429851,31.203733"
},
"segmentTimes": 14
}, {
"stationStart": {
"name": "交通大学站",
"uuid": "1429089",
"lonlat": "121.429851,31.203733"
},
"stationEnd": {
"name": "虹桥火车站",
"uuid": "1431250",
"lonlat": "121.316195,31.195677"
},
"segmentTimes": 20
}, {
"stationStart": {
"name": "虹桥火车站地铁站",
"uuid": "1431250",
"lonlat": "121.316195,31.195677"
},
"stationEnd": {
"name": "",
"uuid": "",
"lonlat": "121.31308,31.1956"
},
"segmentTimes": 8
}]
}, {
"lineName": "113路 | 地铁10号线 |",
"segments": [{
"stationStart": {
"name": "",
"uuid": "",
"lonlat": "121.4279,31.2087"
},
"stationEnd": {
"name": "华山路湖南路",
"uuid": "1461336",
"lonlat": "121.428817,31.20775"
},
"segmentTimes": 4
}, {
"stationStart": {
"name": "华山路湖南路",
"uuid": "1461336",
"lonlat": "121.428817,31.20775"
},
"stationEnd": {
"name": "左家宅",
"uuid": "1461121",
"lonlat": "121.420079,31.199689"
},
"segmentTimes": 4
}, {
"stationStart": {
"name": "左家宅",
"uuid": "1461121",
"lonlat": "121.420079,31.199689"
},
"stationEnd": {
"name": "虹桥路站4号口",
"uuid": "1431385",
"lonlat": "121.417724,31.198495"
},
"segmentTimes": 6
}, {
"stationStart": {
"name": "虹桥路站",
"uuid": "1431385",
"lonlat": "121.417724,31.198495"
},
"stationEnd": {
"name": "虹桥火车站",
"uuid": "1431250",
"lonlat": "121.316195,31.195677"
},
"segmentTimes": 18
}, {
"stationStart": {
"name": "虹桥火车站地铁站",
"uuid": "1431250",
"lonlat": "121.316195,31.195677"
},
"stationEnd": {
"name": "",
"uuid": "",
"lonlat": "121.31308,31.1956"
},
"segmentTimes": 8
}]
}, {
"lineName": "地铁10号线 | 835路 |",
"segments": [{
"stationStart": {
"name": "",
"uuid": "",
"lonlat": "121.4279,31.2087"
},
"stationEnd": {
"name": "交通大学站6号口",
"uuid": "1429089",
"lonlat": "121.429851,31.203733"
},
"segmentTimes": 14
}, {
"stationStart": {
"name": "交通大学站",
"uuid": "1429089",
"lonlat": "121.429851,31.203733"
},
"stationEnd": {
"name": "虹桥火车站",
"uuid": "1431250",
"lonlat": "121.316195,31.195677"
},
"segmentTimes": 20
}, {
"stationStart": {
"name": "虹桥火车站地铁站",
"uuid": "1431250",
"lonlat": "121.316195,31.195677"
},
"stationEnd": {
"name": "虹桥高铁出发(南)2号口(下客站)",
"uuid": "1426184",
"lonlat": "121.315955,31.195128"
},
"segmentTimes": 2
}, {
"stationStart": {
"name": "虹桥高铁出发(南)2号口(下客站)",
"uuid": "1426184",
"lonlat": "121.315955,31.195128"
},
"stationEnd": {
"name": "虹桥西交通中心",
"uuid": "1426698",
"lonlat": "121.312596,31.194567"
},
"segmentTimes": 1
}, {
"stationStart": {
"name": "虹桥西交通中心",
"uuid": "1426698",
"lonlat": "121.312596,31.194567"
},
"stationEnd": {
"name": "",
"uuid": "",
"lonlat": "121.31308,31.1956"
},
"segmentTimes": 3
}]
}, {
"lineName": "320路 |",
"segments": [{
"stationStart": {
"name": "",
"uuid": "",
"lonlat": "121.4279,31.2087"
},
"stationEnd": {
"name": "交通大学",
"uuid": "1461129",
"lonlat": "121.431506,31.203149"
},
"segmentTimes": 16
}, {
"stationStart": {
"name": "交通大学",
"uuid": "1461129",
"lonlat": "121.431506,31.203149"
},
"stationEnd": {
"name": "虹桥西交通中心",
"uuid": "1443220",
"lonlat": "121.313996,31.194162"
},
"segmentTimes": 44
}, {
"stationStart": {
"name": "虹桥西交通中心",
"uuid": "1443220",
"lonlat": "121.313996,31.194162"
},
"stationEnd": {
"name": "",
"uuid": "",
"lonlat": "121.31308,31.1956"
},
"segmentTimes": 5
}]
}, {
"lineName": "71路中运量 | 173路 |",
"segments": [{
"stationStart": {
"name": "",
"uuid": "",
"lonlat": "121.4279,31.2087"
},
"stationEnd": {
"name": "番禺路",
"uuid": "1425659",
"lonlat": "121.424649,31.212836"
},
"segmentTimes": 13
}, {
"stationStart": {
"name": "番禺路",
"uuid": "1425659",
"lonlat": "121.424649,31.212836"
},
"stationEnd": {
"name": "吴宝路",
"uuid": "1425669",
"lonlat": "121.335365,31.174859"
},
"segmentTimes": 35
}, {
"stationStart": {
"name": "吴宝路",
"uuid": "1425669",
"lonlat": "121.335365,31.174859"
},
"stationEnd": {
"name": "沪青平公路吴宝路",
"uuid": "1450512",
"lonlat": "121.334725,31.17443"
},
"segmentTimes": 2
}, {
"stationStart": {
"name": "沪青平公路吴宝路",
"uuid": "1450512",
"lonlat": "121.334725,31.17443"
},
"stationEnd": {
"name": "虹桥西交通中心",
"uuid": "1439821",
"lonlat": "121.312605,31.194688"
},
"segmentTimes": 10
}, {
"stationStart": {
"name": "虹桥西交通中心",
"uuid": "1439821",
"lonlat": "121.312605,31.194688"
},
"stationEnd": {
"name": "",
"uuid": "",
"lonlat": "121.31308,31.1956"
},
"segmentTimes": 3
}]
}]
}
更新记录