Query search performance data
search_analyticsRuns raw Search Console performance queries for clicks, impressions, CTR and average position, broken down by query, page, country, device, date or hour, with filters. Use it for breakdowns the specialized tools don't cover.
Instructions
Runs a raw Search Console performance query: clicks, impressions, CTR and average position, broken down by any mix of query, page, country, device, date, hour and search appearance, with filters. Use it for anything the specialised tools do not cover. Rows come back sorted by clicks unless order_by says otherwise.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_analytics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Length of the period in days, used when start_date is not given. Default 28. | |
| order | No | Sort direction. Default desc, or asc for position (best first). | |
| filters | No | Filters; a row must match all of them. Example: [{"dimension":"page","operator":"contains","expression":"/blog/"},{"dimension":"country","operator":"equals","expression":"usa"}]. Countries are ISO 3166-1 alpha-3 codes, devices are DESKTOP, MOBILE or TABLET, and the regex operators use RE2 syntax. | |
| end_date | No | Last day of the period, YYYY-MM-DD in Pacific Time, or "today" / "yesterday". Defaults to the latest day Google has complete data for, usually 3 to 4 days ago. A later date includes days that are still incomplete. | |
| order_by | No | Sort by this metric instead of clicks. The tool then reads up to 25,000 rows and sorts them locally, so "top by impressions" is correct within that scan. | |
| site_url | No | Search Console property, for example "sc-domain:example.com" or "https://www.example.com/". A bare domain or any page URL on the site also works. Optional when GSC_SITE_URL is set or the account has exactly one property. | |
| row_limit | No | Maximum number of rows to return. | |
| start_row | No | Zero-based offset, for paging through results. | |
| data_state | No | "all" (default) matches the Search Console website: complete days, plus partial numbers for recent days if the period reaches that far. "final" leaves out any day that is not final yet. "hourly_all" is for the hour dimension. | all |
| dimensions | No | How to break the numbers down, in order. Empty returns one row of totals. "searchAppearance" cannot be combined with other dimensions. "hour" needs data_state "hourly_all" and only covers the last few days. | |
| start_date | No | First day of the period, YYYY-MM-DD in Pacific Time. Defaults to `days` before end_date. | |
| search_type | No | Which Google surface: web (default), image, video, news (the News tab), discover or googleNews. | web |
| aggregation_type | No | How impressions are counted: "byProperty" counts a search once however many of your pages appear, "byPage" counts each page. Leave unset for Google's default. |