跳到正文
赞助 AccsZone — 购买账号, 即时发货, 24/7客服

ipcheckerpro API

免费、无需密钥的 JSON API,提供 IP 地理定位、ASN 数据、标记、黑名单、WHOIS 和 DNS 记录。每分钟 60 次请求,支持 CORS,附示例。

接口

GET/api/v1/ip频率限制: 60/min

Your own address: location, network, type and flags (never cached).

示例
curl -s https://ipcheckerpro.com/api/v1/ip
GET/api/v1/ip/{ip}频率限制: 60/min

Any public IPv4/IPv6 address. Add whois=1 (RDAP record) and blacklists=1 (DNSBL checks, IPv4).

示例
curl -s "https://ipcheckerpro.com/api/v1/ip/1.1.1.1?whois=1&blacklists=1"
GET/api/v1/asn/{asn}频率限制: 60/min

Autonomous system details: name, country, type, prefix counts; whois=1 adds the registry record.

示例
curl -s "https://ipcheckerpro.com/api/v1/asn/13335?whois=1"
GET/api/v1/dns?name=&type=频率限制: 30/min

DNS records of a hostname (A, AAAA, CNAME, MX, NS, TXT, SOA, SRV, CAA, PTR).

示例
curl -s "https://ipcheckerpro.com/api/v1/dns?name=example.com&type=MX"
POST/api/v1/bulk新频率限制: 5/min

Up to 100 addresses in one JSON array: country, city, ASN, type, Tor/hosting/DROP flags and risk score.

示例
curl -s -X POST https://ipcheckerpro.com/api/v1/bulk -H "Content-Type: application/json" -d '["1.1.1.1","8.8.8.8"]'
GET/api/v1/stats/live新频率限制: 60/min

Anonymous aggregates: checks in the last 24 h, countries seen, top networks, dataset versions.

示例
curl -s https://ipcheckerpro.com/api/v1/stats/live
GET/api/v1/stats/weekly新频率限制: 60/min

Weekly operating aggregates (last 7 days vs the 7 before): checks, languages, tools, countries, dataset freshness, cron and health history.

示例
curl -s https://ipcheckerpro.com/api/v1/stats/weekly

获取免费 API 密钥

无密钥接口允许每个 IP 每分钟 60 次请求。免费密钥把它提高到每天 1,000 次、每分钟 300 次,按密钥而非按 IP 计数——足以支撑一个小型应用、一个定时任务或一个仪表盘。密钥会发送到您的邮箱,并在下方显示一次。

我们存储密钥的哈希和您的邮箱,以便您可以要求我们撤销它。没有邮件订阅。

使用密钥

在任何 /api/v1/ 接口上通过 X-API-Key 请求头(推荐)或 key 查询参数发送密钥。每个响应都带有 X-RateLimit-Limit 和 X-RateLimit-Remaining 请求头表示每日配额;GET /api/v1/key 返回所提供密钥今日的用量。

配额

无密钥使用免费密钥
每个 IP 每分钟请求数60 (DNS: 30)—
每个密钥每分钟请求数—300
每个密钥每天请求数—1,000
POST /api/v1/bulk5 batches/min · 100 IPs5 batches/min · 100 IPs

示例

curl -s -H "X-API-Key: YOUR_KEY" \
  "https://ipcheckerpro.com/api/v1/ip/1.1.1.1?checks=native,risk"

# usage of the key
curl -s -H "X-API-Key: YOUR_KEY" https://ipcheckerpro.com/api/v1/key

概述

机器可读的描述:/api/v1/openapi.json(OpenAPI 3.1)。

API 以 JSON 返回与网站相同的数据:任意 IP 地址的位置、网络和分类、其背后的注册记录、黑名单状态、ASN 详情和 DNS 记录。无需密钥,无需注册。

  • 基础 URL:https://ipcheckerpro.com/api/v1
  • 格式:JSON,UTF-8,仅 GET
  • 限制:IP 和 ASN 接口每个 IP 地址每分钟 60 次请求,DNS 接口每分钟 30 次
  • CORS:每个响应都带 Access-Control-Allow-Origin: *,浏览器可直接调用
  • 署名:如果您展示这些数据,请显示“IP geolocation by DB-IP”并链接到 db-ip.com(见下文“署名”)

接口

GET /api/v1/ip

返回调用者自身地址的画像。响应标记为 Cache-Control: private, no-store,因此总是最新的。

curl -s https://ipcheckerpro.com/api/v1/ip

GET /api/v1/ip/{ip}

返回任意公网 IPv4 或 IPv6 地址的画像。可选查询参数:

  • whois=1 添加 whois 对象,包含通过 RDAP 获取的注册记录。
  • blacklists=1 运行八项 DNS 黑名单检查(仅 IPv4)并填充 blacklists 对象。

响应可缓存 300 秒。黑名单结果在我们这边缓存一小时,注册记录缓存 24 小时。

