MENU

全国城市三级Api

August 12, 2019 • Read: 202 • Web Program阅读设置

最近在公司大佬的带领下自己写了个api

全国城市联动Api

请求全国所有省份/GET

https://api.xiaohuwei.cn/test.php?type=province
{
"pid": "10120",//用来获取所有湖北省的市级单位
"id": "101200101",
"city": "武汉",//省会
"en": "wuhan",
"province": "湖北"//省名
},
...

获取湖北省所有市级单位/GET

https://api.xiaohuwei.cn/test.php?type=city&pid=10120
{
"pid": "10120",
"id": "101200101",//用来获取市级单位下的所有县级单位
"city": "武汉",
"en": "wuhan"
},
{
"pid": "10120",
"id": "101200201",
"city": "襄阳",
"en": "xiangyang"
},
{
"pid": "10120",
"id": "101200301",
"city": "鄂州",
"en": "ezhou"
},
...

获取武汉市所有县级单位/GET

https://api.xiaohuwei.cn/test.php?type=county&id=101200101
{
"pid": "10120",
"id": "101200101",
"city": "武汉",
"en": "wuhan"
},
{
"pid": "10120",
"id": "101200102",
"city": "蔡甸",
"en": "caidian"
},
{
"pid": "10120",
"id": "101200103",
"city": "黄陂",
"en": "huangpi"
},
...
Archives QR Code Tip
QR Code for this page
Tipping QR Code
Leave a Comment

4 Comments
  1. 直接丢数据库出来吧。减少你服务器压力。@(哈哈)

    1. @哥斯拉不需要数据库 Json文件就可以

  2. 这是马上要就业的节奏了~

    1. @程志辉早工作了啊@(滑稽)