# compare_periods_like_for_like

> Compares two consecutive 7- or 28-day windows, or two custom windows of equal length, and saves the measured result with an evidence ID you can retrieve later…

**Source:** [https://queryhippo.com/docs/tools/compare_periods_like_for_like](https://queryhippo.com/docs/tools/compare_periods_like_for_like)

How did my site's search performance change between two equal periods?

- Read-only
- No external calls

## When to use it

Compares two consecutive 7- or 28-day windows, or two custom windows of equal length, and saves the measured result with an evidence ID you can retrieve later. It reports what changed, not why.

## Ask your AI

- Compare my site's last 28 days with the 28 days before.
- How did clicks change from 1–14 September to 15–28 September?

## Parameters

| Name | Type | Details | What it means |
| --- | --- | --- | --- |
| `propertyId` (required) | `string` | 1–200 characters; pattern ^[a-zA-Z0-9._:-]+$ | The ID of the site to read, as returned by list_sites. You must own the site or have been granted access to it. |
| `days` | `7 or 28` | — | Compare the latest 7 or 28 complete days with the 7 or 28 days just before them. Leave it out to use 28, and don't combine it with baseline/current. |
| `baseline` | `object` | — | Optional custom earlier window as { start, end } dates (YYYY-MM-DD). Give it together with current; both windows must be the same length and must not overlap. |
| `baseline.start` (required) | `string` | pattern ^\\d{4}-\\d{2}-\\d{2}$ | Part of baseline; see the baseline row. |
| `baseline.end` (required) | `string` | pattern ^\\d{4}-\\d{2}-\\d{2}$ | Part of baseline; see the baseline row. |
| `current` | `object` | — | Optional custom later window as { start, end } dates (YYYY-MM-DD). Give it together with baseline; it must start after baseline ends. |
| `current.start` (required) | `string` | pattern ^\\d{4}-\\d{2}-\\d{2}$ | Part of current; see the current row. |
| `current.end` (required) | `string` | pattern ^\\d{4}-\\d{2}-\\d{2}$ | Part of current; see the current row. |

## What it returns

The two windows compared, and for clicks, impressions, click-through rate, average position, visible-query clicks and query click share, the value before and after, the difference and the percentage change. It also gives short findings (such as growth, decline or stable), coverage of each window including missing or incomplete days, and warnings; status is insufficient_data or incompatible_windows, with no metrics, when the windows can't be compared. The result is saved under the evidence ID it returns, which get_evidence_for_change reads back.

## Notes

- Windows follow Search Console's calendar and end at the latest complete day; missing days stay missing rather than counted as zero.
- Read-only: it reads data QueryHippo has already stored. It does not start a collection, fetch anything or call an AI model.

## Description your AI sees

> Compare consecutive 7/28-day source-calendar windows or validated custom equal ranges. Persist measured evidence; no inferred cause.

## Full schemas

**Input schema**

```
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "propertyId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "pattern": "^[a-zA-Z0-9._:-]+$"
    },
    "days": {
      "anyOf": [
        {
          "type": "number",
          "const": 7
        },
        {
          "type": "number",
          "const": 28
        }
      ]
    },
    "baseline": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "end": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false
    },
    "current": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "end": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "propertyId"
  ],
  "additionalProperties": false
}
```
