REST API + MCP 服务器
SEO 报告 API 为
开发者和 AI 代理
通过 REST 创建报告,轮询至完成,并读取团队在网站上看到的相同已保存报告。来自您付费计划的相同 API 密钥可连接任何 MCP‑capable 代理。
访问模型
API 访问与账户绑定,并通过密钥保护。选择一个套餐,在账户中创建 API 密钥,之后通过 API 运行的每个新站点都会使用您套餐中的积分,与在网站上完全相同。积分在每月第一天(UTC)重置,且永不结转。
网站会话、API 调用和代理会话均读取自相同的已保存报告状态。
创建报告,轮询状态,然后从同一对象读取完整结果。
可用端点
/api/v1/reports/preview为合作伙伴集成在付费计划上创建分数预览。
/api/v1/reports创建新报告或重用已存在的报告。添加 "forceRerun": true 可改为重新扫描网站。
/api/v1/reports/:id获取最新报告状态和章节.
/api/v1/reports/:id/result读取完整报告结果。
/api/v1/reports/:id/download?format=json将报告负载导出为 JSON 以供程序化集成。
快速开始:使用 curl 生成 SEO 报告
三个请求涵盖整个流程,使用您付费计划的 API 密钥。第一个创建报告,第二个轮询直到其状态不再是排队或运行,第三个导出。新站点使用一次积分;再次运行您已有报告的站点不使用积分。
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.jsonSEO 报告 API 返回什么
每份完成的报告都会导出为一个 JSON 文档:总分及其等级、每个领域的得分、分析的页面数、按严重程度统计的未解决问题,以及按修复顺序排列的每一项发现——包括为何重要、如何修复、如何验证修复,以及支撑它的证据和页面。Markdown、纯文本和 PDF 都由同一份诊断生成。
{
"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"]
}
]
}错误与限制
以下每种拒绝都会给出代码。处理好这些代码,脚本就不会盲目重试。
| 402 | PAYMENT_REQUIRED | 请求背后没有付费方案:密钥缺失、无效或已撤销,或账户没有有效方案。缺少密钥时返回 402,而不是 401。 |
| 402 | REPORT_CREDITS_EXHAUSTED | 本月的新站点额度已用完。对已有报告的站点重新运行仍然可行,额度在每月第一天(UTC)重置。 |
| 429 | FRESH_RUN_LIMIT | 同一账户一小时内新运行(forceRerun)超过 30 次。请等待 Retry-After 响应头给出的时间。 |
| 200 | status: failed | dead_lettered | 报告未能完成。若已记录原因,GET /api/v1/reports/:id 会返回 error.code、error.message 和 error.retryable;仅当 retryable 为 true 时重试。 |
| 200 | pollAfterMs | 再次查询状态前应等待的时间;报告完成后为 0。 |
设置指南与示例代码
分步说明如何通过 MCP 连接 AI 代理、从代码调用 API,以及比较各家 SEO API。页面为英文。
连接 AI 代理(MCP)
- Connect SEOReport to Claude Code: MCP setup for SEO audits
- Connect SEOReport to Cursor: MCP setup for SEO audits
- Connect SEOReport to VS Code: MCP setup for GitHub Copilot
- Connect SEOReport to Windsurf (Devin Desktop): MCP setup
- Connect SEOReport to OpenAI Codex CLI: MCP setup for SEO audits
- Connect SEOReport to Gemini CLI: MCP setup for SEO audits
- Connect SEOReport to Claude Desktop: MCP setup for SEO audits
从代码调用 API
SEO 监控 API
注册监控的域名每周会重新审核一次。当有变化时,警报地址会收到一封邮件:新的关键或高严重性发现、已解决的关键发现,或转移到不同的分数区间。连续一周无变化则不发送任何邮件。
/api/v1/monitors开始对域名进行每周监控;"enabled": false 会暂停它。
/api/v1/monitors列出此账户正在监控的域名。
/api/v1/monitors?url=停止监控域名并删除其存储的结果。
# 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)监控包含在付费计划中,不会消耗报告积分。
MCP 服务器 — 同一套 API,同一把密钥
将任何支持 MCP 的客户端指向 https://seoreport.dev/mcp,并使用与 REST 相同的 Bearer API 密钥进行认证。连接时会自动公布报告与账户工具,代理无需任何胶水代码即可运行审计并读取结果。
{
"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 密钥和删除账户仍在控制台中完成。