| name | google-search-console |
| description | Query Google Search Console analytics, inspect URL indexing status, manage sitemaps, and run PageSpeed Insights audits. Use when the user needs SEO data, search performance reports, indexing diagnostics, or Core Web Vitals analysis. |
Google Search Console
Architecture
gsc is a Python CLI wrapping two Google APIs:
- Search Console API (webmasters v3 + searchconsole v1) -- search analytics, site management, sitemaps, URL inspection
- PageSpeed Insights API (v5) -- Lighthouse lab tests for performance, accessibility, SEO, best practices
All commands output JSON to stdout. Errors go to stderr. Designed for Claude to invoke and parse programmatically.
Before First Use
- uv: Run
which uv. If missing, ask the user how they want to install it (brew install uv or follow https://docs.astral.sh/uv/getting-started/installation/).
- Project sync:
uv sync --project <skill-dir>
- Auth: See below.
- PageSpeed API key: See below.
Search Console Auth (OAuth)
Save your OAuth client_secret.json (downloaded from GCP) to a known path, then authenticate:
gsc auth login --client-secret /path/to/client_secret.json
A browser opens for OAuth consent. On a headless machine, open an SSH tunnel first: ssh -L 8085:localhost:8085 <this-host>, then open the printed URL on a machine with a browser. Credentials are stored at ~/.config/skills/gsc/credentials.json and auto-refresh.
If you need to create a new OAuth client, see references/setup.md for the full GCP click-path.
PageSpeed Insights API Key
Set the key once and gsc remembers it:
gsc config set pagespeed-api-key <your-key>
If you don't have a key, create one in your GCP project's Credentials page, restrict it to the "PageSpeed Insights API", and pass it to gsc config set above.
Invocation
uv run --project /path/to/skills/google-search-console gsc <command> [args]
For brevity, examples below use gsc directly.
Commands
auth -- Manage authentication
gsc auth login --client-secret ./client_secret.json --port 8085
gsc auth status
gsc auth logout
config -- Manage settings
gsc config set pagespeed-api-key AIza...
gsc config get pagespeed-api-key
gsc config show
query -- Search Analytics
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 -d query
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 -d page -d query
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 -d date
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 -d query --query-filter pricing
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 --query-filter "=best coffee shop"
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 --device-filter "=MOBILE"
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 --search-type image
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 --row-limit 5000 --start-row 0
Filter prefix operators: = exact match, ! not-contains, no prefix or ~ for contains.
inspect -- URL Inspection
gsc inspect sc-domain:example.com https://example.com/page
gsc inspect https://example.com/ https://example.com/page --language en-US
Returns: indexing verdict, crawl info, canonical URL, mobile usability, rich results status.
sites -- Manage properties
gsc sites list
gsc sites get sc-domain:example.com
gsc sites add https://example.com/
sitemaps -- Manage sitemaps
gsc sitemaps list sc-domain:example.com
gsc sitemaps get sc-domain:example.com https://example.com/sitemap.xml
gsc sitemaps submit sc-domain:example.com https://example.com/sitemap.xml
gsc sitemaps delete sc-domain:example.com https://example.com/sitemap.xml
pagespeed -- PageSpeed Insights
gsc pagespeed https://example.com
gsc pagespeed https://example.com --strategy desktop \
--category performance --category accessibility --category seo --category best-practices
gsc pagespeed https://example.com --locale fr
Requires API key: gsc config set pagespeed-api-key <key>. Lab tests take 30-60s.
Site URL Formats
Google Search Console supports two property types:
| Type | Format | Example | Scope |
|---|
| Domain property | sc-domain:example.com | sc-domain:example.com | All subdomains, protocols, paths |
| URL-prefix property | https://example.com/ | https://example.com/ | Exact prefix match only |
Use domain properties when possible -- they cover all variations.
Common Workflows
Weekly Performance Check
gsc query sc-domain:example.com -s 2026-03-05 -e 2026-03-11 -d date
gsc query sc-domain:example.com -s 2026-02-26 -e 2026-03-04 -d date
gsc query sc-domain:example.com -s 2026-03-05 -e 2026-03-11 -d query --row-limit 25
Indexing Health Check
gsc inspect sc-domain:example.com https://example.com/important-page
gsc inspect sc-domain:example.com https://example.com/new-blog-post
gsc sitemaps list sc-domain:example.com
gsc sitemaps get sc-domain:example.com https://example.com/sitemap.xml
CTR Optimization
gsc query sc-domain:example.com -s 2026-02-10 -e 2026-03-11 -d query -d page --row-limit 5000
Device Comparison
gsc query sc-domain:example.com -s 2026-03-01 -e 2026-03-07 -d device
Core Web Vitals Check
gsc pagespeed https://example.com --strategy mobile
gsc pagespeed https://example.com --strategy desktop
Interpreting Output
See references/seo-playbook.md for detailed interpretation guides including:
- CTR benchmarks by SERP position
- Core Web Vitals thresholds
- URL inspection verdicts
- Title/description optimization
- Monthly monitoring methodology
Configuration Files
- OAuth credentials:
~/.config/skills/gsc/credentials.json
- Config (API keys):
~/.config/skills/gsc/config.json
- Override the config dir with
GSC_CONFIG_DIR=/path/to/dir
Migrating from earlier versions
If upgrading from a build that stored config at ~/.config/gsc/, run gsc config migrate --apply to move the credentials and config to the new location. gsc auth status emits a deprecation_warning until the migration runs.
Troubleshooting
"Not authenticated" -- Run gsc auth login --client-secret /path/to/client_secret.json. Credentials may have expired or be missing on a new machine.
"Permission denied" -- The authenticated account must be a verified owner or user of the Search Console property. Check property access at https://search.google.com/search-console.
"Rate limit exceeded" -- Search Console API has per-minute and per-day quotas. Wait 60 seconds and retry. See references/setup.md for quota details.
URL Inspection returns no data -- The URL may not be in Google's index. Check the verdict field. Only URLs within verified properties can be inspected.
PageSpeed timeout -- Lighthouse lab tests can take 30-60 seconds. The command uses a 120-second timeout. Retry if it fails.
"Unknown key" on config set -- Only pagespeed-api-key is a valid config key.