blog-google

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Blog Google: Google API Data for Blog Performance

Blog Google:用于博客性能分析的Google API数据

Direct access to Google's SEO APIs for blog performance analysis. Provides real Chrome user metrics, indexation status, search performance, entity analysis, YouTube video discovery, keyword volumes, and PDF/HTML performance reports.
All APIs are free at normal usage levels. Setup requires a Google Cloud project with an API key and/or service account.
直接访问Google的SEO API,用于博客性能分析。提供真实的Chrome用户指标、索引状态、搜索性能、实体分析、YouTube视频发现、关键词搜索量以及PDF/HTML性能报告。
所有API在正常使用量下均免费。设置需要一个带有API密钥和/或服务账号的Google Cloud项目。

Prerequisites

前提条件

Always check credentials before running any command:
bash
python3 skills/blog-google/scripts/run.py google_auth --check --json
Config file:
~/.config/claude-seo/google-api.json
(shared with claude-seo)
json
{
  "api_key": "AIzaSy...",
  "oauth_client_path": "/path/to/client_secret.json",
  "default_property": "sc-domain:example.com",
  "ga4_property_id": "properties/123456789",
  "ads_developer_token": "...",
  "ads_customer_id": "123-456-7890"
}
If missing, read
references/auth-setup.md
and walk the user through setup.
运行任何命令前请务必检查凭证:
bash
python3 skills/blog-google/scripts/run.py google_auth --check --json
配置文件:
~/.config/claude-seo/google-api.json
(与claude-seo共享)
json
{
  "api_key": "AIzaSy...",
  "oauth_client_path": "/path/to/client_secret.json",
  "default_property": "sc-domain:example.com",
  "ga4_property_id": "properties/123456789",
  "ads_developer_token": "...",
  "ads_customer_id": "123-456-7890"
}
如果缺少配置文件,请阅读
references/auth-setup.md
并引导用户完成设置。

Credential Tiers

凭证层级

TierDetectionAvailable Commands
0 (API Key)
api_key
present
pagespeed
,
crux
,
crux-history
,
youtube
,
nlp
1 (OAuth/SA)+ OAuth token or service accountTier 0 +
gsc
,
inspect
,
index
2 (Full)+
ga4_property_id
configured
Tier 1 +
ga4
3 (Ads)+
ads_developer_token
+
ads_customer_id
Tier 2 +
keywords
Always communicate the detected tier before running commands.
层级检测条件可用命令
0(API密钥)存在
api_key
pagespeed
,
crux
,
crux-history
,
youtube
,
nlp
1(OAuth/服务账号)+ 拥有OAuth令牌或服务账号层级0的命令 +
gsc
,
inspect
,
index
2(完整权限)+ 已配置
ga4_property_id
层级1的命令 +
ga4
3(Ads权限)+ 拥有
ads_developer_token
ads_customer_id
层级2的命令 +
keywords
运行命令前务必告知用户检测到的凭证层级。

Quick Reference

快速参考

CommandWhat it doesTier
/blog google setup
Check/configure API credentials--
/blog google pagespeed <url>
PSI Lighthouse + CrUX field data0
/blog google crux <url>
CrUX field data only (p75 metrics)0
/blog google crux-history <url>
25-week CWV trend analysis0
/blog google youtube <query>
YouTube video search (views, likes, duration)0
/blog google nlp <url-or-text>
NLP entity extraction + sentiment0
/blog google gsc <property>
Search Console: clicks, impressions, CTR, position1
/blog google inspect <url>
URL Inspection: index status, canonical1
/blog google index <url>
Submit URL to Indexing API1
/blog google ga4 [property-id]
GA4 organic traffic report2
/blog google keywords <seed>
Keyword ideas from Google Ads Keyword Planner3
/blog google report <type>
PDF/HTML performance report--
/blog google quotas
Show rate limits for all APIs--

命令功能层级
/blog google setup
检查/配置API凭证--
/blog google pagespeed <url>
PSI Lighthouse实验室数据 + CrUX真实用户数据0
/blog google crux <url>
仅CrUX真实用户数据(p75指标)0
/blog google crux-history <url>
25周CWV趋势分析0
/blog google youtube <query>
YouTube视频搜索(查看次数、点赞数、时长)0
/blog google nlp <url-or-text>
NLP实体提取 + 情感分析0
/blog google gsc <property>
Search Console:点击量、展示量、点击率、排名1
/blog google inspect <url>
URL检测:索引状态、规范网址1
/blog google index <url>
提交URL至Indexing API1
/blog google ga4 [property-id]
GA4自然流量报告2
/blog google keywords <seed>
从Google Ads关键词规划师获取关键词创意3
/blog google report <type>
生成PDF/HTML性能报告--
/blog google quotas
显示所有API的速率限制--

