邮编查询
应用参数 | 类型 | 是否必填 | 默认值 | 示例值 | 说明 |
postcode | string | true | 528400 | 6位邮政编码 (与参数areaname二选一) | |
areaname | string | false | 广东省广州市 | 区域名 (与参数postcode二选一) | |
en_name | string | true | 必须为life.postcode |
系统参数 | 类型 | 是否必填 | 说明 |
ak | string | true | 开发者密钥 |
{ "success": "1", "result": { "count": "1", "lists": [ { "areaid": "242", "postcode": "528400", "areacode": "0760", "areanm": "中华人民共和国,广东省,中山市", "simcall": "中国,广东,中山" } ] } }
<?php $ch = curl_init(); $url = 'http://api.liangmlk.cn?ak=xxxx&en_name=life.postcode&postcode=xxxx'; curl_setopt($ch,CURLOPT_URL,$url); $res = curl_exec($ch); curl_close($ch); return $res; ?>
import requests url = 'http://api.liangmlk.cn?ak=xxxx&en_name=life.postcode&postcode=xxxx' print( requests.get(url).json() )
curl http://api.liangmlk.cn?ak=xxxx&en_name=life.postcode&postcode=xxxx