curl -s "https://ipcheckerpro.com/api/v1/ip/1.1.1.1?whois=1&blacklists=1"

GET /api/v1/asn/{asn}

返回自治系统的详情。编号可带或不带 AS 前缀。添加 whois=1 可在 registry 对象中包含注册记录。响应可缓存一小时。

curl -s "https://ipcheckerpro.com/api/v1/asn/13335?whois=1"

GET /api/v1/dns?name=&type=

返回主机名的 DNS 记录。type 为 A、AAAA、CNAME、MX、NS、TXT、SOA、SRV、CAA 或 PTR 之一;默认为 A。响应可缓存 60 秒。

curl -s "https://ipcheckerpro.com/api/v1/dns?name=example.com&type=MX"

响应结构

成功的 IP 请求返回包含以下字段的对象。未知的值为 null。下面的值仅为示意;请运行请求查看某个地址的当前数据。

{
  "ip": "1.1.1.1",
  "version": 4,
  "private": false,
  "hostname": "one.one.one.one",
  "location": {
    "country_code": "AU",
    "country": "Australia",
    "region": "Queensland",
    "city": "Brisbane",
    "latitude": -27.4679,
    "longitude": 153.028,
    "timezone": "Australia/Brisbane",
    "continent": "OC",
    "eu": false
  },
  "network": {
    "asn": 13335,
    "name": "CLOUDFLARENET",
    "prefix": "1.1.1.0/24",
    "country_code": "US",
    "type": "hosting"
  },
  "classification": "hosting",
  "flags": {
    "hosting": true,
    "tor": false,
    "vpn_provider": false,
    "spamhaus_drop": null,
    "datacenter": "Cloudflare",
    "mobile": false
  },
  "blacklists": { "checked": 8, "listed": 0 },
  "sources": {
    "geolocation": "DB-IP Lite (CC BY 4.0)",
    "asn": "iptoasn.com / DB-IP Lite"
  }
}

字段说明:

  • version 为 4 或 6。private 对环回、链路本地和私有地址段为 true;这类地址没有 location 或 network。
  • hostname 是 PTR(反向 DNS)记录,或 null。
  • network.type 是由 ASN 名称和公开列表推导的网络分类:isp、mobile、hosting、education、government、business 或 unknown。
  • classification 是总体判定:residential、mobile、hosting、vpn、tor、education、government、business、private 或 unknown。
  • flags.spamhaus_drop 是匹配的 DROP 地址段字符串,或 null。flags.datacenter 是数据中心列表中匹配的服务商名称,或 null。
  • blacklists 除非给出 blacklists=1,否则为 null。
  • whois(带 whois=1)包含 handle、name、type、start、end、cidr、country、parent、status、entities、events、remarks、links 和 registry。

ASN 请求返回 asn、name、country_code、type、ipv4_prefixes、ipv4_addresses、ipv6_prefixes、prefixes_sample(最多 20 个 CIDR 字符串)、registry(带 whois=1 时,否则为 null)和 source。

DNS 请求返回 name、type 和 records,后者是 { "name", "ttl", "value" } 对象的数组。

错误

错误是带 error 代码和(通常)message 的 JSON 对象:

状态 error 含义
400 invalid_ip 路径段不是有效的 IPv4 或 IPv6 地址
400 invalid_asn ASN 不是数字
400 invalid_query name 不是主机名,或 type 不受支持
404 not_found 该 ASN 没有已知的宣告前缀
429 rate_limited 超出限制;请稍候重试

示例

JavaScript(浏览器或 Node)

const res = await fetch("https://ipcheckerpro.com/api/v1/ip/8.8.8.8?whois=1");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data.location.country, data.network.name, data.classification);

Python

import requests

r = requests.get("https://ipcheckerpro.com/api/v1/ip/8.8.8.8", params={"blacklists": 1}, timeout=10)
r.raise_for_status()
data = r.json()
print(data["location"]["country"], data["network"]["name"], data["blacklists"])

用 curl 查询调用者自身地址

curl -s https://ipcheckerpro.com/api/v1/ip | jq '{ip, country: .location.country, type: .network.type}'

署名

地理定位数据来自 DB-IP Lite,采用 Creative Commons Attribution 4.0 许可。如果您向用户展示本 API 的数据,请在数据附近显示文字“IP geolocation by DB-IP”并链接到 https://db-ip.com。ASN 数据来自 iptoasn.com(公有领域)和 DB-IP Lite。黑名单和注册结果归各自运营方所有,仅供您自行使用,不得作为数据集再分发。

合理使用

上述限制按调用 IP 地址计算。如需更多,请在您这边缓存响应;一个地址的位置和网络数据在一天内很少变化。请勿使用本 API 构建底层数据库的副本。完整的可接受使用规则见使用条款。

变更

API 在路径中带版本号。响应中可能在不另行通知的情况下新增字段;v1 内现有字段不会被重命名或移除。对限制、接口或行为的更改会在生效前在本页公布。