网易有道 IP地址、邮编区号及城市查询、手机号码归属地和身份证 查询接口API

http://blog.csdn.net/go_to_learn/article/details/8296412

具体有多少个接口,不得而知,目前网上搜索的就知道四个:


查询IP地址:
http://www.youdao.com/smartresult-xml/search.s?type=ip&q=IP地址

举例:http://www.youdao.com/smartresult-xml/search.s?type=ip&q=123.233.157.9
返回:

[html]  view plain copy
  1. <?xml version="1.0" encoding="gbk"?>  
  2. <smartresult>  
  3. <product type="ip">  
  4. <ip>123.233.157.9</ip>  
  5. <location>山东省济南市 网通</location>  
  6. </product>  
  7. </smartresult>  
查询手机号码归属地:
http://www.yodao.com/smartresult-xml/search.s?type=mobile&q=手机号

举例:http://www.yodao.com/smartresult-xml/search.s?type=mobile&q=13892101111
返回:
[html]  view plain copy
  1. <?xml version="1.0" encoding="gbk"?>  
  2. <smartresult>  
  3. <product type="mobile">  
  4. <phonenum>13892101111</phonenum>  
  5. <location>陕西 延安</location>  
  6. </product>  
  7. </smartresult>  
查询身份证信息:
http://www.yodao.com/smartresult-xml/search.s?type=id&q=身份证号码
举例:http://www.youdao.com/smartresult-xml/search.s?type=id&q=370782196402121133
返回:
[html]  view plain copy
  1. <?xml version="1.0" encoding="gbk"?>  
  2. <smartresult>  
  3. <product type="identitycard">  
  4. <code>370782196402121133</code>  
  5. <location>山东省潍坊市诸城市</location>  
  6. <birthday>19640212</birthday>  
  7. <gender>m</gender>  
  8. </product>  
  9. </smartresult>  

根据 邮编、区号、城市名查询城市信息:

http://www.yodao.com/smartresult-xml/search.s?type=zip&q=邮编或区号或城市名
举例:http://www.youdao.com/smartresult-xml/search.s?type=zip&q=武汉

注:此时从输入框获取城市名需要:java.net.URLEncoder.encode(cityName,"UTF-8");当为汉字的时候不处理直接访问会得不到数据。

返回:

[html]  view plain copy
  1. <?xml version="1.0" encoding="gbk"?>  
  2. <smartresult>  
  3. <product type="zipcode">  
  4. <province>湖北省</province>  
  5. <city>武汉市</city>  
  6. <location>湖北省 武汉市</location>  
  7. <phone>027</phone>  
  8. <zipcode>430000</zipcode>  
  9. </product>  
  10. </smartresult>  
举例:http://www.youdao.com/smartresult-xml/search.s?type=zip&q=021

返回:

[html]  view plain copy
  1. <?xml version="1.0" encoding="gbk"?>  
  2. <smartresult>  
  3. <product type="zipcode">  
  4. <province></province>  
  5. <city>上海市</city>  
  6. <location>上海市</location>  
  7. <phone>021</phone>  
  8. <zipcode>200000</zipcode>  
  9. </product>  
  10. </smartresult>  

------------------------------------------------------------------------------

上面返回的是xml数据,且编码格式为gbk[解析xml的时候需要注意,一般默认的都是utf-8],也可以试返回json数据:

只需要在请求的url中加一个字段:jsFlag=true

例如:www.youdao.com/smartresult-xml/search.s?jsFlag=true&type=zip&q=021

返回:

 updateCall(1, {'product':'zipcode','province':'','city':'上海市','location':'上海市','phone':'021','zipcode':'200000'} , ''); 

好了, 暂时就这么多了!


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值