最近写了个小工具,快速通过API请求获取自己的IP地址信息,以JSON格式返回,方便集成到自己的应用程序当中,有时候调试需要获得自己的IP地址和开发应用程序时候需要获取用户本地IP信息的时候非常有用,可以替代一些查IP的网站
主要功能:
- 返回调用方的 IP、经纬度(大致)、城市、省/州、国家、时区
- 网络侧字段:IP地址对应的ASN、AS 运营商、TLS 版本、TCP RTT、Cloudflare CDN Edge 节点 colo
- 请求相关:User-Agent、Accept-Language
- 默认 JSON,带
?fmt=text输出纯文本
用法
# 获取 JSON
curl -s https://gurl.eu.org/edge-api/whoami| jq
# 获取 plaintext
curl https://gurl.eu.org/edge-api/whoami?fmt=text


