今天接到需求,須要根據手機號查詢歸屬地,在網上找到幾個不錯的接口。提供給有一樣需求的兄弟。
接口參數及內容同樣就能明白,再也不贅述。php
接口地址:json
http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=18519101034
返回內容:api
__GetZoneResult_ = { mts:'1851910', province:'北京', catName:'中國聯通', telString:'18519101034', areaVid:'29400', ispVid:'137815084', carrier:'北京聯通' }
注意:接口返回的內容不是json,能夠把「_GetZoneResult =」刪掉後,轉換成jsonide
接口地址:code
https://cx.shouji.360.cn/phonearea.php?number=18519101034
返回內容:htm
{ "code": 0, "data": { "province": "北京", "city": "", "sp": "聯通" } }
接口地址:blog
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" }