Query search performance data
query_search_analyticsRetrieve clicks, impressions, CTR, and average position from Google Search Console to analyze search traffic and rankings. Group results by query, page, country, device, or date for targeted insights.
Instructions
Query clicks, impressions, CTR and average position from the Search Console Performance report - the core tool for all traffic and ranking analysis.
Group by one or more dimensions (query, page, country, device, searchAppearance, date, hour). Rows come back sorted by clicks descending, and only rows with data are returned. Omitting dimensions returns a single totals row for the whole property.
Behaviours worth planning around:
Data is final only up to about 3 days ago; use
lastDaysto get a safe window automatically.Grouping by
querytriggers privacy filtering: rare queries are omitted entirely, so query-level clicks will not sum to the property total. Never present that gap as lost traffic.Combining
pageandqueryis capped harder than either alone, so expect fewer rows than you might predict.rowLimitmaxes at 25000 per call; page withstartRowfor more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Search surface. Defaults to "web". "discover" and "googleNews" support only a limited set of dimensions and have no query dimension at all. | |
| endDate | No | Inclusive end date, YYYY-MM-DD, in Pacific Time. Ignored if lastDays is set. | |
| siteUrl | No | Search Console property, exactly as it appears in `list_sites`. URL-prefix properties include the scheme and a trailing slash ("https://example.com/"); domain properties use the "sc-domain:" prefix ("sc-domain:example.com"). These are distinct properties with different data. | |
| lastDays | No | Shorthand for a trailing window, e.g. 28 for "the last 28 days". The window ends 3 days ago because Search Console data is not final before then. Prefer this over startDate/endDate unless you need a specific window. | |
| rowLimit | No | Rows to return, 1-25000. Defaults to 1000. | |
| startRow | No | Zero-based offset for pagination. Defaults to 0. | |
| dataState | No | "final" (default) returns only finalised data. "all" includes fresh, still-changing data for the most recent days. "hourly_all" is required when using the "hour" dimension. | |
| startDate | No | Inclusive start date, YYYY-MM-DD, in Pacific Time. Ignored if lastDays is set. | |
| dimensions | No | Group results by these dimensions, in order. Omit for property-level totals. "date" gives a time series; "hour" requires dataState "hourly_all" and only covers roughly the last 10 days. | |
| aggregationType | No | How to aggregate. Leave as "auto" unless you specifically need byPage or byProperty; changing it changes what a click counts as. | |
| dimensionFilterGroups | No | Filter groups. Filters inside a group are ANDed together; supplying multiple groups is currently equivalent to one combined AND group in the API. |