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

来源:互联网 发布:博思数据研究中心 编辑:程序博客网 时间:2024/06/08 06:33

获取本设备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": ""}

原创粉丝点击