gsc_query_search_analytics
Query Google Search Console traffic data to analyze clicks, impressions, CTR, and position. Filter by dimensions, search type, and date range to diagnose SEO performance.
Instructions
Query Search Console traffic data - clicks, impressions, CTR, position.
THE workhorse tool. Supports all six dimensions (incl. HOUR, April 2025), all six search types, full filter compose, pagination, and auto-pagination.
Args:
site_url: "https://example.com/" (URL-prefix) or "sc-domain:example.com" (domain).
start_date / end_date: YYYY-MM-DD (Pacific Time). 16-month retention hard cap.
dimensions: list of {date, query, page, country, device, searchAppearance, HOUR}.
HOUR requires data_state='hourly_all'. searchAppearance cannot be combined with
other dimensions in one query - query it alone and join client-side.
search_type: web (default) | image | video | news | discover | googleNews.
filters: flat list [{dimension, operator, expression}]. Operators:
equals, contains, notEquals, notContains, includingRegex, excludingRegex.
filter_groups: advanced - pass raw dimensionFilterGroups if you need OR logic.
Mutually exclusive with filters.
aggregation_type: auto (default) | byPage | byProperty | byNewsShowcasePanel.
data_state: final (default, ~2-3d lag) | all (fresh, includes unfinalized) |
hourly_all (~10d history with HOUR dimension).
row_limit: per-call cap, 1–25000 (API hard cap).
start_row: 0-based offset for single-page paging.
max_rows: if set (up to 1M), auto-paginate until exhausted or max_rows hit.
Response: {rows, row_count, response_aggregation_type, first_incomplete_date?, first_incomplete_hour?, metadata}. Use first_incomplete_date to distinguish 'data still cooking' from 'data is final' when data_state != 'final'.
Gotchas:
16-month retention. start_date older than 16 months returns empty.
Anonymized queries (fewer than ~a dozen users over 2-3 months) drop from the 'query' dimension but count in totals - page-level data is more complete.
Aggregation shift: with a page filter, totals aggregate byPage (inflates clicks vs property-level). Set aggregation_type explicitly when comparing.
searchAppearance cannot co-exist with other dimensions (API 400).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | ||
| end_date | Yes | ||
| max_rows | No | ||
| site_url | Yes | ||
| row_limit | No | ||
| start_row | No | ||
| data_state | No | ||
| dimensions | No | ||
| start_date | Yes | ||
| search_type | No | ||
| filter_groups | No | ||
| aggregation_type | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |