Google Search Console API for SEO Monitoring
Google Search Console provides data unavailable elsewhere: real search queries your site appears for, CTR by position, indexation coverage, Core Web Vitals errors from field data. Checking manually once a week misses signals. API allows automatic data extraction, building custom dashboards, and setting alerts on degradation.
API Access Setup
Authorize via Google OAuth 2.0. For server monitoring use Service Account:
- Create project in Google Cloud Console
- Enable
Google Search Console API - Create Service Account, download JSON key
- In GSC add service account email as resource user (Settings → Users and permissions)
from google.oauth2 import service_account
from googleapiclient.discovery import build
SCOPES = ['https://www.googleapis.com/auth/webmasters.readonly']
SERVICE_ACCOUNT_FILE = 'gsc-service-account.json'
credentials = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE,
scopes=SCOPES
)
service = build('searchconsole', 'v1', credentials=credentials)
Fetching Search Data
Main method is searchanalytics.query. Parameters: date range, dimensions (query, page, country, device, date), filters, row limit (max 25,000 per request).
Monitoring Positions by Key Pages
Track positions for specific pages by brand and non-brand queries. Get top performing keywords.
Checking Indexation
URL coverage API allows checking indexation status of individual pages via urlInspection method.
Alerts on Degradation
Useful automation — compare current week with previous and send notification if click drop exceeds threshold.
Storage and Visualization
Collected data is written to PostgreSQL or BigQuery for long-term storage and trends. GSC stores data only 16 months — accumulation in own DB allows building long-term trends.
API Quotas
GSC API has limits: 1200 requests per minute per project, 200 requests per user per 100 seconds. For daily data collection over 28-day window with multiple dimensions this isn't a problem. For bulk export of historical data need exponential backoff.
Timeline
Basic integration (daily collection of clicks/positions to DB) — 2 working days. With degradation alerts, indexation checks, Grafana dashboard — 4–5 days. Setup for multiple sites/GSC resources with shared storage — 5–7 days.