PageSpeed + CrUX

PageSpeed + CrUX

/blog google pagespeed <url>

/blog google pagespeed <url>

Combined Lighthouse lab data + CrUX field data for a published blog post.
Script:
python3 skills/blog-google/scripts/run.py pagespeed_check <url> --json
Reference:
references/api-reference.md
Output merges lab scores (point-in-time Lighthouse) with field data (28-day Chrome user metrics). CrUX tries URL-level first, falls back to origin-level.
结合Lighthouse实验室数据与CrUX真实用户数据,分析已发布博客文章的性能。
脚本:
python3 skills/blog-google/scripts/run.py pagespeed_check <url> --json
参考文档:
references/api-reference.md
输出内容整合了实验室分数(即时Lighthouse测试结果)与真实用户数据(28天Chrome用户指标)。CrUX优先使用URL级数据,若不可用则回退到域名级数据。

/blog google crux <url>

/blog google crux <url>

CrUX field data only (no Lighthouse run). Faster.
Script:
python3 skills/blog-google/scripts/run.py pagespeed_check <url> --crux-only --json
仅提供CrUX真实用户数据(不运行Lighthouse),速度更快。
脚本:
python3 skills/blog-google/scripts/run.py pagespeed_check <url> --crux-only --json

/blog google crux-history <url>

/blog google crux-history <url>

25-week CrUX History trends. Shows whether CWV metrics are improving, stable, or degrading.
Script:
python3 skills/blog-google/scripts/run.py crux_history <url> --json

25周CrUX历史趋势分析。展示CWV指标是提升、稳定还是下降。
脚本:
python3 skills/blog-google/scripts/run.py crux_history <url> --json

Search Console

Search Console

/blog google gsc <property>

/blog google gsc <property>

Search Analytics: clicks, impressions, CTR, position for last 28 days.
Script:
python3 skills/blog-google/scripts/run.py gsc_query --property <property> --json
Default: 28 days, dimensions=query,page, type=web, limit=1000.
Includes quick-win detection: queries at position 4-10 with high impressions.
搜索分析:过去28天的点击量、展示量、点击率、排名。
脚本:
python3 skills/blog-google/scripts/run.py gsc_query --property <property> --json
默认设置: 28天,维度=查询词、页面,类型=网页,限制=1000条。
包含快速优化机会检测:排名在4-10位且展示量高的查询词。

/blog google inspect <url>

/blog google inspect <url>

URL Inspection: real indexation status from Google.
Script:
python3 skills/blog-google/scripts/run.py gsc_inspect <url> --json
Returns: verdict (PASS/FAIL), coverage state, robots.txt status, indexing state, page fetch state, canonical selection, mobile usability, rich results.
For batch inspection:
python3 skills/blog-google/scripts/run.py gsc_inspect --batch <file> --json

URL检测:获取Google的真实索引状态。
脚本:
python3 skills/blog-google/scripts/run.py gsc_inspect <url> --json
返回内容:检测结果(通过/失败)、覆盖状态、robots.txt状态、索引状态、页面抓取状态、规范网址选择、移动设备可用性、富媒体结果。
批量检测命令:
python3 skills/blog-google/scripts/run.py gsc_inspect --batch <file> --json

Indexing API

Indexing API

/blog google index <url>

/blog google index <url>

Notify Google of a URL update. Submit new blog posts for faster indexation.
Script:
python3 skills/blog-google/scripts/run.py indexing_notify <url> --json
Reference:
references/api-reference.md
The Indexing API is officially for JobPosting and BroadcastEvent/VideoObject pages. Always inform the user of this restriction. Daily quota: 200 publish requests.
For batch:
python3 skills/blog-google/scripts/run.py indexing_notify --batch <file> --json

通知Google更新URL。提交新博客文章以加快索引速度。
脚本:
python3 skills/blog-google/scripts/run.py indexing_notify <url> --json
参考文档:
references/api-reference.md
Indexing API官方仅适用于JobPosting和BroadcastEvent/VideoObject类型页面。务必告知用户此限制。每日配额:200条发布请求。
批量提交命令:
python3 skills/blog-google/scripts/run.py indexing_notify --batch <file> --json

GA4 Traffic

GA4流量分析

/blog google ga4 [property-id]

/blog google ga4 [property-id]

Organic traffic report: daily sessions, users, pageviews, bounce rate, engagement.
Script:
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --json
Default: 28 days, filtered to Organic Search channel group.
For top landing pages:
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --report top-pages --json

自然流量报告:每日会话数、用户数、页面浏览量、跳出率、参与度。
脚本:
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --json
默认设置: 28天,筛选自然搜索渠道组。
查看热门着陆页命令:
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --report top-pages --json

YouTube (Video Discovery)

YouTube(视频发现)

YouTube mentions have the strongest AI visibility correlation (0.737, Ahrefs 75K brands). Free, API key only. Used by blog-write and blog-rewrite for video embedding.
提及YouTube内容与AI可见性的相关性最强(相关系数0.737,Ahrefs针对75K品牌的研究)。仅需API密钥即可免费使用。供blog-write和blog-rewrite技能用于视频嵌入。

/blog google youtube <query>

/blog google youtube <query>

Search YouTube for videos relevant to a blog topic.
Script:
python3 skills/blog-google/scripts/run.py youtube_search search "<query>" --json
Quota: 100 units per search (10,000 units/day free).
Returns: title, channel, views, likes, duration, description, tags.
For video details + comments:
python3 skills/blog-google/scripts/run.py youtube_search video <video_id> --json

搜索与博客主题相关的YouTube视频。
脚本:
python3 skills/blog-google/scripts/run.py youtube_search search "<query>" --json
配额: 每次搜索消耗100单位(每日免费配额10,000单位)。
返回内容:标题、频道、查看次数、点赞数、时长、描述、标签。
获取视频详情+评论命令:
python3 skills/blog-google/scripts/run.py youtube_search video <video_id> --json

NLP Content Analysis

NLP内容分析

Google's own entity/sentiment analysis. Enhances E-E-A-T scoring for blog content.
Google官方的实体/情感分析工具。用于提升博客内容的E-E-A-T评分。

/blog google nlp <url-or-text>

/blog google nlp <url-or-text>

Full NLP analysis: entities, sentiment, content classification.
Script:
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --json
Free tier: 5,000 units/month. Requires billing enabled on GCP project.
For entity extraction only:
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --features entities --json

完整NLP分析:实体识别、情感分析、内容分类。
脚本:
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --json
免费层级: 每月5,000单位。需要在GCP项目中启用计费。
仅提取实体命令:
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --features entities --json

Keyword Research (Google Ads)

关键词研究(Google Ads)

Gold-standard keyword volume data. Requires Google Ads account (Tier 3).
权威的关键词搜索量数据。需要Google Ads账号(层级3)。

/blog google keywords <seed>

/blog google keywords <seed>

Generate keyword ideas from seed terms for blog topic research.
Script:
python3 skills/blog-google/scripts/run.py keyword_planner ideas "<seed>" --json
For volume lookup:
python3 skills/blog-google/scripts/run.py keyword_planner volume "<kw1>,<kw2>" --json

根据种子词生成关键词创意,用于博客主题研究。
脚本:
python3 skills/blog-google/scripts/run.py keyword_planner ideas "<seed>" --json
查询关键词搜索量命令:
python3 skills/blog-google/scripts/run.py keyword_planner volume "<kw1>,<kw2>" --json

Reports

报告生成

/blog google report <type>

/blog google report <type>

Generate a professional PDF/HTML report with charts.
Script:
python3 skills/blog-google/scripts/run.py google_report --type <type> --data <json> --domain <domain> --format pdf
TypeInputOutput
cwv-audit
PSI + CrUX + CrUX History dataCore Web Vitals audit with gauges, timelines
gsc-performance
GSC query dataSearch Console report with query tables
indexation
Batch inspection dataIndexation status with coverage donut
full
All data combinedComprehensive Google SEO report
Note: PDF generation requires system libraries:
sudo apt install libpango1.0-dev libcairo2-dev
. Falls back to HTML if weasyprint is unavailable.

生成带图表的专业PDF/HTML报告。
脚本:
python3 skills/blog-google/scripts/run.py google_report --type <type> --data <json> --domain <domain> --format pdf
类型输入输出
cwv-audit
PSI + CrUX + CrUX历史数据包含仪表盘和时间线的Core Web Vitals审计报告
gsc-performance
GSC查询数据包含查询词表格的Search Console报告
indexation
批量检测数据包含覆盖情况环形图的索引状态报告
full
所有整合数据全面的Google SEO报告
注意: PDF生成需要系统库:
sudo apt install libpango1.0-dev libcairo2-dev
。若weasyprint不可用,则自动回退到HTML格式。

