CLI tool for Google Search Console API.
pip install -e .- Create a Google Cloud project and enable the Search Console API
- Create OAuth credentials (Desktop app) and download
client_secrets.json - Place it in
~/.config/gsc/client_secrets.json - Run
gsc auth login
# Authentication
gsc auth login # OAuth login
gsc auth status # Check auth status
# Properties
gsc properties list # List all properties
gsc properties use sc-domain:example.com # Set default site
gsc properties details # Show property details
# Analytics
gsc analytics search # Basic search analytics
gsc analytics search --days 7 --dimensions query,page
gsc analytics advanced --filter-dim country --filter-expr usa
gsc analytics overview # Performance overview with daily trend
gsc analytics compare --p1-start 2025-01-01 --p1-end 2025-01-31 \
--p2-start 2025-02-01 --p2-end 2025-02-28
gsc analytics page --page https://example.com/blog/post
# URL Inspection
gsc urls inspect --url https://example.com/page
gsc urls batch-inspect --url https://a.com --url https://b.com
gsc urls batch-inspect --urls-file urls.txt
gsc urls check-indexing --url https://a.com --url https://b.com
# Sitemaps
gsc sitemaps list
gsc sitemaps details --sitemap https://example.com/sitemap.xml
gsc sitemaps submit --sitemap https://example.com/sitemap.xml
gsc sitemaps delete --sitemap https://example.com/sitemap.xml--json, -j Output raw JSON (pipeable)
--site, -s GSC property URL (or set GSC_SITE env var)
--format table|json|csv Output format
--data-state all|final Data freshness
--verbose, -v Verbose output
| Variable | Description |
|---|---|
GSC_SITE |
Default site URL |
GSC_OAUTH_CLIENT_SECRETS_FILE |
Path to OAuth client secrets |
GSC_CREDENTIALS_PATH |
Path to service account JSON |
GSC_SKIP_OAUTH |
Force service account auth |
GSC_DATA_STATE |
Data freshness: all or final |
GSC_CONFIG_DIR |
Config directory (default: ~/.config/gsc) |
MIT