几个网址
- ip-api.com(推荐,速度快)
- ipecho.net(推荐)
- 百度(效果也不错)
- ip.cn(不支持 cURL)
- ipinfo.io
- cip.cc
- ifconfig.me
- myip.ipip.net
样例
- ip-api.com
$ curl 'http://ip-api.com/json/?lang=zh-CN'
返回结果:
{
"status": "success",
"country": "德国",
"countryCode": "DE",
"region": "HE",
"regionName": "Hesse",
"city": "法兰克福",
"zip": "60313",
"lat": 50.1188,
"lon": 8.6843,
"timezone": "Europe/Berlin",
"isp": "Linode, LLC",
"org": "Linode, LLC",
"as": "AS63949 Linode, LLC",
"query": "192.46.239.172"
}
- ipecho.net
$ curl ipecho.net/plain
返回结果:
168.63.213.70
https://ipecho.net 用于浏览器,还提供了更多相关知识和工具,如:https://ipinfo.io/
https://ipecho.net/plain 查询 IP,可用于开发
https://ipecho.net/extra 可以提供更多信息
- ipinfo.io
$ curl ipinfo.io
返回结果:
{
"ip": "111.30.233.219",
"city": "Tianjin",
"region": "Tianjin",
"country": "CN",
"loc": "39.1422,117.1767",
"org": "AS38019 tianjin Mobile Communication Company Limited",
"timezone": "Asia/Shanghai",
"readme": "https://ipinfo.io/missingauth"
}
- cip.cc
$ curl cip.cc
返回结果:
IP : 111.30.233.219
地址 : 中国 天津
运营商 : 移动
数据二 : 天津市 | 移动
数据三 : 中国天津天津 | 移动
URL : http://www.cip.cc/111.30.233.219
- myip.ipip.net
$ curl myip.ipip.net
返回结果:
当前 IP:111.30.233.219 来自于:中国 天津 天津 移动
- ifconfig.me
$ curl ifconfig.me
111.30.233.219
- members.3322.org/dyndns/getip
$ curl members.3322.org/dyndns/getip
111.30.233.219
(完)
作者:舌尖上的大胖
链接:https://www.jianshu.com/p/09363560a833
文章评论