Pull WHOIS

PULL WHOIS · API REFERENCE

域名查询 API

一个接口拿到结构化的域名注册信息。服务端优先请求注册局 RDAP,未覆盖或失败时自动回退到 WHOIS 43 端口,并统一字段、日期、状态码与命名服务器格式。十六种工具覆盖注册、DNS、 证书、安全体检与健康评分,全部返回统一 JSON 结构。

v1.2.4 OpenAPI 3.1 下载规范 在线试一次
两套独立策略:网页端使用 /web/v1/*,始终无需 API Key,由后台 「网页端查询」开关控制;API 使用 /v1/*,是否需要 Key 由「API 是否需要 Key」开关单独控制。两者互不影响。
API 认证:开启 API Key 校验后请在请求头携带 x-api-key 或 Authorization: Bearer <key>,密钥可在 管理后台 创建与停用;服务启动时的 API_KEYS 环境变量同样有效。
限流:默认每 IP 每分钟 120 次,携带有效 API Key 每分钟 600 次。响应头包含 ratelimit-limit、ratelimit-remaining、ratelimit-reset。
网页端额度与风控:管理员可在后台单独设置网页端的窗口请求上限、限流窗口、 每日每 IP 额度与违规临时封禁。额度开启时响应头额外返回 x-web-quota-limit、x-web-quota-remaining;超限返回 429,并通过 Retry-After 给出等待秒数。API 调用不受该策略影响。
密钥策略:每个密钥可单独设置有效期、累计配额、每分钟限速、功能作用域 (whois / rdap / dns / ip / uptime / history / nameservers / registrars / icp / tls / certchain / mail / http / dnsprop / health / available)与 IP/CIDR 白名单。响应头会返回 x-key-quota-used、x-key-quota-limit、 x-key-quota-remaining 与 x-key-expires-at 便于调用方自查。

证书、邮件与站点体检

以下工具完全由本站直接查询:证书通过目标端口完成 TLS 握手,邮件记录通过权威 DNS 解析后在本地校验, HTTP 安全头由本站直接请求目标站点读取,均不依赖第三方检测服务。 以下接口同时可在网页端对应工具中使用。

GET /v1/tls/{host}?port=443

TLS 证书检查

与目标端口直接握手,返回证书主体、颁发者、有效期、SAN、公钥长度、SHA-256 指纹、 证书链、TLS 版本、加密套件与 ALPN,支持非 443 端口。

参数位置类型说明
hostpathstring域名,不接受 IP 或内网地址,例如 example.com。
portqueryinteger端口 1–65535,默认 443;也可使用 /v1/tls?host=example.com&port=443。
curl 'https://pull-whois.asoe.cn/v1/tls/example.com' \
  -H 'accept: application/json'
{
  "success": true,
  "data": {
    "host": "example.com",
    "port": 443,
    "servername": "example.com",
    "address": "93.184.216.34",
    "family": 4,
    "reachable": true,
    "authorized": true,
    "authorizationError": null,
    "protocol": "TLSv1.3",
    "cipher": { "name": "TLS_AES_128_GCM_SHA256", "version": "TLSv1.3" },
    "alpn": "http/1.1",
    "certificate": {
      "subject": { "commonName": "example.com", "organization": null, "country": null },
      "issuer": { "commonName": "DigiCert Global G2 TLS RSA SHA256 2020 CA1", "organization": "DigiCert Inc", "country": "US" },
      "validFrom": "2026-09-26T00:00:00.000Z",
      "validTo": "2027-03-25T23:59:59.000Z",
      "daysRemaining": 124,
      "expired": false,
      "notYetValid": false,
      "serialNumber": "0A:1B:...",
      "fingerprint256": "85:CA:...:7A",
      "san": ["example.com", "*.example.com"],
      "keyBits": 2048,
      "chainLength": 3
    },
    "note": "证书信息由本站直接与目标端口完成 TLS 握手获取…",
    "checkedAt": "2026-11-21T10:00:00.000Z",
    "cached": false,
    "ttlMs": 1800000
  },
  "meta": { "requestId": "req-1", "source": "tls", "durationMs": 210, "cached": false }
}

说明:握手使用 SNI;证书链长度来自完整链读取;结果缓存 30 分钟。 authorized=false 时由 authorizationError 说明原因(过期、自签名、域名不匹配等)。 校验结果仅供参考,请以浏览器实际提示为准。

GET /v1/mail/{domain}?selector=default,google

邮件安全记录

一次返回 MX、SPF、DMARC、DKIM 原始记录与逐项检查结论,并给出「良好 / 需改进 / 缺少关键配置」总评。 全部通过本站 DNS 解析与本地解析器完成。

参数位置类型说明
domainpathstring域名或邮箱中的域名,例如 cloudflare.com。
selectorquerystring可选,DKIM 选择器,逗号分隔,最多 6 个;默认探测 default、google、selector1、selector2。
curl 'https://pull-whois.asoe.cn/v1/mail/cloudflare.com?selector=default,google' \
  -H 'accept: application/json'
{
  "success": true,
  "data": {
    "domain": "cloudflare.com",
    "mx": [{ "priority": 10, "exchange": "mx1.example.net" }],
    "aFallback": [],
    "spf": {
      "raw": "v=spf1 include:_spf.example.net -all",
      "version": true,
      "mechanisms": ["include:_spf.example.net", "-all"],
      "all": "all",
      "allQualifier": "-",
      "includes": ["_spf.example.net"],
      "ip4": [],
      "ip6": [],
      "redirect": null,
      "lookupCount": 1,
      "valid": true,
      "errors": [],
      "warnings": []
    },
    "dmarc": {
      "raw": "v=DMARC1; p=reject;",
      "version": true,
      "policy": "reject",
      "subdomainPolicy": null,
      "pct": 100,
      "rua": [],
      "ruf": [],
      "alignment": { "dkim": "r", "spf": "r" },
      "tags": { "v": "DMARC1", "p": "reject" },
      "valid": true,
      "errors": []
    },
    "dkim": [{ "selector": "default", "found": false, "info": null }],
    "checks": [
      { "id": "mx", "label": "MX 邮件交换记录", "status": "pass", "detail": "4 条 MX 记录" },
      { "id": "spf", "label": "SPF 发信来源", "status": "pass", "detail": "包含 2 个机制,all=-all" },
      { "id": "dmarc", "label": "DMARC 策略", "status": "pass", "detail": "p=reject" },
      { "id": "dkim", "label": "DKIM 签名公钥", "status": "warn", "detail": "常见选择器下未找到 DKIM 公钥" }
    ],
    "summary": "需改进",
    "note": "SPF、DMARC、DKIM 与 MX 均由本站直接查询 DNS 后解析…",
    "cached": false,
    "ttlMs": 600000
  },
  "meta": { "requestId": "req-2", "source": "mail-dns", "durationMs": 180, "cached": false }
}

说明:DKIM 选择器无法通过 DNS 枚举,只能探测已知选择器;found=true 但公钥为空表示该选择器已撤销。 SPF 的 DNS 查询机制超过 RFC 10 次上限、+all 等风险会写入 errors 或 warnings。 结果缓存 10 分钟。

GET /v1/http/{target}

HTTP 安全响应头体检

直连目标站点读取响应头,检查 HSTS、CSP、X-Frame-Options、MIME 嗅探、Referrer-Policy、 Permissions-Policy、COOP 与 Cookie 安全属性,按权重计算 0–100 分与 A–E 等级。 只读取响应头并立即取消正文,拒绝内网与保留地址。

参数位置类型说明
targetpathstring域名或完整 http(s) URL;也支持 /v1/http?target=example.com。
refreshqueryboolean传 1 强制重新体检并绕过缓存,默认 false。
curl 'https://pull-whois.asoe.cn/v1/http/example.com' \
  -H 'accept: application/json'
{
  "success": true,
  "data": {
    "host": "example.com",
    "finalUrl": "https://example.com/",
    "https": true,
    "reachable": true,
    "status": 200,
    "latencyMs": 142,
    "score": 72,
    "grade": "C",
    "summary": "基础安全头可用,仍有 3 项建议改进",
    "security": [
      { "id": "hsts", "label": "HSTS 强制 HTTPS", "status": "pass", "detail": "max-age=31536000" },
      { "id": "csp", "label": "内容安全策略 CSP", "status": "fail", "detail": "未设置 Content-Security-Policy" }
    ],
    "issues": [{ "label": "补充 CSP", "severity": "medium", "detail": "建议设置 default-src 'self'" }],
    "redirects": [],
    "note": "响应头由本站直接请求目标站点读取…",
    "cached": false
  },
  "meta": { "requestId": "req-3", "source": "http-probe", "durationMs": 160, "cached": false }
}

说明:最多跟随 5 次重定向;结果缓存 5 分钟。

GET /v1/dnsprop/{domain}?type=A

DNS 多解析器传播对比

同时向阿里 DNS、DNSPod、Cloudflare 与 Google DNS 查询同一记录,返回每个解析器的记录、 耗时与状态,并按记录集合分组标示差异,便于判断解析是否已传播。 支持 A / AAAA / MX / TXT / NS / CNAME / CAA。

参数位置类型说明
domainpathstring域名,例如 example.com;也支持 /v1/dnsprop?domain=example.com&type=A。
typequerystring记录类型,默认 A,可选 AAAA、MX、TXT、NS、CNAME、CAA。
curl 'https://pull-whois.asoe.cn/v1/dnsprop/example.com?type=A' \
  -H 'accept: application/json'
{
  "success": true,
  "data": {
    "domain": "example.com",
    "type": "A",
    "consistent": true,
    "successful": 4,
    "failed": 0,
    "resolvers": [
      { "name": "阿里 DNS", "address": "223.5.5.5", "status": "ok", "records": ["93.184.216.34"], "durationMs": 28 },
      { "name": "Cloudflare", "address": "1.1.1.1", "status": "ok", "records": ["93.184.216.34"], "durationMs": 41 }
    ],
    "differences": [],
    "note": "四个公共递归解析器并发查询…",
    "cached": false
  },
  "meta": { "requestId": "req-5", "source": "dns-propagation", "durationMs": 88, "cached": false }
}

说明:单路超时或不支持该记录类型时按失败记录,不影响其他解析器;结果缓存 60 秒。

GET /v1/health/{domain}

域名健康评分

从注册与所有权、DNS 解析、HTTPS 证书、邮件安全四个维度各 25 分聚合为 0–100 健康评分, 输出 A+ 至 E 等级与可直接执行的改进项。任一上游暂时不可用只影响对应维度。

参数位置类型说明
domainpathstring域名,例如 example.com;也支持 /v1/health?domain=example.com。
refreshqueryboolean传 1 强制重新评分并绕过缓存,默认 false。
dimensionsquerystring只评估指定维度,逗号分隔:registration、dns、tls、mail。未选维度不发起上游请求,分数按所选维度归一化为 0–100。
curl 'https://pull-whois.asoe.cn/v1/health/example.com?dimensions=dns,tls' \
  -H 'accept: application/json'
{
  "success": true,
  "data": {
    "domain": "example.com",
    "score": 84,
    "grade": "A",
    "summary": "整体健康,建议补齐 DNSSEC",
    "dimensions": [
      { "key": "registration", "label": "注册与所有权", "score": 21, "max": 25, "status": "pass", "checks": [] },
      { "key": "dns", "label": "DNS 解析", "score": 23, "max": 25, "status": "pass", "checks": [] },
      { "key": "tls", "label": "HTTPS 证书", "score": 25, "max": 25, "status": "pass", "checks": [] },
      { "key": "mail", "label": "邮件安全", "score": 15, "max": 25, "status": "warn", "checks": [] }
    ],
    "issues": [{ "label": "DNSSEC", "status": "warn", "detail": "域名未签名 DNSSEC" }],
    "note": "评分基于公开注册、DNS、TLS 与邮件记录…",
    "cached": false
  },
  "meta": { "requestId": "req-6", "source": "health-score", "durationMs": 940, "cached": false }
}

说明:评分用于快速体检,不替代人工安全审计;结果缓存 10 分钟。

GET /v1/available?domains=example.com,example.net

批量可注册检测

一次检测最多 10 个域名,优先查询注册局 RDAP,未覆盖时自动回退 WHOIS 43。 支持逗号、分号或空格分隔,自动去重并返回每个域名的可注册状态、注册商与到期时间。

参数位置类型说明
domainsquerystring1–10 个域名,逗号、分号或空格分隔;也支持 /v1/available/{domains} 路径形式。
curl 'https://pull-whois.asoe.cn/v1/available?domains=example.com,example.net' \
  -H 'accept: application/json'
{
  "success": true,
  "data": {
    "total": 2,
    "available": 1,
    "registered": 1,
    "unknown": 0,
    "truncated": 0,
    "durationMs": 620,
    "items": [
      { "domain": "example.com", "status": "registered", "source": "rdap", "registrar": "RESERVED-Internet Assigned Numbers Authority", "expires": null },
      { "domain": "example.net", "status": "registered", "source": "rdap", "registrar": "RESERVED-Internet Assigned Numbers Authority", "expires": null }
    ],
    "note": "可注册结论基于注册局 RDAP 与 WHOIS…",
    "cached": false
  },
  "meta": { "requestId": "req-7", "source": "availability", "durationMs": 640, "cached": false }
}

说明:并发上限 3;可注册状态使用较短缓存,避免返回过期结论。

GET /v1/tls/{host}/chain?format=json

TLS 证书链导出

按服务器返回顺序列出完整证书链,包含每一级主体、颁发者、有效期、SHA-256 指纹与 PEM, 并合并为可直接下载的 PEM 文件,用于排查证书链缺失与顺序问题。

参数位置类型说明
hostpathstring域名,例如 example.com;也支持 /v1/certchain?host=example.com。
portqueryinteger端口 1–65535,默认 443。
formatquerystringjson(默认)返回结构化链;pem 直接返回 application/x-pem-file。
curl 'https://pull-whois.asoe.cn/v1/tls/example.com/chain' \
  -H 'accept: application/json'

# 直接下载 PEM
curl 'https://pull-whois.asoe.cn/v1/tls/example.com/chain?format=pem' -o example-chain.pem
{
  "success": true,
  "data": {
    "host": "example.com",
    "port": 443,
    "address": "93.184.216.34",
    "count": 3,
    "chain": [
      {
        "index": 0,
        "subject": "CN=example.com",
        "issuer": "CN=DigiCert Global G2 TLS RSA SHA256 2020 CA1",
        "validFrom": "2026-09-26T00:00:00.000Z",
        "validTo": "2027-03-25T23:59:59.000Z",
        "fingerprint256": "85:CA:...:7A",
        "selfSigned": false,
        "pem": "-----BEGIN CERTIFICATE-----\\n…\\n-----END CERTIFICATE-----"
      }
    ],
    "pem": "-----BEGIN CERTIFICATE-----\\n…\\n-----END CERTIFICATE-----",
    "note": "证书链由本站直接与目标端口握手获取…",
    "cached": false
  },
  "meta": { "requestId": "req-8", "source": "cert-chain", "durationMs": 230, "cached": false }
}

说明:结果缓存 30 分钟;format=pem 时响应体为纯 PEM 文本,不带 JSON 包装。

错误处理

所有失败响应都使用统一结构,HTTP 状态码与 error.code 同时表达语义。批量接口中单个域名失败不会影响其他结果。

状态码error.code说明
400INVALID_DOMAIN域名格式不合法,例如缺少后缀、包含非法字符或为 IP 地址。
400BAD_REQUEST查询参数或请求体不合法。
401UNAUTHORIZED服务开启 API Key 校验但未提供有效 Key。
401KEY_DISABLED密钥已被管理员停用。
401KEY_EXPIRED密钥已超过有效期。
403KEY_QUOTA_EXCEEDED密钥累计调用次数已达配额,可在后台重置用量。
403KEY_SCOPE_DENIED该密钥未被授权调用当前功能接口。
403KEY_IP_DENIED请求来源 IP 不在密钥白名单内。
404NOT_FOUND接口路径不存在。
429RATE_LIMITED触发限流,参考 Retry-After 响应头。ICP 备案接口在公共数据源冷却时也会返回,details.retryAfterSec 给出建议等待秒数。
429WEB_QUOTA_EXCEEDED网页端每个 IP 的每日查询额度已用完,Retry-After 给出重置等待秒数;使用 API Key 不受该额度限制。
502UPSTREAM_UNAVAILABLE上游数据源无法返回结果,details.attempts 包含每次尝试。
503WEB_DISABLED网页端查询已被管理员关闭(仅影响 /web/v1/*)。
503FEATURE_DISABLED对应工具功能已被管理员关闭。
504UPSTREAM_TIMEOUT注册局接口超时。
500INTERNAL未预期的服务端错误。
{
  "success": false,
  "error": {
    "code": "INVALID_DOMAIN",
    "message": "请输入完整域名(包含后缀),例如 example.com"
  },
  "meta": { "requestId": "req-4" }
}

数据模型