配置与触发 SerpAPI 周排名抓取任务,写入 keyword_ranking_logs;与「排名展示可见批次」规则配合。
周排名数据的唯一自动化入口(SerpAPI)。决定全站「什么时候有新排名可看」。
默认澳大利亚 Google(gl=au, hl=en),每词最多翻 10 页有机结果(10×10),解析:
target_url_rank:配置的落地页 URL 在结果中的位次;domain_rank:本站域名首次出现位次;tier:由 target_url_rank 映射 TOP 3 / 4-10 / …多 Key 轮换(MHW_SERPAPI_KEYS)、页间/词间 delay 防限流。失败写 fetch_status / fetch_error,可手工在 editor-ranking 补录。
同一批次常伴随 serp_top10_json 写入(有机前 10 条 title/link/snippet)。这是 TDH 规则引擎、内容优化、突破点面板的共用燃料——没跑 SERP 快照,下游模块会 blocked。
独立补跑:python/cli/serp_top10_snapshot.py --keyword-id=N
前台 ranking_display_visible_batch_date() 取 MAX(check_date)。列表/卡片展示该日数据。运营习惯:批次跑完后再开周会看首页。
ranking-export 按选定日期导出全库快照 Excel;editor-ranking 用于 SerpAPI 失败或历史回填,写入同一 keyword_ranking_logs 表,data_source 字段区分来源。
pages/ranking-job.php、includes/ranking_fetch_service.php、includes/ranking_display.php