seo-google
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle SEO APIs
Google SEO API
Direct access to Google's own SEO data. Bridges the gap between crawl-based
analysis (existing claude-seo skills) and Google's real-time field data: actual
Chrome user metrics, real indexation status, search performance, and organic traffic.
All APIs are free. Setup requires a Google Cloud project with API key and/or
service account -- run for step-by-step instructions.
/seo google setup可直接获取Google官方SEO数据,填补了基于爬虫的分析(现有claude-seo技能)与Google实时真实用户数据之间的差距:涵盖真实Chrome用户指标、实际收录状态、搜索表现和自然流量。
所有API均免费使用。配置需要一个带有API密钥和/或服务账号的Google Cloud项目——运行获取分步指导。
/seo google setupPrerequisites
前置要求
Before executing any command, check credentials:
bash
python scripts/google_auth.py --check --jsonConfig file:
~/.config/claude-seo/google-api.jsonjson
{
"service_account_path": "/path/to/service_account.json",
"api_key": "AIzaSy...",
"default_property": "sc-domain:example.com",
"ga4_property_id": "properties/123456789"
}If missing, read and walk the user through setup.
references/auth-setup.md执行任何命令前,请检查凭据:
bash
python scripts/google_auth.py --check --json配置文件:
~/.config/claude-seo/google-api.jsonjson
{
"service_account_path": "/path/to/service_account.json",
"api_key": "AIzaSy...",
"default_property": "sc-domain:example.com",
"ga4_property_id": "properties/123456789"
}如果缺少配置文件,请查看并引导用户完成配置。
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(广告权限) | 额外拥有 | 等级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 |
| Search Console: clicks, impressions, CTR, position | 1 |
| URL Inspection: index status, canonical, crawl info | 1 |
| Batch URL Inspection from file | 1 |
| GSC sitemap status | 1 |
| Submit URL to Indexing API | 1 |
| Batch submit up to 200 URLs | 1 |
| GA4 organic traffic report | 2 |
| Top organic landing pages | 2 |
| YouTube video search (views, likes, duration) | 0 |
| YouTube video details + top comments | 0 |
| NLP entity extraction + sentiment + classification | 0 |
| Entity analysis only (for E-E-A-T) | 0 |
| Keyword ideas from Google Ads Keyword Planner | 3 |
| Search volume lookup from Keyword Planner | 3 |
| Knowledge Graph entity check | 0 |
| Web Risk URL safety check | 0 |
| Show rate limits for all APIs | -- |
| 命令 | 功能 | 权限等级 |
|---|---|---|
| 检查/配置API凭据 | -- |
| PSI Lighthouse检测 + CrUX真实用户数据 | 0 |
| 仅CrUX真实用户数据(p75指标) | 0 |
| 25周Core Web Vitals趋势分析 | 0 |
| Search Console:点击量、展示量、点击率、排名 | 1 |
| URL检测:收录状态、规范网址、抓取信息 | 1 |
| 批量检测文件中的URL | 1 |
| GSC站点地图状态 | 1 |
| 向Indexing API提交URL | 1 |
| 批量提交最多200个URL | 1 |
| GA4自然流量报告 | 2 |
| 热门自然流量着陆页 | 2 |
| YouTube视频搜索(播放量、点赞数、时长) | 0 |
| YouTube视频详情 + 热门评论 | 0 |
| NLP实体提取 + 情感分析 + 内容分类 | 0 |
| 仅实体分析(用于E-E-A-T评估) | 0 |
| 基于Google Ads关键词规划师生成关键词创意 | 3 |
| 基于关键词规划师查询搜索量 | 3 |
| 知识图谱实体校验 | 0 |
| Web Risk URL安全检测 | 0 |
| 显示所有API的调用限制 | -- |
PageSpeed + CrUX
PageSpeed + CrUX
/seo google pagespeed <url>
/seo google pagespeed <url>/seo google pagespeed <url>
/seo google pagespeed <url>Combined Lighthouse lab data + CrUX field data.
Script:
Reference:
Default: Both mobile + desktop strategies, all Lighthouse categories.
python scripts/pagespeed_check.py <url> --jsonreferences/pagespeed-crux-api.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真实用户数据。
脚本:
参考文档:
默认设置: 同时检测移动端和桌面端,覆盖所有Lighthouse检测类别。
python scripts/pagespeed_check.py <url> --jsonreferences/pagespeed-crux-api.md输出结果融合实验室评分(实时Lighthouse检测)与真实用户数据(28天Chrome用户指标)。CrUX优先使用URL级别数据,若无则回退至域名级别数据。
/seo google crux <url>
/seo google crux <url>/seo google crux <url>
/seo google crux <url>CrUX field data only (no Lighthouse run). Faster.
Script:
python scripts/pagespeed_check.py <url> --crux-only --json仅提供CrUX真实用户数据(不运行Lighthouse检测),速度更快。
脚本:
python scripts/pagespeed_check.py <url> --crux-only --json/seo google crux-history <url>
/seo google crux-history <url>/seo google crux-history <url>
/seo google crux-history <url>25-week CrUX History trends. Shows whether CWV metrics are improving, stable, or degrading.
Script:
Reference:
python scripts/crux_history.py <url> --jsonreferences/pagespeed-crux-api.mdOutput includes per-metric trend direction, percentage change, and weekly p75 values.
25周CrUX历史趋势数据,展示Core Web Vitals指标的提升、稳定或下降趋势。
脚本:
参考文档:
python scripts/crux_history.py <url> --jsonreferences/pagespeed-crux-api.md输出内容包含各指标的趋势方向、百分比变化及每周p75数值。
Search Console
Search Console
/seo google gsc <property>
/seo google gsc <property>/seo google gsc <property>
/seo google gsc <property>Search Analytics: clicks, impressions, CTR, position for last 28 days.
Script:
Reference:
Default: 28 days, dimensions=query,page, type=web, limit=1000.
python scripts/gsc_query.py --property <property> --jsonreferences/search-console-api.mdIncludes quick-win detection: queries at position 4-10 with high impressions.
搜索分析:最近28天的点击量、展示量、点击率、排名数据。
脚本:
参考文档:
默认设置: 28天周期,维度=查询词、页面,类型=网页,限制=1000条。
python scripts/gsc_query.py --property <property> --jsonreferences/search-console-api.md包含快速优化机会检测:排名4-10位且展示量高的查询词。
/seo google inspect <url>
/seo google inspect <url>/seo google inspect <url>
/seo google inspect <url>URL Inspection: real indexation status from Google.
Script:
python scripts/gsc_inspect.py <url> --jsonReturns: verdict (PASS/FAIL), coverage state, robots.txt status, indexing state,
page fetch state, canonical selection, mobile usability, rich results.
URL检测:获取Google的实际收录状态。
脚本:
python scripts/gsc_inspect.py <url> --json返回内容:检测结果(通过/失败)、覆盖状态、robots.txt状态、收录状态、页面抓取状态、规范网址选择、移动端适配性、富媒体结果。
/seo google inspect-batch <file>
/seo google inspect-batch <file>/seo google inspect-batch <file>
/seo google inspect-batch <file>Batch inspection from a file (one URL per line). Rate limited to 2,000/day per site.
Script:
python scripts/gsc_inspect.py --batch <file> --json批量检测文件中的URL(每行一个URL),每个站点每日限制2000次调用。
脚本:
python scripts/gsc_inspect.py --batch <file> --json/seo google sitemaps <property>
/seo google sitemaps <property>/seo google sitemaps <property>
/seo google sitemaps <property>List submitted sitemaps with status, errors, warnings.
Script:
python scripts/gsc_query.py sitemaps --property <property> --json列出已提交的站点地图及其状态、错误和警告信息。
脚本:
python scripts/gsc_query.py sitemaps --property <property> --jsonIndexing API
Indexing API
/seo google index <url>
/seo google index <url>/seo google index <url>
/seo google index <url>Notify Google of a URL update.
Script:
Reference:
python scripts/indexing_notify.py <url> --jsonreferences/indexing-api.mdThe Indexing API is officially for JobPosting and BroadcastEvent/VideoObject pages.
Always inform the user of this restriction. Daily quota: 200 publish requests.
通知Google更新URL。
脚本:
参考文档:
python scripts/indexing_notify.py <url> --jsonreferences/indexing-api.mdIndexing API官方仅适用于JobPosting和BroadcastEvent/VideoObject类型页面,请务必告知用户此限制。每日配额:200条发布请求。
/seo google index-batch <file>
/seo google index-batch <file>/seo google index-batch <file>
/seo google index-batch <file>Batch submit URLs from a file. Tracks quota usage.
Script:
python scripts/indexing_notify.py --batch <file> --json批量提交文件中的URL,跟踪配额使用情况。
脚本:
python scripts/indexing_notify.py --batch <file> --jsonGA4 Traffic
GA4流量
/seo google ga4 [property-id]
/seo google ga4 [property-id]/seo google ga4 [property-id]
/seo google ga4 [property-id]Organic traffic report: daily sessions, users, pageviews, bounce rate, engagement.
Script:
Reference:
Default: 28 days, filtered to Organic Search channel group.
python scripts/ga4_report.py --property <id> --jsonreferences/ga4-data-api.md自然流量报告:每日会话数、用户数、页面浏览量、跳出率、互动数据。
脚本:
参考文档:
默认设置: 28天周期,过滤自然搜索渠道组。
python scripts/ga4_report.py --property <id> --jsonreferences/ga4-data-api.md/seo google ga4-pages [property-id]
/seo google ga4-pages [property-id]/seo google ga4-pages [property-id]
/seo google ga4-pages [property-id]Top organic landing pages ranked by sessions.
Script:
python scripts/ga4_report.py --property <id> --report top-pages --json按会话数排序的热门自然流量着陆页。
脚本:
python scripts/ga4_report.py --property <id> --report top-pages --jsonYouTube (Video SEO)
YouTube(视频SEO)
YouTube mentions have the strongest AI visibility correlation (0.737). Free, API key only.
YouTube提及量与AI可见性的相关性最强(0.737),仅需API密钥即可免费使用。
/seo google youtube <query>
/seo google youtube <query>/seo google youtube <query>
/seo google youtube <query>Search YouTube for videos. Returns title, channel, views, likes, duration.
Script:
Reference:
Quota: 100 units per search (10,000 units/day free).
python scripts/youtube_search.py search "<query>" --jsonreferences/youtube-api.md搜索YouTube视频,返回标题、频道、播放量、点赞数、时长。
脚本:
参考文档:
配额: 每次搜索消耗100单位(每日免费配额10000单位)。
python scripts/youtube_search.py search "<query>" --jsonreferences/youtube-api.md/seo google youtube-video <video_id>
/seo google youtube-video <video_id>/seo google youtube-video <video_id>
/seo google youtube-video <video_id>Detailed video info + tags + top 10 comments.
Script:
Quota: 2 units (video details + comments).
python scripts/youtube_search.py video <video_id> --json详细视频信息 + 标签 + 前10条热门评论。
脚本:
配额: 消耗2单位(视频详情 + 评论)。
python scripts/youtube_search.py video <video_id> --jsonNLP Content Analysis
NLP内容分析
Google's own entity/sentiment analysis. Enhances E-E-A-T scoring.
Google官方实体/情感分析,可增强E-E-A-T评分。
/seo google nlp <url-or-text>
/seo google nlp <url-or-text>/seo google nlp <url-or-text>
/seo google nlp <url-or-text>Full NLP analysis: entities, sentiment, content classification.
Script: or
Reference:
Free tier: 5,000 units/month. Requires billing enabled on GCP project.
python scripts/nlp_analyze.py --url <url> --json--text "..."references/nlp-api.md完整NLP分析:实体提取、情感分析、内容分类。
脚本: 或
参考文档:
免费额度: 每月5000单位,需在GCP项目中启用计费。
python scripts/nlp_analyze.py --url <url> --json--text "..."references/nlp-api.md/seo google entities <url-or-text>
/seo google entities <url-or-text>/seo google entities <url-or-text>
/seo google entities <url-or-text>Entity extraction only (faster, less quota).
Script:
python scripts/nlp_analyze.py --url <url> --features entities --json仅实体提取(速度更快,消耗配额更少)。
脚本:
python scripts/nlp_analyze.py --url <url> --features entities --jsonKeyword Research (Google Ads)
关键词研究(Google Ads)
Gold-standard keyword volume data. Requires Google Ads account.
黄金标准的关键词搜索量数据,需Google Ads账号。
/seo google keywords <seed>
/seo google keywords <seed>/seo google keywords <seed>
/seo google keywords <seed>Generate keyword ideas from seed terms.
Script:
Reference:
Requires: Ads developer token + customer ID in config (Tier 3).
python scripts/keyword_planner.py ideas "<seed>" --jsonreferences/keyword-planner-api.md基于种子词生成关键词创意。
脚本:
参考文档:
要求: 配置文件中需包含Ads开发者令牌 + 客户ID(权限等级3)。
python scripts/keyword_planner.py ideas "<seed>" --jsonreferences/keyword-planner-api.md/seo google volume <keywords>
/seo google volume <keywords>/seo google volume <keywords>
/seo google volume <keywords>Search volume for specific keywords (comma-separated).
Script:
python scripts/keyword_planner.py volume "<kw1>,<kw2>" --json查询指定关键词的搜索量(逗号分隔)。
脚本:
python scripts/keyword_planner.py volume "<kw1>,<kw2>" --jsonSupplementary
补充功能
/seo google entity <query>
/seo google entity <query>/seo google entity <query>
/seo google entity <query>Knowledge Graph entity check. Verifies brand presence.
Reference:
Uses Knowledge Graph Search API with API key.
references/supplementary-apis.md知识图谱实体校验,验证品牌存在感。
参考文档:
使用带API密钥的知识图谱搜索API。
references/supplementary-apis.md/seo google safety <url>
/seo google safety <url>/seo google safety <url>
/seo google safety <url>Web Risk API check for malware/social engineering flags.
Reference:
references/supplementary-apis.mdWeb Risk API检测,排查恶意软件/社会工程学标记。
参考文档:
references/supplementary-apis.md/seo google quotas
/seo google quotas/seo google quotas
/seo google quotasDisplay rate limits table. Read .
references/rate-limits-quotas.md显示调用限制表,请查看。
references/rate-limits-quotas.mdReports
报告生成
After any analysis command, offer to generate a PDF/HTML report.
完成任何分析命令后,可提供生成PDF/HTML报告的选项。
/seo google report <type>
/seo google report <type>/seo google report <type>
/seo google report <type>Generate a professional PDF report with charts and analytics.
Script:
python scripts/google_report.py --type <type> --data <json> --domain <domain> --format pdf| Type | Input | Output |
|---|---|---|
| PSI + CrUX + CrUX History data | Core Web Vitals audit with gauges, timelines, distributions |
| GSC query data | Search Console report with query tables, quick wins |
| Batch inspection data | Indexation status with coverage donut chart |
| All data combined | Comprehensive Google SEO report (all sections) |
Workflow:
- Run data collection commands (pagespeed, gsc, inspect-batch, etc.)
- Save JSON output to file:
python scripts/pagespeed_check.py <url> --json > data.json - Generate report:
python scripts/google_report.py --type cwv-audit --data data.json --domain <domain>
Convention: After completing analysis, suggest: "Generate a report? Use "
/seo google report <type>生成包含图表和分析内容的专业PDF报告。
脚本:
python scripts/google_report.py --type <type> --data <json> --domain <domain> --format pdf| 报告类型 | 输入数据 | 输出内容 |
|---|---|---|
| PSI + CrUX + CrUX历史数据 | Core Web Vitals审计报告,包含仪表盘、时间线、数据分布 |
| GSC查询数据 | Search Console报告,包含查询词表格、快速优化机会 |
| 批量检测数据 | 收录状态报告,包含覆盖情况环形图 |
| 所有数据整合 | 全面的Google SEO报告(包含所有板块) |
工作流程:
- 运行数据收集命令(pagespeed、gsc、inspect-batch等)
- 将JSON输出保存至文件:
python scripts/pagespeed_check.py <url> --json > data.json - 生成报告:
python scripts/google_report.py --type cwv-audit --data data.json --domain <domain>
操作规范: 完成分析后,建议用户:"需要生成报告吗?请使用"
/seo google report <type>Rate 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 | ~25K tokens/day | Service Account |
| API | 每分钟限制 | 每日限制 | 认证方式 |
|---|---|---|---|
| PSI v5 | 240次/分钟 | 25000次/天 | API密钥 |
| CrUX + 历史数据 | 150次/分钟(共享) | 无限制 | API密钥 |
| GSC搜索分析 | 1200次/分钟/站点 | 3000万次/天 | 服务账号 |
| GSC URL检测 | 600次/分钟 | 2000次/天/站点 | 服务账号 |
| Indexing API | 380次/分钟 | 200条发布请求/天 | 服务账号 |
| GA4数据API | 10个并发请求 | 约25000令牌/天 | 服务账号 |
Cross-Skill Integration
跨技能集成
- seo-audit: Spawns agent for live CWV + indexation data (conditional)
seo-google - seo-technical: Uses pagespeed_check.py for real CWV field data
- seo-performance: CrUX field data supplements Lighthouse lab data
- seo-sitemap: GSC sitemap status shows real crawl/index coverage
- seo-content: GSC query data informs keyword targeting
- seo-geo: GSC search appearance data includes AI Overview references
- seo-audit:在需要时调用代理获取实时Core Web Vitals + 收录状态数据
seo-google - seo-technical:使用pagespeed_check.py获取真实Core Web Vitals用户数据
- seo-performance:CrUX真实用户数据补充Lighthouse实验室数据
- seo-sitemap:GSC站点地图状态展示真实抓取/收录覆盖情况
- seo-content:GSC查询数据为关键词定位提供参考
- seo-geo:GSC搜索展示数据包含AI概览参考
Output Format
输出格式
- CWV metrics: traffic-light rating (Good / Needs Improvement / Poor)
- Performance reports: tables with sortable columns
- Always include data freshness note
- Save reports as
GOOGLE-API-REPORT-{domain}.md - Use templates from for structured output
assets/templates/
- Core Web Vitals指标:采用交通灯评级(良好/需要改进/较差)
- 性能报告:包含可排序列的表格
- 务必标注数据新鲜度说明
- 报告保存为
GOOGLE-API-REPORT-{domain}.md - 使用中的模板生成结构化输出
assets/templates/
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 traffic, not an auth error.
- Search Analytics data has 2-3 day lag.
- replaced
round_trip_timein CrUX (Feb 2025).effectiveConnectionType - Custom Search JSON API is closed to new customers (2025).
- INP已于2024年3月12日替代FID,请勿再引用FID。
- CrUX返回的CLS值为字符串格式(例如"0.05"),脚本会自动处理解析。
- CrUX返回404表示流量不足,并非认证错误。
- 搜索分析数据存在2-3天的延迟。
- CrUX中的已于2025年2月替代
round_trip_time。effectiveConnectionType - 自定义搜索JSON API自2025年起不再对新用户开放。
Error Handling
错误处理
| Scenario | Action |
|---|---|
| No credentials configured | Run |
| Service account lacks GSC access | Report error. Instruct: add |
| CrUX data unavailable (404) | Report insufficient Chrome traffic. Suggest PSI lab data as fallback. |
| GA4 property not found | Report error. Show how to find property ID in GA4 Admin > Property Details. |
| Indexing API quota exceeded | Report 200/day limit. Suggest prioritizing most important URLs. |
| Rate limit (429) | Wait and retry with exponential backoff. Report which API hit the limit. |
| 场景 | 处理方式 |
|---|---|
| 未配置凭据 | 运行 |
| 服务账号无GSC访问权限 | 报告错误,指导用户:将 |
| CrUX数据不可用(404) | 报告流量不足,建议使用PSI实验室数据作为替代。 |
| 未找到GA4属性 | 报告错误,告知用户在GA4管理后台 > 属性详情中查找属性ID。 |
| Indexing API配额耗尽 | 告知每日200条的限制,建议优先提交最重要的URL。 |
| 调用限制触发(429) | 等待后使用指数退避策略重试,告知用户哪个API触发了限制。 |