IPinfoBox

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.

基本 URLhttps://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

請求過多,或今日用量已用完。