gsc_compare_periods
Compare two date ranges in Google Search Console by dimension and rank rows by click delta, highlighting which queries or pages gained or lost traffic.
Instructions
Join two periods on one dimension and rank the rows by click delta.
Answers "what changed" without the model diffing two tables by hand. Rows present in only one period are kept, with zeros on the missing side; the biggest movers in both directions are returned, worst first. The meta counts how many rows gained and how many lost clicks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Rolling window length ending today. | |
| 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. | |
| 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. | |
| dimension | No | One of query, page, country, device, searchAppearance. | query |
| row_limit | No | Rows returned. Default 100, capped at 1000. | |
| prev_date_to | No | Baseline end YYYY-MM-DD. | |
| prev_date_from | No | Baseline start YYYY-MM-DD. Defaults to the equally long period ending the day before date_from. | |
| min_impressions | No | Drop rows below this impression count in both periods. | |
| response_format | No | `tsv` (default, compact) or `json`. | tsv |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |