SEO 战略推进数据
按网站 ID 读取后台「SEO 战略推进」中的目标关键词、战区统计与最近同步时间。每次调用会先自动执行与「同步实绩」相同的逻辑(从 GSC 发现新词并回填排名/点击),再返回最新数据。对应页面:/admin/seo-strategy。
GET /api/gsc/strategy请求参数
GET /api/gsc/strategy?websiteId=3
websiteIdnumber(必填)。自有网站 ID,与 /admin/website-management 列表中的 id 一致
读取前会自动同步实绩。无 GSC 历史数据时跳过同步,仍返回已有目标;同步失败也不阻断读取,响应里的
data.sync 会标明状态。响应示例
{
"success": true,
"data": {
"goals": [
{
"id": 12,
"website_id": 3,
"keyword": "example keyword",
"seo_keyword_id": 100,
"source": "manual",
"target_page": "https://example.com/page",
"search_volume": 2500,
"difficulty": 35,
"current_position": 8.5,
"clicks_30d": 40,
"impressions_30d": 900,
"last_rank_update": "2026-11-20T00:00:00.000Z",
"strategic_phase": "town",
"status": "attacking",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-11-20T00:00:00.000Z"
}
],
"stats": {
"rural": { "total": 10, "occupied": 2, "attacking": 3, "potential": 5 },
"town": { "total": 8, "occupied": 1, "attacking": 4, "potential": 3 },
"city": { "total": 2, "occupied": 0, "attacking": 1, "potential": 1 }
},
"lastSync": "2026-11-20T00:00:00.000Z",
"sync": {
"status": "synced",
"addedCount": 3,
"updatedCount": 20,
"message": "同步完成!自动添加了 3 个关键词,更新了 20 个目标的实战数据"
}
}
}strategic_phase:rural(搜索量 < 1000)、town(1000–9999)、city(≥ 10000)
status:potential、monitoring、attacking、occupied
goals 按搜索量降序、当前排名升序排列。stats 按战区汇总总数与各状态数量。
常用字段
| 字段 | 类型 | 说明 |
|---|---|---|
| keyword | string | 目标关键词 |
| target_page | string | 计划承接页面,空字符串表示未指定 |
| search_volume | number | 月搜索量 |
| current_position | number | null | 当前排名,越小越好 |
| clicks_30d | number | 近 30 天点击 |
| impressions_30d | number | 近 30 天展示 |
| strategic_phase | string | rural / town / city |
| status | string | potential / monitoring / attacking / occupied |
MCP 工具
工具名 get_seo_strategy,参数 websiteId(必填)。可先调 list_managed_websites 取网站 id。
错误响应
401 - 认证失败
{ "error": "认证失败" }400 - 缺少网站 ID
{ "error": "缺少网站ID" }调用示例
curl "https://youzikuaibao.com.cn/api/gsc/strategy?websiteId=3" \ -H "Authorization: Bearer <您的密钥>"
