WNEXT WHOIS

API 文件

v1.6

Next Whois 提供簡單的 REST API,用於程式化 WHOIS/RDAP 查詢和動態 OG 圖片生成。所有端點均公開存取,無需認證。

GET
/api/lookup

查詢網域、IP 位址、ASN 或 CIDR 範圍的 WHOIS/RDAP 資訊。RDAP 和 WHOIS 並行查詢;結構化欄位優先使用 RDAP 資料,回退到 WHOIS。兩種原始回應均包含在內。

參數

參數類型必填預設值描述
querystring
必填
網域名稱、IPv4/IPv6 位址、ASN(如 AS13335)或 CIDR 範圍。別名:q

請求範例

curl "https://your-domain.com/api/lookup?query=google.com"

成功回應

{
"status": true,
"time": 1.23,
"cached": false,
"source": "rdap",
"result": {
"domain": "google.com",
"registrar": "MarkMonitor Inc.",
"registrarURL": "http://www.markmonitor.com",
"ianaId": "292",
"whoisServer": "whois.markmonitor.com",
"creationDate": "1997-09-15T04:00:00Z",
"expirationDate": "2028-09-14T04:00:00Z",
"updatedDate": "2019-09-09T15:39:04Z",
"status": [
{ "status": "clientDeleteProhibited", "url": "..." },
{ "status": "clientTransferProhibited", "url": "..." }
],
"nameServers": ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"],
"dnssec": "unsigned",
"domainAge": 28,
"remainingDays": 945,
"rawWhoisContent": "Domain Name: GOOGLE.COM\nRegistry Domain ID: ...",
"rawRdapContent": "{\n \"objectClassName\": \"domain\",\n ...\n}"
}
}

錯誤回應

{
"status": false,
"time": 0.45,
"error": "No match for domain \"EXAMPLE.INVALID\""
}
GET
/api/og

生成包含 WHOIS 詳情的動態 Open Graph 圖片。內部查詢 /api/lookup 並渲染卡片式摘要。回傳 PNG 圖片。

參數

參數類型必填預設值描述
querystring
選填
要查詢和顯示的網域、IP、ASN 或 CIDR。別名:q
wnumber
選填
1200圖片寬度(像素,200-4096)
hnumber
選填
630圖片高度(像素,200-4096)
themestring
選填
light顏色主題:"light" 或 "dark"

請求範例

curl "https://your-domain.com/api/og?query=google.com&theme=dark" -o og.png

預覽

OG Image Preview

/api/og?query=google.com

速率限制與快取
成功的 WHOIS 查詢回應會在伺服器端快取(Redis),並附帶
Cache-Control: s-maxage=3600, stale-while-revalidate=86400
標頭。
快取的回應包含
"cached": true
在 JSON 正文中,並回報
"time": 0
.

Next Whois v1.6 · whois