今天用到手机号归属地,所以查了一下很多很多已经不能用了.仔细找了一下找到了几个可以用的.自己也做了个库.分享给大家使用.
1.自研api(精确到地市,邮编等支持jsonp).已开源:/xiaogg/blog/2990766
/shouji/?mobile=手机号码
2.淘宝网((精确到省份)
API地址: /cc/json/mobile_tel_segment.htm?tel=手机号码
3.百度(精确到地市)
API地址:http://mobsec-/dianhua_api/open/location?tel=手机号码
4.百度(精确到地市)
/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_name=guishudi&query=手机号码
5.sogou(精确到地市)
/websearch/phoneAddress.jsp?phoneNumber=手机号码
6.电信手机号查询(精确到地市)
http://service./service/service/authority/query/queryAttribution POST ipNumber=1&value=手机号码
7.移动手机号查询(精确到地市)
http://service./enhance/cust/queryPhoneArea.action POST phone_no=手机号码
PhoneUtil
package com.camel.ssm.util;public class PhoneUtil {//手机归属public static final String PHONE_URL= "/websearch/phoneAddress.jsp?phoneNumber=TEL";public String phone(String data){String result= HttpClientUtil.doGet(PHONE_URL.replace("TEL",data));return result;}}
EchostrController
//手机号归属else if(flog==3&&ime.getContent()!=null) {PhoneUtil phoneUtil=new PhoneUtil();String result= phoneUtil.phone(ime.getContent());String result1= result.replace("void","归属地查询结果:");outMsg.setContent(result1);}return outMsg;