REST API + MCP 服务器

SEO 报告 API 为
开发者和 AI 代理

通过 REST 创建报告,轮询至完成,并读取团队在网站上看到的相同已保存报告。来自您付费计划的相同 API 密钥可连接任何 MCP‑capable 代理。

访问模型

付费计划 + API 密钥

API 访问与账户绑定,并通过密钥保护。选择一个套餐,在账户中创建 API 密钥,之后通过 API 运行的每个新站点都会使用您套餐中的积分,与在网站上完全相同。积分在每月第一天(UTC)重置,且永不结转。

一个报告对象

网站会话、API 调用和代理会话均读取自相同的已保存报告状态。

简洁流程

创建报告,轮询状态,然后从同一对象读取完整结果。

可用端点

POST/api/v1/reports/preview

为合作伙伴集成在付费计划上创建分数预览。

POST/api/v1/reports

创建新报告或重用已存在的报告。添加 "forceRerun": true 可改为重新扫描网站。

GET/api/v1/reports/:id

获取最新报告状态和章节.

GET/api/v1/reports/:id/result

读取完整报告结果。

GET/api/v1/reports/:id/download?format=json

将报告负载导出为 JSON 以供程序化集成。

快速开始:使用 curl 生成 SEO 报告

三个请求涵盖整个流程,使用您付费计划的 API 密钥。第一个创建报告,第二个轮询直到其状态不再是排队或运行,第三个导出。新站点使用一次积分;再次运行您已有报告的站点不使用积分。

创建、轮询并导出报告Bash
export SEOREPORT_API_KEY="sr__live_your_api_key"
# Send the key as a header file so it never sits in curl's argv, where ps shows
# it to every local user. printf is a shell builtin, so it spawns no process.
auth() { printf 'Authorization: Bearer %s\n' "$SEOREPORT_API_KEY"; }

# 1. Create a report and keep its job ID
JOB_ID=$(curl -s -X POST https://seoreport.dev/api/v1/reports \
  -H @<(auth) \
  -H "Content-Type: application/json" \
  -d '{"url": "example.com"}' | jq -r '.report.jobId')

# 2. Poll until the report is no longer queued or running
while :; do
  STATUS=$(curl -s "https://seoreport.dev/api/v1/reports/$JOB_ID" \
    -H @<(auth) | jq -r '.report.status')
  case "$STATUS" in queued|running) sleep 3 ;; *) break ;; esac
done
echo "status: $STATUS"

# 3. Export the finished report (format=pdf, md and txt also work)
curl -s "https://seoreport.dev/api/v1/reports/$JOB_ID/download?format=json" \
  -H @<(auth) -o report.json

SEO 报告 API 返回什么

每份完成的报告都会导出为一个 JSON 文档:总分及其等级、每个领域的得分、分析的页面数、按严重程度统计的未解决问题,以及按修复顺序排列的每一项发现——包括为何重要、如何修复、如何验证修复,以及支撑它的证据和页面。Markdown、纯文本和 PDF 都由同一份诊断生成。

GET /api/v1/reports/:id/download?format=json(节选)JSON
{
  "exportVersion": 1,
  "jobId": "3f6c2a1e-8d4b-4c7a-9e21-5b0d7f4a6c18",
  "targetUrl": "https://example.com",
  "status": "completed",
  "isSnapshotReady": true,
  "auditedAt": "2026-10-14T09:12:41.000Z",
  "locale": "en",
  "score": { "overall": 72, "band": "stable" },
  "areas": [
    { "id": "access_crawl", "name": "Crawl & Index", "score": 61 },
    { "id": "metadata_onpage", "name": "On-Page SEO", "score": 78 },
    { "id": "security", "name": "Security", "score": 84 }
  ],
  "pagesAnalyzed": 24,
  "openIssues": { "critical": 0, "high": 2, "medium": 5, "low": 3, "total": 10 },
  "findings": [
    {
      "rank": 1,
      "title": "Render parity mismatch",
      "status": "fail",
      "severity": "high",
      "area": { "id": "access_crawl", "name": "Crawl & Index" },
      "whyItMatters": "Raw HTML and rendered DOM should tell the same SEO story so crawlers and AI systems do not see conflicting versions of the page.",
      "fix": "Ensure raw HTML and rendered DOM contain the same critical SEO elements (title, H1, canonical, meta description, structured data). If content is injected by JavaScript, move it to server-side rendering so crawlers see it immediately.",
      "verification": [
        "Recheck these recorded examples: https://example.com/pricing. Method: compare the raw HTML with the rendered DOM. Previously observed: H1 present only after rendering",
        "Expected after the change: the same critical elements in both. Obtain a fresh capture and compare the same check and URLs; a changed sample alone does not verify a fix."
      ],
      "evidence": ["Raw HTML and rendered DOM were compared for critical elements."],
      "pages": ["https://example.com/pricing"]
    }
  ]
}

