您现在的位置是:首页> api 个人博客模板
身份证号码归属地查询
无痕小Q个人博客 2020-02-12 00:55:52【 主页】 3230人已围观
简介接口可以查询身份证归属地
接口地址https://yzc136.cn/class/api/open/IdentityCard
请求方式POST
请求参数 ( 参数名: num , 介绍: 身份证 , 参数: 340202197104106891 。)
返回示例:
{"errors":false,"data":{"province":"安徽省","city":"芜湖市","county":"镜湖区"}}
介绍:
查询身份证归属地接口
返回参数
errors:接口状态
data:数据
province:省
city:市
county:区
php代码:
$host = "https://yzc136.cn/class/api/open/IdentityCard"; $method = "POST"; $headers = array(); array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8"); $bodys = "num=340202197104106891"; $url = $host; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); if (1 == strpos("$".$host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys); var_dump(curl_exec($curl));
python代码:
import urllib, urllib2, sys import ssl host = 'https://yzc136.cn/class/api/open/IdentityCard' path = '' method = 'POST' appcode = '' querys = '' bodys = {} url = host + path bodys['num'] = '340202197104106891' post_data = urllib.urlencode(bodys) request = urllib2.Request(url, post_data) request.add_header('Authorization', 'APPCODE ' + appcode) request.add_header('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8') ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE response = urllib2.urlopen(request, context=ctx) content = response.read() if (content): print(content)
阅读量! (3230)
点击排行
网站公告
- 欢迎来到我的博客
1:欢迎来到我的博客
2:博客免费api接口现已上线
3:博客会定期更新文章
4:欢迎大家来捧场
站点信息
- 建站时间:2019-8-30
- 网站程序:php,laravel-swoole框架
- 今日流量:570(10分钟统计一次)
- 本月流量:9289
- 浏览总量:388216
- 统计方式:中间件,redis消息队列,定时任务