域名数据
查询一个域名的注册时间、域名年龄、注册商、月度流量、排名和流量来源。
请求参数
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