Free mobile phone number attribution to the API query interface and PHP use instance to share
Recently in the national Industry classified information Web site, need to use the mobile phone number attribution to display function, so the shuttle in the major authoritative sites between the API to steal the interface address. Share it out, you can use it and take it, uh.
First, Taobao API
Copy Code code as follows:
API Address: http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=15850781443
Parameters:
Tel: mobile phone number
Back: JSON
Second, Pat API
Copy Code code as follows:
API Address: Http://virtual.paipai.com/extinfo/GetMobileProductInfo?mobile=15850781443&amount=10000&callname= Getphonenuminfoextcallback
Parameters:
Mobile: Phone number
Callname: Callback function
Amount: Unknown (required)
Back: JSON
Third, Tenpay API
Copy Code code as follows:
API Address: http://life.tenpay.com/cgi-bin/mobile/MobileQueryAttribution.cgi?chgmobile=15850781443
Parameters:
Chgmobile: Mobile phone number
Back: xml
Four, hundred Bao API
Copy Code code as follows:
API Address: https://www.baifubao.com/callback?cmd=1059&callback=phone&phone=15850781443
Parameters:
Phone: Mobile number
Callback: Callback function
CMD: unknown (required)
Back: JSON
Five, 115API
Copy Code code as follows:
API Address: http://cz.115.com/?ct=index&ac=get_mobile_local&callback=jsonp1333962541001&mobile= 15850781443
Parameters:
Mobile: Phone number
Callback: Callback function
Back: JSON
Six, Youdao API interface
Copy Code code as follows:
Interface Address: http://www.youdao.com/smartresult-xml/search.s?type=mobile&q=13892101112
Parameter description:
Type: Parameter mobile phone ownership is fixed
Q: Mobile phone number
Returns the XML format:
<?xml version= "1.0" encoding= "GBK"?>
<smartresult>
<product type= "mobile" >
<phonenum>13892101112</phonenum>
<location> Shaanxi Yanan </location>
</product>
</smartresult>
Or
http://www.youdao.com/smartresult-xml/search.s?jsFlag=true&type=mobile&q= Mobile phone Number
Returns the JSON format:
Fyodaocallback (1, {' Product ': ' Mobile ', ' phonenum ': ' 13892101112′, ' location ': ' Shaanxi Yanan '}, ");
PHP invoke Taobao API instance:
Copy Code code as follows:
<?php
$mobile = "15018788111"; The phone number to query
$content = Get_mobile_area ($mobile);
Print_r ($content);
function Get_mobile_area ($mobile) {
$sms = Array (' Province ' => ', ' Supplier ' => '); Initializing 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"); Intercepting strings
$sms [' supplier '] = substr ($content, "81", "4");
return $sms;
}
Other APIs can be free to play oh.