您现在的位置是:首页> api 个人博客模板

手机号码归属地api,手机号码归属地接口,手机号免费接口

无痕小Q个人博客 2020-01-29 00:26:52主页 3405人已围观

简介这个接口可以输入手机号,查询归属地,接口请求手机号可以查询到该手机号对应的归属地省,市,运营商以及该地区的邮政编码和手机号的运营商

接口地址https://yzc136.cn/class/api/open/phone

请求方式POST

请求参数 ( 参数名: phone , 介绍: 手机号码 , 参数: 13633426165 。)

返回示例:

{"errors":false,"date":{"number_section":1363342,"province":"山西","city":"大同","supply":"中国移动","postal_code":37000,"phone":13633426165}}

介绍:

查询手机号归属地接口

返回参数

errors:接口状态

data:返回数据

number_section:号段

province:省

city:市

supply:运营商

postal_code:邮政编码

phone:手机号码

php代码:

$host = "https://yzc136.cn/class/api/open/phone";
 
$method = "POST";
$headers = array();
array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8");

$bodys = "phone=13633426165";

$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://class/yzc136.cn/api/open/phone'
path = ''
method = 'POST'
appcode = ''
querys = ''
bodys = {}
url = host + path

bodys['phone'] = '13633426165'
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)

阅读量! (3405)

关于本站

昵称:无痕小Q

职业:php-go-web开发工程师

现居:北京

Email:1838638884@qq.com

    世界上最远的距离,是我在if里你在else里,虽然经常一起出现,但却永不结伴执行。

网站公告

  • 欢迎来到我的博客

  • 1:欢迎来到我的博客


    2:博客免费api接口现已上线


    3:博客会定期更新文章


    4:欢迎大家来捧场


    曾经沧海难为水,除却巫山不是云。

站点信息

白日何短短,百年苦易满。 苍穹浩茫茫,万劫太极长。 麻姑垂两鬓,一半已成霜。 天公见玉女,大笑亿千场。 吾欲揽六龙,回车挂扶桑。 北斗酌美酒,劝龙各一觞。 富贵非所愿,与人驻颜光。 三万里河东人海,五千仍岳上摩天。 遗民泪尽胡尘里,南望王师又一年。
  • 建站时间:2019-8-30
  • 网站程序:php,laravel-swoole框架
  • 今日流量:0(10分钟统计一次)
  • 本月流量:0
  • 浏览总量:396141
  • 统计方式:中间件,redis消息队列,定时任务
    生活的道路一旦选定,就要勇敢地走到底,决不回头。