今天接到需求,需要根据手机号查询归属地,在网上找到几个不错的接口。提供给有同样需求的兄弟。
接口参数及内容一样就能明白,不再赘述。
淘宝接口
接口地址:
http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=18519101034
返回内容:
__GetZoneResult_ = {
mts:'1851910',
province:'北京',
catName:'中国联通',
telString:'18519101034',
areaVid:'29400',
ispVid:'137815084',
carrier:'北京联通'
}
注意:接口返回的内容不是json,可以把“_GetZoneResult =”删掉后,转换成json
360接口
接口地址:
https://cx.shouji.360.cn/phonearea.PHP?number=18519101034
返回内容:
{
"code": 0,
"data": {
"province": "北京",
"city": "",
"sp": "联通"
}
}
ITEBLOG接口
接口地址:
https://www.iteblog.com/api/mobile.PHP?mobile=18519101034
返回内容:
{
"ID": "280889",
"prefix": "1851910",
"province": "北京",
"city": "北京",
"operator": "中国联通",
"areaCode": "010",
"zip": "100000",
"ret": 0,
"searchStr": "18519101034",
"from": "https://www.iteblog.com/api/mobile.PHP",
"ip": "114.243.220.66",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"
}