Compare two periods
compare_periodsCompare search performance between two equal-length periods to spot gains and losses in clicks, impressions, and position per query or page.
Instructions
Compare search performance between two periods of equal length: totals plus a per-key breakdown with absolute and percent changes. Position change is negative when ranking improved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Filters, combined with AND. | |
| sort_by | No | clicks_change (default) and impressions_change rank the biggest gains and losses first; ties fall back to the other metric's change, then current impressions. clicks and impressions rank by the current period. | clicks_change |
| site_url | Yes | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the site, is resolved to the property that contains it. | |
| row_limit | No | Rows to return. | |
| data_state | No | Defaults to 'final': fresh, still-changing data in the current period would read as a decline against a complete baseline. | final |
| dimensions | No | Compare per value of these. Omit for ['query']; [] for totals only. | |
| current_end | No | Last day of the period to analyze. Defaults to 3 days ago, the last day that is usually final. | |
| fetch_limit | No | Top rows fetched per period before joining. | |
| search_type | No | web | |
| previous_end | No | Last day of the baseline; same length as current. | |
| current_start | No | First day of the period to analyze, YYYY-MM-DD (Pacific Time). | |
| previous_start | No | First day of the baseline. Defaults to the period just before. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| notes | No | ||
| totals | Yes | ||
| site_url | Yes | ||
| data_state | Yes | ||
| dimensions | Yes | ||
| search_type | Yes | ||
| current_period | Yes | ||
| previous_period | Yes |