错误与限制

以下每种拒绝都会给出代码。处理好这些代码,脚本就不会盲目重试。

402PAYMENT_REQUIRED请求背后没有付费方案:密钥缺失、无效或已撤销,或账户没有有效方案。缺少密钥时返回 402,而不是 401。
402REPORT_CREDITS_EXHAUSTED本月的新站点额度已用完。对已有报告的站点重新运行仍然可行,额度在每月第一天(UTC)重置。
429FRESH_RUN_LIMIT同一账户一小时内新运行(forceRerun)超过 30 次。请等待 Retry-After 响应头给出的时间。
200status: failed | dead_lettered报告未能完成。若已记录原因,GET /api/v1/reports/:id 会返回 error.code、error.message 和 error.retryable;仅当 retryable 为 true 时重试。
200pollAfterMs再次查询状态前应等待的时间;报告完成后为 0。

SEO 监控 API

注册监控的域名每周会重新审核一次。当有变化时,警报地址会收到一封邮件:新的关键或高严重性发现、已解决的关键发现,或转移到不同的分数区间。连续一周无变化则不发送任何邮件。

PUT/api/v1/monitors

开始对域名进行每周监控;"enabled": false 会暂停它。

GET/api/v1/monitors

列出此账户正在监控的域名。

DELETE/api/v1/monitors?url=

停止监控域名并删除其存储的结果。

监控域名Bash
# Uses the auth() helper from the quickstart above.
# Re-audit a domain every week and email [email protected] when it changes
curl -X PUT https://seoreport.dev/api/v1/monitors \
  -H @<(auth) \
  -H "Content-Type: application/json" \
  -d '{"url": "example.com", "alertEmail": "[email protected]"}'

# List monitored domains
curl https://seoreport.dev/api/v1/monitors \
  -H @<(auth)

# Stop monitoring (pass the host the list returns)
curl -X DELETE "https://seoreport.dev/api/v1/monitors?url=example.com" \
  -H @<(auth)

监控包含在付费计划中,不会消耗报告积分。

官方 TypeScript 客户端

REST API 的强类型客户端。使用您计划的 API 密钥进行身份验证,然后从 TypeScript 创建、轮询并导出报告。

命令行

在终端使用您的 API 密钥运行报告。一次全局安装。

Bash
npm install -g @seoreport/client

MCP 服务器 — 同一套 API,同一把密钥

将任何支持 MCP 的客户端指向 https://seoreport.dev/mcp,并使用与 REST 相同的 Bearer API 密钥进行认证。连接时会自动公布报告与账户工具,代理无需任何胶水代码即可运行审计并读取结果。

MCP 客户端配置JSON
{
  "mcpServers": {
    "seoreport": {
      "url": "https://seoreport.dev/mcp",
      "headers": {
        "Authorization": "Bearer sr__live_your_api_key"
      }
    }
  }
}
seoreport_create_report

为某个网址启动报告并获取任务 ID。

seoreport_get_report_status

轮询任务,直到报告完成。

seoreport_get_report

读取已完成报告的评分与发现项。

seoreport_list_reports

列出账户下的报告。

seoreport_get_report_download

获取 JSON、Markdown、文本或 PDF 的下载链接。

seoreport_get_account

查看账户的方案、剩余额度与续订日期。

结账不会直接扣款,而是返回一个浏览器链接:代理可以发起,但只有人才能付款。取消方案、管理 API 密钥和删除账户仍在控制台中完成。

准备构建?

选择一个计划,创建一个 API 密钥,并开始将 SEO 报告集成到您的产品中。