Rate Limits

速率限制

APIPer-MinutePer-DayAuth
PSI v5240 QPM25,000 QPDAPI Key
CrUX + History150 QPM (shared)UnlimitedAPI Key
GSC Search Analytics1,200 QPM/site30M QPDService Account
GSC URL Inspection600 QPM2,000 QPD/siteService Account
Indexing API380 RPM200 publish/dayService Account
GA4 Data API10 concurrent (50 for 360)200K Core Tokens/day (2M for 360)Service Account
YouTube Data--10,000 units/dayAPI Key
NLP API--5,000 units/monthAPI Key (billing)
Read
references/rate-limits-quotas.md
for detailed quota management.
API每分钟限制每天限制认证方式
PSI v5240次/分钟25,000次/天API密钥
CrUX + 历史数据150次/分钟(共享)无限制API密钥
GSC搜索分析1,200次/分钟/站点30,000,000次/天服务账号
GSC URL检测600次/分钟2,000次/天/站点服务账号
Indexing API380次/分钟200条发布请求/天服务账号
GA4数据API10个并发请求(360版本为50个)200,000核心令牌/天(360版本为2,000,000个)服务账号
YouTube数据API--10,000单位/天API密钥
NLP API--5,000单位/月API密钥(需计费)
详细配额管理请阅读
references/rate-limits-quotas.md

Blog Workflow Integration

博客工作流集成

This skill is both user-invocable (
/blog google pagespeed
) and callable internally by other blog sub-skills:
  • blog-seo-check: Runs PSI + CrUX on published post URL for live CWV data
  • blog-rewrite: NLP entity analysis to identify E-E-A-T entity gaps
  • blog-geo: GSC performance data for real search appearance insights
  • blog-audit: Batch CWV + indexation checks across all published blog URLs
  • blog-write / blog-rewrite: YouTube search for video embedding
Falls back gracefully when credentials are not configured.
本技能既支持用户调用(如
/blog google pagespeed
),也可被其他博客子技能内部调用:
  • blog-seo-check:对已发布文章的URL运行PSI + CrUX,获取实时CWV数据
  • blog-rewrite:通过NLP实体分析识别E-E-A-T实体缺口
  • blog-geo:利用GSC性能数据获取真实搜索展示洞察
  • blog-audit:对所有已发布博客URL进行批量CWV + 索引状态检查
  • blog-write / blog-rewrite:通过YouTube搜索获取视频嵌入内容
当凭证未配置时,会优雅降级处理。

Technical Notes

技术说明

  • INP replaced FID on March 12, 2024. Never reference FID.
  • CLS values from CrUX are string-encoded (e.g., "0.05"). Scripts handle parsing.
  • CrUX 404 = insufficient Chrome traffic, not an auth error.
  • Search Analytics data has 2-3 day lag.
  • Indexing API is officially for JobPosting/BroadcastEvent pages only.
  • All Google APIs used are FREE at normal usage levels.
  • 2024年3月12日起,INP替代了FID。请勿再提及FID。
  • CrUX返回的CLS值为字符串编码(例如"0.05"),脚本会自动处理解析。
  • CrUX返回404表示Chrome流量不足,而非认证错误。
  • 搜索分析数据存在2-3天的延迟。
  • Indexing API官方仅适用于JobPosting/BroadcastEvent类型页面。
  • 所有使用的Google API在正常使用量下均免费。

Error Handling

错误处理

ScenarioAction
No credentials configuredRun
/blog google setup
. List Tier 0 commands (API key only).
Service account lacks GSC accessAdd
client_email
to GSC > Settings > Users > Add.
CrUX data unavailable (404)Insufficient Chrome traffic. Use PSI lab data as fallback.
GA4 property not foundFind property ID in GA4 Admin > Property Details.
Indexing API quota exceeded200/day limit. Prioritize most important URLs.
Rate limit (429)Wait and retry with exponential backoff.
场景操作
未配置凭证运行
/blog google setup
。列出层级0的命令(仅需API密钥)。
服务账号缺少GSC访问权限
client_email
添加到GSC > 设置 > 用户 > 添加用户。
CrUX数据不可用(404)Chrome流量不足。使用PSI实验室数据作为替代。
未找到GA4属性在GA4管理 > 属性详情中查找属性ID。
Indexing API配额用尽每日限制200条。优先提交最重要的URL。
速率限制(429错误)等待后使用指数退避策略重试。