🌐 IP Address Lookup API

接口地址

https://ip.020028.xyz

查询 IP 归属地

GET /ip/{ip_address}

查询指定 IP 的归属地信息(支持 IPv4 和 IPv6)。

示例

# 查询单个 IP (默认文本格式)
curl https://ip.020028.xyz/ip/8.8.8.8
# 输出: 8.8.8.8|United States|California|0|Google LLC|US

# 查询 IPv6
curl https://ip.020028.xyz/ip/240e:3b7:3272:d8d0:db09:c067:8d59:539e
# 输出: 240e:3b7:3272:d8d0:db09:c067:8d59:539e|中国|广东省|深圳市|电信|CN

查询本机 IP

GET /ip

不传 IP 参数则自动查询请求来源的 IP 地址。

curl https://ip.020028.xyz/ip

输出格式

通过 format 参数指定输出格式(默认: text)。

参数值格式说明
text (默认)纯文本IP|国家|省份|城市|运营商|国家代码
jsonJSON{"ip":"...","region":"...","found":true}
xmlXML<IPInfo><IP>...</IP><Region>...</Region>...</IPInfo>
# JSON 格式
curl "https://ip.020028.xyz/ip/114.114.114.114?format=json"

# XML 格式
curl "https://ip.020028.xyz/ip/114.114.114.114?format=xml"

身份认证(可选)

携带 Token 可绕过每分钟 600 次的频率限制,适合高频调用场景。

# 通过 URL 参数
curl "https://ip.020028.xyz/ip/8.8.8.8?token=your-token-here"

# 通过请求头
curl -H "X-Token: your-token-here" https://ip.020028.xyz/ip/8.8.8.8

频率限制

未携带 Token 的请求受全局频率限制:每分钟最多 600 次。超出返回 429 Rate limit exceeded


IP Address Lookup Service © 2026 — Data from ip2region