前言:
做了一個活動,需要知道報名用戶的手機歸屬地校驗和後臺的展示。在網上搜索了一些免費的第三方API接口,整理如下:
1,百度提供的(記錄下,不能使用)
https://mobsec-dianhua.baidu.com/dianhua_api/open/location?tel=XXXXXXXXXX
網上最多的,但是在2020-4月不能使用了,啊哈哈
哈哈,這個不能用,之前一直在使用,前幾個月突然不能使用了,一定要多備幾個。
2,360提供的(良心推薦,精確到了省市)
https://cx.shouji.360.cn/phonearea.php?number=XXXXXXX
得到的數據如下:
{"code":0,"data":{"province":"\u5317\u4eac","city":"","sp":"\u8054\u901a"}}
格式化展示:
{
"code":0,
"data":{
"province":"北京",
"city":"",
"sp":"聯通"
}
}
3,淘寶(只能到省,不能到市級,有些遺憾)
https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=XXXXX
得到的數據格式
__GetZoneResult_ = {
mts:'1585078',
province:'江蘇',
catName:'中國移動',
telString:'XXXXXXXX',
areaVid:'XXX',
ispVid:'XXXX',
carrier:'江蘇移動'
}
4,當然是github哈,不所不能
https://github.com/xluohome/phonedata