地址搜索
基本信息
Path: /api/v2/place/search
Method: GET
接口描述:
key验证规则 为 对 参数q,和salt拼接后进行MD5加密取32位小写,其中salt为固定值:4k1youU38QiFXhTm
例如
q=135 pilkington avenue, birmingham
salt=4k1youU38QiFXhTm
则key = md5(135 pilkington avenue, birmingham4k1youU38QiFXhTm)=fea2393aa6ccf932fbc75c026a267763
所以完整请求链接为:
https://openapi-map.tantu.com/api/v2/place/search?q=135+pilkington+avenue,+birmingham&format=json&key=fea2393aa6ccf932fbc75c026a267763
本api参考开源项目nominatim,详细解释可参考官方文档
https://github.com/openstreetmap/Nominatim/blob/master/docs/api/Reverse.md
请求参数
Query
| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| q | 是 | 135 pilkington avenue, birmingham | 要查询的地点关键字或地址 |
| street | 否 | 135 pilkington avenue | 门牌号街道名 |
| city | 否 | birmingham | 所在城市 |
| county | 否 | birmingham | 所在县 |
| state | 否 | CA | 所在州/省 |
| country | 否 | US | 所在国家 |
| format | 是 | json | 输出格式,默认为json,可选[html |
| key | 是 | fea2393aa6ccf932fbc75c026a267763 | 校验码,构造方法详细查看备注 |
返回数据
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| Code | number | 非必须 | 状态码,0代表返回成功,非0代表失败 | ||
| Desc | string | 非必须 | 返回消息描述 | ||
| Message | object [] | 非必须 | item 类型: object | ||
| ├─ place_id | number | 非必须 | 地址id | ||
| ├─ licence | string | 非必须 | |||
| ├─ osm_type | string | 非必须 | osm地址类型 | ||
| ├─ osm_id | number | 非必须 | osmid | ||
| ├─ boundingbox | string [] | 非必须 | 地点矩形 | item 类型: string | |
| ├─ | 非必须 | ||||
| ├─ lat | string | 非必须 | 地点纬度 | ||
| ├─ lon | string | 非必须 | 地点经度 | ||
| ├─ display_name | string | 非必须 | 详细信息 | ||
| ├─ class | string | 非必须 | place类型 | ||
| ├─ type | string | 非必须 | |||
| ├─ importance | number | 非必须 | 可信程度 |
粤公网安备 44010602000444号