網域資料
查詢一個網域的註冊時間、網域年齡、註冊商、月度流量、排名與流量來源。
請求參數
domain
型別string
必填是
說明網域、URL 或主機名稱,查詢前會先正規化;IP 會被拒絕。
請求範例
GET https://seo-api.org/api/v1/domain?domain=example.com 查詢一個網域。domain 參數可以是裸網域、URL 或帶 www 的主機名稱,查詢前會先正規化;子網域按原樣查詢。成功時回應格式為 { ok, data },失敗時為 { ok: false, error }。完整的成功回應如下(數值僅為範例):
curl "https://seo-api.org/api/v1/domain?domain=example.com" \
-H "Authorization: Bearer YOUR_API_KEY"回應範例
{
"ok": true,
"data": {
"domain": "example.com",
"status": "ready",
"message": null,
"retryAfterSeconds": null,
"site": {
"title": "Example Domain",
"description": "Example site used for illustration."
},
"registration": {
"createdAt": 808372800000,
"expiresAt": 1786852800000,
"updatedAt": 1755043200000,
"ageDays": 11283,
"registrar": "RESERVED-Internet Assigned Numbers Authority",
"nameServers": [
"a.iana-servers.net",
"b.iana-servers.net"
]
},
"traffic": {
"latestMonth": "2026-09",
"visits": 1840000,
"bounceRate": 0.52,
"pagesPerVisit": 1.6,
"visitDurationSeconds": 74,
"globalRank": 18452,
"countryCode": "US",
"countryRank": 9120,
"category": "Computers Electronics and Technology",
"categoryRank": 812,
"sources": {
"direct": 0.61,
"searchOrganic": 0.27,
"searchPaid": 0,
"referrals": 0.08,
"socialOrganic": 0.02,
"socialPaid": 0,
"mail": 0.01,
"genAi": 0.01,
"affiliate": null,
"displayAds": null
},
"months": [
{
"month": "2026-09",
"visits": 1840000,
"bounceRate": 0.52,
"pagesPerVisit": 1.6,
"visitDurationSeconds": 74,
"sources": null
}
],
"updatedAt": 1793145600000
},
"billing": {
"creditsCharged": 1,
"creditsRemaining": 99
}
}
}回應欄位
時間都是毫秒級 Unix 時間戳。缺失的值是 null,不會寫成 0,所以「未知」不會和「零」混淆。
domain
型別string
說明正規化後的主機名稱:小寫、去掉協定和路徑、去掉開頭的 www.,子網域保留。
status
型別"ready" | "pending" | "empty" | "failed"
說明ready:回傳了流量資料(扣 1 點數)。pending:採集中,稍後重試。empty:沒有流量資料。failed:採集失敗。
message
型別string | null
說明status 不是 ready 時的說明文字(英文)。
retryAfterSeconds
型別number | null
說明pending 時建議等待多少秒再查。
site.title / site.description
型別string | null
說明流量面板看到的網站標題和 meta description。
registration.createdAt
型別number | null
說明註冊時間,毫秒級 Unix 時間戳。
registration.ageDays
型別number | null
說明從 createdAt 到回應時刻的整天數。
registration.expiresAt / updatedAt
型別number | null
說明註冊局給出的到期時間和最近更新時間,毫秒。
registration.registrar
型別string | null
說明註冊商名稱。
registration.nameServers
型別string[] | null
說明權威 DNS 伺服器。
traffic.latestMonth
型別string | null
說明最新資料所在的月份,YYYY-MM。
traffic.visits
型別number | null
說明latestMonth 的估算造訪量。
traffic.bounceRate
型別number | null
說明跳出率,0 到 1。
traffic.pagesPerVisit
型別number | null
說明每次造訪的平均頁數。
traffic.visitDurationSeconds
型別number | null
說明平均停留時間(秒)。
traffic.globalRank / countryRank / categoryRank
型別number | null
說明全站排名、在 countryCode 國家內的排名、在類別內的排名。
traffic.countryCode / category
型別string | null
說明造訪量最多的國家(ISO 代碼)和網站類別。
traffic.sources
型別object | null
說明最近一個月的流量來源佔比:direct、searchOrganic、searchPaid、referrals、socialOrganic、socialPaid、mail、genAi、affiliate、displayAds,每項 0 到 1,未知為 null。
traffic.months[]
型別array
說明按月升序的歷史資料:month、visits、bounceRate、pagesPerVisit、visitDurationSeconds、sources。
traffic.updatedAt
型別number | null
說明流量資料最近一次採集完成的時間,毫秒。
billing.creditsCharged
型別number
說明本次呼叫扣的點數:1 或 0。
billing.creditsRemaining
型別number | null
說明本次呼叫後的餘額。
計費
只有 status 為 ready 時才扣 1 點數。24 小時內再次查詢同一網域免費,不論用的是哪個 key、哪種方式。
錯誤碼
SEO_API.MISSING_API_KEY
HTTP401
含義沒有 Authorization 標頭,也沒有 x-api-key 標頭。
SEO_API.INVALID_API_KEY
HTTP401
含義key 不存在或已被撤銷。
SEO_API.INVALID_DOMAIN
HTTP400
含義缺少 domain 參數,或者它不是網域(IP 會被拒絕)。
BILLING.INSUFFICIENT_CREDITS
HTTP402
含義帳號點數用完了。24 小時內的重複查詢仍然可用。
SYSTEM.INTERNAL_SERVER_ERROR
HTTP500
含義我們這邊出了問題,請稍候再重試。
透過 MCP 呼叫
工具名稱 get_domain_data,參數與回傳內容和 REST 呼叫一致。
{
"name": "get_domain_data",
"arguments": {
"domain": "example.com"
}
}透過命令列呼叫
npx @seo-api/cli domain example.com
npx @seo-api/cli domain example.com --json --wait