blog-google
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBlog 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 --jsonConfig file: (shared with claude-seo)
~/.config/claude-seo/google-api.jsonjson
{
"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 and walk the user through setup.
references/auth-setup.md运行任何命令前请务必检查凭证:
bash
python3 skills/blog-google/scripts/run.py google_auth --check --json配置文件: (与claude-seo共享)
~/.config/claude-seo/google-api.jsonjson
{
"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.mdCredential Tiers
凭证层级
| Tier | Detection | Available Commands |
|---|---|---|
| 0 (API Key) | | |
| 1 (OAuth/SA) | + OAuth token or service account | Tier 0 + |
| 2 (Full) | + | Tier 1 + |
| 3 (Ads) | + | Tier 2 + |
Always communicate the detected tier before running commands.
| 层级 | 检测条件 | 可用命令 |
|---|---|---|
| 0(API密钥) | 存在 | |
| 1(OAuth/服务账号) | + 拥有OAuth令牌或服务账号 | 层级0的命令 + |
| 2(完整权限) | + 已配置 | 层级1的命令 + |
| 3(Ads权限) | + 拥有 | 层级2的命令 + |
运行命令前务必告知用户检测到的凭证层级。
Quick Reference
快速参考
| Command | What it does | Tier |
|---|---|---|
| Check/configure API credentials | -- |
| PSI Lighthouse + CrUX field data | 0 |
| CrUX field data only (p75 metrics) | 0 |
| 25-week CWV trend analysis | 0 |
| YouTube video search (views, likes, duration) | 0 |
| NLP entity extraction + sentiment | 0 |
| Search Console: clicks, impressions, CTR, position | 1 |
| URL Inspection: index status, canonical | 1 |
| Submit URL to Indexing API | 1 |
| GA4 organic traffic report | 2 |
| Keyword ideas from Google Ads Keyword Planner | 3 |
| PDF/HTML performance report | -- |
| Show rate limits for all APIs | -- |
| 命令 | 功能 | 层级 |
|---|---|---|
| 检查/配置API凭证 | -- |
| PSI Lighthouse实验室数据 + CrUX真实用户数据 | 0 |
| 仅CrUX真实用户数据(p75指标) | 0 |
| 25周CWV趋势分析 | 0 |
| YouTube视频搜索(查看次数、点赞数、时长) | 0 |
| NLP实体提取 + 情感分析 | 0 |
| Search Console:点击量、展示量、点击率、排名 | 1 |
| URL检测:索引状态、规范网址 | 1 |
| 提交URL至Indexing API | 1 |
| GA4自然流量报告 | 2 |
| 从Google Ads关键词规划师获取关键词创意 | 3 |
| 生成PDF/HTML性能报告 | -- |
| 显示所有API的速率限制 | -- |
PageSpeed + CrUX
PageSpeed + CrUX
/blog google pagespeed <url>
/blog google pagespeed <url>/blog google pagespeed <url>
/blog google pagespeed <url>Combined Lighthouse lab data + CrUX field data for a published blog post.
Script:
Reference:
python3 skills/blog-google/scripts/run.py pagespeed_check <url> --jsonreferences/api-reference.mdOutput 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> --jsonreferences/api-reference.md输出内容整合了实验室分数(即时Lighthouse测试结果)与真实用户数据(28天Chrome用户指标)。CrUX优先使用URL级数据,若不可用则回退到域名级数据。
/blog google crux <url>
/blog google 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>/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> --json25周CrUX历史趋势分析。展示CWV指标是提升、稳定还是下降。
脚本:
python3 skills/blog-google/scripts/run.py crux_history <url> --jsonSearch Console
Search Console
/blog google gsc <property>
/blog google gsc <property>/blog google gsc <property>
/blog google gsc <property>Search Analytics: clicks, impressions, CTR, position for last 28 days.
Script:
Default: 28 days, dimensions=query,page, type=web, limit=1000.
python3 skills/blog-google/scripts/run.py gsc_query --property <property> --jsonIncludes quick-win detection: queries at position 4-10 with high impressions.
搜索分析:过去28天的点击量、展示量、点击率、排名。
脚本:
默认设置: 28天,维度=查询词、页面,类型=网页,限制=1000条。
python3 skills/blog-google/scripts/run.py gsc_query --property <property> --json包含快速优化机会检测:排名在4-10位且展示量高的查询词。
/blog google inspect <url>
/blog google inspect <url>/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> --jsonReturns: 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> --jsonURL检测:获取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> --jsonIndexing API
Indexing API
/blog google index <url>
/blog google index <url>/blog google index <url>
/blog google index <url>Notify Google of a URL update. Submit new blog posts for faster indexation.
Script:
Reference:
python3 skills/blog-google/scripts/run.py indexing_notify <url> --jsonreferences/api-reference.mdThe 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> --jsonreferences/api-reference.mdIndexing API官方仅适用于JobPosting和BroadcastEvent/VideoObject类型页面。务必告知用户此限制。每日配额:200条发布请求。
批量提交命令:
python3 skills/blog-google/scripts/run.py indexing_notify --batch <file> --jsonGA4 Traffic
GA4流量分析
/blog google ga4 [property-id]
/blog google ga4 [property-id]/blog google ga4 [property-id]
/blog google ga4 [property-id]Organic traffic report: daily sessions, users, pageviews, bounce rate, engagement.
Script:
Default: 28 days, filtered to Organic Search channel group.
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --jsonFor top landing pages:
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --report top-pages --json自然流量报告:每日会话数、用户数、页面浏览量、跳出率、参与度。
脚本:
默认设置: 28天,筛选自然搜索渠道组。
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --json查看热门着陆页命令:
python3 skills/blog-google/scripts/run.py ga4_report --property <id> --report top-pages --jsonYouTube (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>/blog google youtube <query>
/blog google youtube <query>Search YouTube for videos relevant to a blog topic.
Script:
Quota: 100 units per search (10,000 units/day free).
python3 skills/blog-google/scripts/run.py youtube_search search "<query>" --jsonReturns: 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视频。
脚本:
配额: 每次搜索消耗100单位(每日免费配额10,000单位)。
python3 skills/blog-google/scripts/run.py youtube_search search "<query>" --json返回内容:标题、频道、查看次数、点赞数、时长、描述、标签。
获取视频详情+评论命令:
python3 skills/blog-google/scripts/run.py youtube_search video <video_id> --jsonNLP 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>/blog google nlp <url-or-text>
/blog google nlp <url-or-text>Full NLP analysis: entities, sentiment, content classification.
Script:
Free tier: 5,000 units/month. Requires billing enabled on GCP project.
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --jsonFor entity extraction only:
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --features entities --json完整NLP分析:实体识别、情感分析、内容分类。
脚本:
免费层级: 每月5,000单位。需要在GCP项目中启用计费。
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --json仅提取实体命令:
python3 skills/blog-google/scripts/run.py nlp_analyze --url <url> --features entities --jsonKeyword 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>/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>" --jsonFor 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>" --jsonReports
报告生成
/blog google report <type>
/blog google report <type>/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| Type | Input | Output |
|---|---|---|
| PSI + CrUX + CrUX History data | Core Web Vitals audit with gauges, timelines |
| GSC query data | Search Console report with query tables |
| Batch inspection data | Indexation status with coverage donut |
| All data combined | Comprehensive Google SEO report |
Note: PDF generation requires system libraries: .
Falls back to HTML if weasyprint is unavailable.
sudo apt install libpango1.0-dev libcairo2-dev生成带图表的专业PDF/HTML报告。
脚本:
python3 skills/blog-google/scripts/run.py google_report --type <type> --data <json> --domain <domain> --format pdf| 类型 | 输入 | 输出 |
|---|---|---|
| PSI + CrUX + CrUX历史数据 | 包含仪表盘和时间线的Core Web Vitals审计报告 |
| GSC查询数据 | 包含查询词表格的Search Console报告 |
| 批量检测数据 | 包含覆盖情况环形图的索引状态报告 |
| 所有整合数据 | 全面的Google SEO报告 |
注意: PDF生成需要系统库:。若weasyprint不可用,则自动回退到HTML格式。
sudo apt install libpango1.0-dev libcairo2-devRate Limits
速率限制
| API | Per-Minute | Per-Day | Auth |
|---|---|---|---|
| PSI v5 | 240 QPM | 25,000 QPD | API Key |
| CrUX + History | 150 QPM (shared) | Unlimited | API Key |
| GSC Search Analytics | 1,200 QPM/site | 30M QPD | Service Account |
| GSC URL Inspection | 600 QPM | 2,000 QPD/site | Service Account |
| Indexing API | 380 RPM | 200 publish/day | Service Account |
| GA4 Data API | 10 concurrent (50 for 360) | 200K Core Tokens/day (2M for 360) | Service Account |
| YouTube Data | -- | 10,000 units/day | API Key |
| NLP API | -- | 5,000 units/month | API Key (billing) |
Read for detailed quota management.
references/rate-limits-quotas.md| API | 每分钟限制 | 每天限制 | 认证方式 |
|---|---|---|---|
| PSI v5 | 240次/分钟 | 25,000次/天 | API密钥 |
| CrUX + 历史数据 | 150次/分钟(共享) | 无限制 | API密钥 |
| GSC搜索分析 | 1,200次/分钟/站点 | 30,000,000次/天 | 服务账号 |
| GSC URL检测 | 600次/分钟 | 2,000次/天/站点 | 服务账号 |
| Indexing API | 380次/分钟 | 200条发布请求/天 | 服务账号 |
| GA4数据API | 10个并发请求(360版本为50个) | 200,000核心令牌/天(360版本为2,000,000个) | 服务账号 |
| YouTube数据API | -- | 10,000单位/天 | API密钥 |
| NLP API | -- | 5,000单位/月 | API密钥(需计费) |
详细配额管理请阅读。
references/rate-limits-quotas.mdBlog Workflow Integration
博客工作流集成
This skill is both user-invocable () and callable
internally by other blog sub-skills:
/blog google pagespeed- 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
错误处理
| Scenario | Action |
|---|---|
| No credentials configured | Run |
| Service account lacks GSC access | Add |
| CrUX data unavailable (404) | Insufficient Chrome traffic. Use PSI lab data as fallback. |
| GA4 property not found | Find property ID in GA4 Admin > Property Details. |
| Indexing API quota exceeded | 200/day limit. Prioritize most important URLs. |
| Rate limit (429) | Wait and retry with exponential backoff. |
| 场景 | 操作 |
|---|---|
| 未配置凭证 | 运行 |
| 服务账号缺少GSC访问权限 | 将 |
| CrUX数据不可用(404) | Chrome流量不足。使用PSI实验室数据作为替代。 |
| 未找到GA4属性 | 在GA4管理 > 属性详情中查找属性ID。 |
| Indexing API配额用尽 | 每日限制200条。优先提交最重要的URL。 |
| 速率限制(429错误) | 等待后使用指数退避策略重试。 |