API 文件
Look up IPs with the API key of an account that has an active plan. Put the key in the X-API-Key header or add ?key= to the address. Plans have no daily lookup limit. Every plan allows up to 20 lookups a second.
基本網址
https://ipinfobox.com/api/v1查詢單一 IP
curl -H "X-API-Key: YOUR_KEY" https://ipinfobox.com/api/v1/8.8.8.8
{
"ip": "8.8.8.8", "version": 4, "type": "public",
"country": { "code": "US", "name": "United States", "name_en": "United States" },
"region": "California", "city": "Mountain View", "continent": "NA",
"location": { "lat": 37.422, "lon": -122.085 },
"asn": { "number": 15169, "org": "Google LLC" },
"privacy": { "vpn": false, "vpn_provider": null, "tor": false,
"hosting": true, "hosting_provider": "Google", "cloud_region": null }
}IPv6 的使用方式相同。私有與特殊 IP 的 type 為 private 或 reserved,位置值為 null。
訪客檢查 (privacy)
vpn, vpn_provider該位址是否在公開 VPN 伺服器清單上,以及供應商名稱 (未知時為 null)
tor是否在 Tor Project 出口節點清單上
hosting, hosting_provider是否位於官方雲端 IP 範圍或主機代管公司網路內,以及公司名稱
cloud_region位於雲端範圍時的區域 (例如 us-east-1)
清單每日更新。未列入清單的 VPN 與住宅代理會回傳 false。私有與特殊 IP 的 privacy 為 null。 檢查的運作方式
用於訪客 IP
// Node.js (Express): ask for extra verification when a sign-up comes from a VPN, Tor or a data center
app.post("/signup", async (req, res) => {
const ip = req.headers["cf-connecting-ip"] ?? req.ip; // behind Cloudflare: CF-Connecting-IP
const r = await fetch(`https://ipinfobox.com/api/v1/${ip}`, { headers: { "X-API-Key": process.env.IPINFOBOX_KEY } });
const info = await r.json();
if (info.privacy && (info.privacy.vpn || info.privacy.tor || info.privacy.hosting)) {
return res.status(403).json({ error: "extra verification required" });
}
// continue sign-up
});# Python
import requests
info = requests.get(f"https://ipinfobox.com/api/v1/{ip}", headers={"X-API-Key": KEY}, timeout=3).json()
risky = bool(info.get("privacy")) and (info["privacy"]["vpn"] or info["privacy"]["tor"] or info["privacy"]["hosting"])查詢您自己的 IP
GET /api/v1/me 發出請求之位址的 IP 與詳細資料剩餘用量
GET /api/v1/usage {"plan_ends_at":"2026-11-11T...","used_today":12,"daily_limit":5000} (無每日上限的方案為 null)錯誤
400 invalid_ip不是有效的 IP 位址。
401 invalid_api_key金鑰遺漏或錯誤。
402 no_subscription您的方案已到期。再次付款後即可立即使用。
429 rate_limited / daily_limit請求過多,或今日用量已用完。