排名数据

从 Google Search Console 拉取你自己的搜索表现数据。

这个工具做什么

search_performance.py 连接 Google Search Console API,拉取你站点的真实展示、点击和排名数据。这告诉你 Google 实际上把你的页面关联到哪些查询词。

为什么这很重要 — Search Console 数据是 SEO 最可靠的信号源。它显示 Google 实际认为你的页面是关于什么的——不是你以为的。

前提条件

需要 Google Cloud 项目,启用 Search Console API,并创建服务账号或 OAuth 凭证。这是工具包里配置最多的一个。

1

创建凭证

访问 Google Cloud Console → APIs & Services → 启用 Google Search Console API → 创建 OAuth 2.0 凭证(桌面应用类型)。

2

下载凭证 JSON

保存 client_secret.json 文件。放在脚本同目录下,或用 --creds 指定路径。

3

在 Search Console 验证站点

你的站点必须在 Google Search Console 中验证。使用属性 URL(如 sc-domain:example.comhttps://example.com/)。

基本用法

python3 -m zens_ink search_performance --site "sc-domain:example.com" --creds client_secret.json

首次运行会打开浏览器要求 OAuth 授权。后续运行使用缓存的凭证。

查询词展示点击平均排名CTR
ai tarot reading2,400458.31.9%
tarot card meanings1,8001222.10.7%
free tarot yes or no950384.24.0%
dream interpretation620331.50.5%

从自己的数据中找机会

第 5–15 名的甜蜜区 — 排名在第 5 到 15 位的关键词是你最大的机会。你离第一页很近——一点内容优化就可能把你推进前列。优先把精力放在这里。

日期范围

拉取特定时间段的数据:

python3 -m zens_ink search_performance --site "sc-domain:example.com" --start 2025-01-01 --end 2025-06-30

导出分析

python3 -m zens_ink search_performance --site "sc-domain:example.com" --format csv > gsc_data.csv

接下来?

你现在知道 Google 认为你的站点是关于什么的,以及你在哪些词上接近突破。最后一块拼图:竞争对手在排哪些你还没做的词?

关键词发现 搜索量 排名数据 竞品分析

竞品分析 →

PRO

手动做这一步很耗时。Pro 引擎的 content_matrix 脚本自动化了整个流程——一条命令,从原始数据到可执行策略。

了解 Pro 引擎 →