REST API 文档
通过CheckSEO REST API以编程方式运行SEO审计。适用于Agency和Enterprise计划。
身份验证
所有API请求必须在Authorization头中包含您的API密钥。在账户设置中创建API密钥。
Authorization: Bearer csk_your_api_key_here
API密钥以csk_前缀开头。请妥善保管——不要在客户端代码中暴露。
Base URL
https://checkseo.site
POST
/api/audits
启动新的SEO审计。返回audit_id用于轮询状态。
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to audit |
lang | string | No | Report language (en, ru, de, zh, hi, th, fr, es, cs, ar). Default: en |
skip_performance | boolean | No | Skip Google PageSpeed check |
skip_broken_links | boolean | No | Skip broken links check |
示例
curl -X POST https://checkseo.site/api/audits \
-H "Authorization: Bearer csk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "lang": "en"}'
Response (200)
{
"audit_id": "a1b2c3d4e5f6...",
"url": "https://example.com"
}
GET
/api/audits/{audit_id}/status
轮询此端点以检查审计进度。当状态为"done"时,redirect字段包含报告URL。
Response
// In progress
{"status": "running", "step": 3, "total": 8, "percent": 37}
// Completed
{"status": "done", "redirect": "/audits/a1b2c3d4...", "percent": 100}
// Error
{"status": "error", "error_message": "...", "percent": 0}
GET
/audits/{audit_id}/pdf
以PDF格式下载审计报告。Agency/Enterprise计划可获得无水印的PDF。
典型工作流程
1
POST /api/audits — 启动审计,获取audit_id
2
GET /api/audits/{id}/status — 每2-3秒轮询一次,直到状态为"done"
3
GET /audits/{id} — 查看完整报告
4
GET /audits/{id}/pdf — 下载PDF(可选)
速率限制
| 当前方案 | 审计次数 / 月 | API |
|---|---|---|
| Free | 3 | — |
| Registered | 5 | — |
| Pro ($19/mo) | 30 | — |
| Agency ($49/mo) | 100 | ✓ |
| Enterprise ($149/mo) | 500 | ✓ |
Python 示例
import requests, time
API_KEY = "csk_your_api_key"
BASE = "https://checkseo.site"
HEADERS = {"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"}
# 1. Start audit
r = requests.post(f"{BASE}/api/audits",
json={"url": "https://example.com", "lang": "en"},
headers=HEADERS)
audit_id = r.json()["audit_id"]
# 2. Poll until done
while True:
s = requests.get(f"{BASE}/api/audits/{audit_id}/status").json()
if s["status"] == "done":
break
if s["status"] == "error":
raise Exception(s["error_message"])
time.sleep(2)
# 3. Download PDF
pdf = requests.get(f"{BASE}/audits/{audit_id}/pdf",
headers=HEADERS)
with open("report.pdf", "wb") as f:
f.write(pdf.content)
API访问适用于Agency($49/月)和Enterprise($149/月)计划。
查看计划