通过请求接口的办法获得本设备IP以及IP地址

获取本设备IP接口(搜狐)

http://pv.sohu.com/cityjson?ie=utf-8

result Content:

{
    "cip": "58.210.119.10",
    "cid": "320500",
    "cname": "江苏省苏州市"
}

查询指定IP的地址:

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=218.4.255.255

result Content:
{
    "ret": 1,
    "start": -1,
    "end": -1,
    "country": "中国",
    "province": "江苏",
    "city": "苏州",
    "district": "",
    "isp": "",
    "type": "",
    "desc": ""
}

<script type="text/javascript" src="http://ip.chinaz.com/getip.aspx"></script>
原文地址:https://www.cnblogs.com/hedianzhan/p/9173401.html