Home  >  Article  >  Backend Development  >  Free mobile phone number location API query interface and PHP usage example sharing_PHP tutorial

Free mobile phone number location API query interface and PHP usage example sharing_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:34:191224browse

Free mobile phone number location API query interface and PHP usage example sharing

Recently, I was working on a national industry classification information website and needed to use the function of displaying the location of mobile phone numbers, so I shuttled between major authoritative websites and stole the API interface address. Share it and take it if anyone can use it.


1. Taobao API

Copy code The code is as follows:
API address: http://tcc.taobao .com/cc/json/mobile_tel_segment.htm?tel=15850781443
Parameters:
tel: mobile phone number
Return: JSON

2. Paipai API

Copy code The code is as follows:
API address: http://virtual.paipai.com/ extinfo/GetMobileProductInfo?mobile=15850781443&amount=10000&callname=getPhoneNumInfoExtCallback
Parameters:
mobile: mobile phone number
callname: callback function
amount: unknown (required)
Return: JSON

3. Tenpay API

Copy code The code is as follows:
API address: http://life.tenpay.com /cgi-bin/mobile/MobileQueryAttribution.cgi?chgmobile=15850781443
Parameters:
chgmobile: mobile phone number
Return: xml

4. Baifubao API

Copy code The code is as follows:
API address: https://www.baifubao.com /callback?cmd=1059&callback=phone&phone=15850781443
Parameters:
phone: mobile phone number
callback: callback function
cmd: unknown (required)
Return: JSON

5. 115API

Copy code The code is as follows:
API address: http://cz.115.com/?ct =index&ac=get_mobile_local&callback=jsonp1333962541001&mobile=15850781443
Parameters:
mobile: mobile phone number
callback: callback function
Return: JSON


6. Youdao api interface

Copy code The code is as follows:
Interface address: http://www. youdao.com/smartresult-xml/search.s?type=mobile&q=13892101112
Parameter description:
type: The parameter mobile phone location is fixed as mobile
q: Mobile phone number
Return XML format:



13892101112Shaanxi Yan'an


or
http://www.youdao.com/smartresult- xml/search.s?jsFlag=true&type=mobile&q=Mobile phone number
Returns JSON format:
fYodaoCallBack(1, {'product':'mobile','phonenum':'13892101112′,'location':' Shaanxi Yan'an'}, ”);

PHP calls Taobao API instance:

Copy code The code is as follows:
$mobile = "15018788111 "; //Phone number to be queried
$content = get_mobile_area($mobile);
print_r($content);

function get_mobile_area($mobile){
$sms = array('province'=>'', 'supplier'=>''); //Initialize variables
//According to Taobao’s database Call return value
$url = "http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=".$mobile."&t=".time();

$content = file_get_contents($url);
$sms['province'] = substr($content, "56", "4"); //Intercept string
$sms['supplier'] = substr($content, "81", "4");
return $sms;
}

Other APIs can be used freely.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/751934.htmlTechArticleFree mobile phone number location API query interface and PHP usage example sharing. Recently, I am working on a national industry classification information website. I need to use the function of displaying the location of my mobile phone number, so I shuttle between...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn