序号 | 项目 | 值 | 说明 |
---|---|---|---|
1 | 接口地址 | https://www.xujian.tech/atlapi/data/m/city/tree | |
2 | 请求方式 | GET | |
3 | 请求参数1 | code | 用来识别用的code,在微信小程序“亚特技术”首页签到取得,不会变化 |
4 | 请求参数2 | adCode | 通过adCode查询城市信息,adCode、name中至少有一个需要填写 |
5 | 请求参数3 | name | 通过城市名称模糊匹配查询城市信息,adCode、name中至少有一个需要填写 |
6 | 请求参数4 | full | 非必填,传1时把匹配到的结果的下一级也查出来补充在树中。 |
- 重要说明:code不可变更,请注意保密
序号 | 项目 | 值 | 说明 |
---|---|---|---|
1 | 返回值格式 | JSONObject | 含code、data、msg |
2 | 返回值1 | code | 200为成功,其他表示失败 |
3 | 返回值2 | msg | 成功(succeed.)、失败的文字描述 |
4 | 返回值3 | data | 一个含基本信息(如name、adcode、cityCode、parentCode、children)的树结构,子节点存储在children中 |
序号 | 参数名 | 类型 | 说明 |
---|---|---|---|
1 | name | String | 省份(或直辖市)名称 |
2 | adcode | String | adcode: 中国行政区划代码 |
3 | cityCode | String | 城市区号,比如重庆023 |
4 | parentCode | String | 父级adCode |
5 | children | JSONArray | 子节点数据,所有节点对象都属性都是一样的 |
# 下方地址中的code请到亚特技术小程序首页签到获取,不会变化,注意保密
curl https://www.xujian.tech/atlapi/data/m/city/tree?full=1&adCode=370100&name=&code=
{
"code": 200,
"msg": "succeed.",
"data": {
"adCode": "100000",
"name": "中华人民共和国",
"cityCode": null,
"parentCode": null,
"children": [
{
"adCode": "370000",
"name": "山东省",
"cityCode": null,
"parentCode": "100000",
"children": [
{
"adCode": "370100",
"name": "济南市",
"cityCode": "0531",
"parentCode": "370000",
"children": [
{
"adCode": "370101",
"name": "济南市市辖区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370102",
"name": "历下区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370103",
"name": "市中区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370104",
"name": "槐荫区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370105",
"name": "天桥区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370112",
"name": "历城区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370113",
"name": "长清区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370114",
"name": "章丘区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370115",
"name": "济阳区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370116",
"name": "莱芜区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370117",
"name": "钢城区",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370124",
"name": "平阴县",
"cityCode": "0531",
"parentCode": "370100",
"children": []
},
{
"adCode": "370126",
"name": "商河县",
"cityCode": "0531",
"parentCode": "370100",
"children": []
}
]
}
]
}
]
}
}
// 地址
https://www.xujian.tech/monitor