gsc_query
Pull Search Analytics performance data—clicks, impressions, CTR, position—for any date range and dimension, with filters and pagination.
Instructions
Query the Search Analytics report: clicks, impressions, CTR, position.
This is the general-purpose tool. With no dates it covers the last 28 days ending today (UTC), with data_state=all so today's partial data is included, matching what the Search Console UI shows.
Example: site_url="sc-domain:example.com", dimensions="query,page", period="last_28_days", row_limit=100.
Returns a # meta ... line then a TSV table, or JSON with meta and rows.
The meta names the exact range, the row count, whether more rows exist and
the start_row to pass next.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Rolling window length ending today. | |
| type | No | web, image, video, news, discover or googleNews. | web |
| period | No | Named range: last_7_days, last_28_days, last_3_months, last_month, this_month, last_16_months. | |
| date_to | No | End date YYYY-MM-DD. Defaults to today. | |
| filters | No | List of {dimension, operator, expression}. Operators: equals, notEquals, contains, notContains, includingRegex, excludingRegex. | |
| no_cache | No | Bypass the response cache for this call. | |
| site_url | Yes | `sc-domain:example.com` for a domain property, or `https://example.com/` with the trailing slash for a URL-prefix property. Call gsc_sites if unsure. | |
| date_from | No | Start date YYYY-MM-DD. Overrides period and days. | |
| row_limit | No | Rows returned. Default 100, capped at 1000. | |
| start_row | No | Zero-based pagination offset. | |
| data_state | No | `all` (default, includes today's partial data) or `final`. | |
| dimensions | No | Comma-separated dimensions: query, page, country, device, date, searchAppearance, hour. `hour` covers only the last 10 days. | query |
| response_format | No | `tsv` (default, compact) or `json`. | tsv |
| aggregation_type | No | auto, byPage or byProperty. | auto |
| filter_group_type | No | Only `and` is supported by the API within one group. | and |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |