Tencent IP Address query interface: http://fw.qq.com/ipaddress
Sina IP Address query interface: HTTP://INT.DPOOL.SINA.COM.CN/IPLOOKUP/IPLOOKUP.PHP?FORMAT=JS
Sohu IP Address query interface: Http://pv.sohu.com/cityjson
Google IP address query interface: http://j.maxmind.com/app/geoip.js
Youdao IP Address query interface: HTTP://WWW.YOUDAO.COM/SMARTRESULT-XML/SEARCH.S
1616 IP Address query interface: http://w.1616.net/chaxun/iptolocal.php
126 Http://ip.ws.126.net/ipquery
Hao123 http://app.hao123.com/ipquery/getcity.php?rtype=2
Let me take a look at the test Tencent IP address AIP
Tencent's IP Address API interface address: http://fw.qq.com/ipaddress
The data format returned is:
The code is as follows |
|
var ipdata = new Array ("58.218.198.205″," "", "Jiangsu province", "Xuzhou"); |
Use JS code to make a fetch:
The code is as follows |
|
<script language= "javascript" type= "Text/javascript" src= "http://fw.qq.com/ipaddress" ></script> <script>document.write ("Your IP is:" +ipdata[0]+ ", From:" +ipdata[2]);</script> |
Sina IP Address query interface returned by the
The code is as follows |
|
var remote_ip_info = {"ret": 1, "Start": "123.68.0.0", "End": "123.68.195.255", "Country": "U4e2du56fd", "Province": "u6e56u5357", "City": "U957fu6c99", "District": "", "ISP": "u94c1u901a", "type": "", "desc": ""}; |
Sohu IP Address Query interface
The code is as follows |
|
var returncitysn = {"CIP": "123.68.122.147", "CID": "430000", "CNAME": "Hunan Province"}; |
All right, I'm not going to introduce you to the rest of the operation.