日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

有道手机归属地、邮政编码查询等API 实例

發布時間:2024/3/24 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 有道手机归属地、邮政编码查询等API 实例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

這幾個接口都是以URL GET方式提交參數,以XML的形式返回查詢結果

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

舉例:http://www.youdao.com/smartresul ... amp;q=123.233.157.9

返回:

<?xml version="1.0" encoding="gbk"?>
<smartresult>
<product type="ip">
<ip>123.233.157.9</ip>
<location>山東省濟南市 網通</location>
</product>
</smartresult>

查詢手機號碼歸屬地:
http://www.yodao.com/smartresult-xml/search.s?type=mobile&q=手機號

舉例:http://www.yodao.com/smartresult ... e&q=13892101111

返回:

<?xml version="1.0" encoding="gbk"?>
<smartresult>
<product type="mobile">
<phonenum>13892101111</phonenum>
<location>陜西 延安</location>
</product>
</smartresult>

查詢身份證信息
http://www.yodao.com/smartresult-xml/search.s?type=id&q=身份證號碼

舉例:http://www.youdao.com/smartresul ... =370782196402121133

返回:
<?xml version="1.0" encoding="gbk"?>
<smartresult>
<product type="identitycard">
<code>370782196402121133</code>
<location>山東省濰坊市諸城市</location>
<birthday>19640212</birthday>
<gender>m</gender>
</product>
</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");當為漢字的時候不處理直接訪問會得不到數據。

返回:
<?xml version="1.0" encoding="gbk"?>??
<smartresult>??
<product type="zipcode">??
<province>湖北省</province>??
<city>武漢市</city>??
<location>湖北省 武漢市</location>??
<phone>027</phone>??
<zipcode>430000</zipcode>??
</product>??
</smartresult>?

舉例:http://www.youdao.com/smartresult-xml/search.s?type=zip&q=021

返回:
<?xml version="1.0" encoding="gbk"?>??
<smartresult>??
<product type="zipcode">??
<province></province>??
<city>上海市</city>??
<location>上海市</location>??
<phone>021</phone>??
<zipcode>200000</zipcode>??
</product>??
</smartresult>

?


<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
? ? ? ? ? ? ? ? 區號查詢城市: <script>
? ? ? ? ? ? ? ? ? ? ? ??function?updateCall(var1, var2, var3){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? $("#info").html(var2.location);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? function showInfo(zip){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? $.getScript("http://www.youdao.com/smartresult-xml/search.s?&jsFlag=true&type=zip&q=" + zip);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? </script>
? ? ? ??
? ? ? ? ? ? ? ? <input name="n" type="text" id="txt">
? ? ? ? ? ? ? ? <input type="button" value="查詢" οnclick="showInfo(txt.value)">
? ? ? ? ? ? ? ? <div id="info"/></div>



? ?? ???
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
? ? ? ? ? ? ? ? 查詢IP歸屬地: <script>
? ? ? ? ? ? ? ? ? ? ? ? function updateCall(var1, var2, var3){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? $("#info2").html(var2.location);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? function showInfo2(zip){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? $.getScript("http://www.youdao.com/smartresult-xml/search.s?&jsFlag=true&type=ip&q=" + zip);
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? </script>? ?? ?? ???
? ? ? ??
? ? ? ? ? ? ? ? <input name="n" type="text" id="txt2">
? ? ? ? ? ? ? ? <input type="button" value="查詢" οnclick="showInfo2(txt2.value)">
? ? ? ? ? ? ? ? <div id="info2"/></div>

總結

以上是生活随笔為你收集整理的有道手机归属地、邮政编码查询等API 实例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。