Docs menu

TOOLS

compare_page_performance

How did one exact page's clicks, impressions and queries change between two periods?

  • Read-only
  • No external calls

When to use it

Compares one stored page across two equal windows and breaks the change down by the queries that sent it traffic. Use it when a single page gained or lost traffic and you want to see which queries moved.

Ask your AI

  • Compare https://example.com/pricing over the last 28 days with the 28 days before.
  • Which queries drove the click drop on my /blog/guide page this week?

Parameters

NameTypeDetailsWhat it means
propertyId(required)string1–200 characterspattern ^[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.
page(required)string1–4096 charactersThe exact page address as stored from Search Console, up to 4,096 characters.
days7 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.
baselineobject—Optional custom earlier window as { start, end } dates (YYYY-MM-DD). Give it together with current; both windows must be the same length, up to 90 days, and must not overlap.
baseline.start(required)stringpattern ^\d{4}-\d{2}-\d{2}$Part of baseline; see the baseline row.
baseline.end(required)stringpattern ^\d{4}-\d{2}-\d{2}$Part of baseline; see the baseline row.
currentobject—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)stringpattern ^\d{4}-\d{2}-\d{2}$Part of current; see the current row.
current.end(required)stringpattern ^\d{4}-\d{2}-\d{2}$Part of current; see the current row.
queryLimitintegerdefault 20minimum 1maximum 50How many queries to list individually, from 1 to 50. Defaults to 20; the rest are still counted in the totals.

What it returns

The page's clicks, impressions, click-through rate and average position in each window, and up to queryLimit of its queries (20 by default) with their own figures and click change; the remaining queries are counted but not listed. It also gives the arithmetic difference between the page total and its queries, data coverage, warnings, the page's sitemap membership and sitemap changes between the windows, and an evidence ID for get_evidence_for_change when stored data was used.

Fields of the result:

NameTypeDetails
idstring or null1–200 characterspattern ^[a-zA-Z0-9._:-]+$
resultobject—
result.kind"page_performance"—
result.schema_version"1.0.0"—
result.analysis_version"1.0.0"—
result.property_idstring1–200 characterspattern ^[a-zA-Z0-9._:-]+$
result.pagestring1–4096 characters
result.sourceobject—
result.windowsobject or null—
result.filtersobject—
result.source_revisionsarray of objectat most 360 items
result.coverageobject or null—
result.warningsarray of stringat most 30 items
result.evidence_idsarray of stringat most 1 items
result.page_metricsobject—
result.query_attributionobject—
result.arithmetic_residualobject—
result.scan_policyobject—
result.sitemapobject—
input_fingerprintstring or null—
currency"current" | "historical"—
sourceobject—
source.kind"fixture" | "google"—
source.demoboolean—
errorobjectreturned on its own, instead of the other fields
error.code"intent_history_unavailable" | "intent_accounting_pending" | "google_reconnect_required" | "unauthorized" | "not_found_or_forbidden" | "dependency_unavailable" | "quota_exceeded" | "invalid_input" | "invalid_source" | "stale_attempt" | "conflict" | "unknown_commit" | "not_configured"—
error.retryableboolean—
error.messagestring—
error.correlation_idstring1–200 characterspattern ^[a-zA-Z0-9._:-]+$

Notes

  • The page must match the stored address exactly, including case, query string and fragment; QueryHippo doesn't fetch or normalize the URL.
  • Any difference between the page total and the sum of its queries is arithmetic only; it doesn't identify hidden queries or a cause.
  • Sitemap changes for the page in the same period are listed as events that happened at the same time, not as causes.
  • 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 an exact stored page in finalized web page and page/query profiles. Observed-row metrics and full-tail query attribution remain independent; residual is arithmetic, not a cause. Source-calendar windows, six-million-row shared scan budget and 256 KiB evidence bound. No external calls. Adds the page's sitemap membership and sitemap changes between the windows as same-period events, not causes.

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._:-]+$"
    },
    "page": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "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
    },
    "queryLimit": {
      "default": 20,
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    }
  },
  "required": [
    "propertyId",
    "page"
  ],
  "additionalProperties": false
}
Output schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "^[a-zA-Z0-9._:-]+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "result": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "page_performance"
        },
        "schema_version": {
          "type": "string",
          "const": "1.0.0"
        },
        "analysis_version": {
          "type": "string",
          "const": "1.0.0"
        },
        "property_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "^[a-zA-Z0-9._:-]+$"
        },
        "page": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "fixture",
                "google"
              ]
            },
            "demo": {
              "type": "boolean"
            }
          },
          "required": [
            "kind",
            "demo"
          ],
          "additionalProperties": false
        },
        "windows": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "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": [
                "baseline",
                "current"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "filters": {
          "type": "object",
          "properties": {
            "search_type": {
              "type": "string",
              "const": "web"
            },
            "profiles": {
              "type": "array",
              "items": [
                {
                  "type": "string",
                  "const": "page"
                },
                {
                  "type": "string",
                  "const": "page_query"
                }
              ],
              "additionalItems": false,
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": [
            "search_type",
            "profiles"
          ],
          "additionalProperties": false
        },
        "source_revisions": {
          "maxItems": 360,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "search_type": {
                "type": "string",
                "const": "web"
              },
              "profile": {
                "type": "string",
                "enum": [
                  "page",
                  "page_query"
                ]
              },
              "source": {
                "type": "string",
                "enum": [
                  "performance",
                  "none"
                ]
              },
              "revision_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^[a-zA-Z0-9._:-]+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "row_count": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "aggregation": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "byPage",
                      "byProperty",
                      "auto"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "truncated": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "truncation_basis": {
                "type": "string",
                "enum": [
                  "persisted",
                  "unknown"
                ]
              },
              "extraction_complete": {
                "type": "boolean"
              },
              "metric_usable": {
                "type": "boolean"
              },
              "refresh_state": {
                "type": "string",
                "enum": [
                  "waiting",
                  "active",
                  "failed",
                  "none"
                ]
              },
              "availability": {
                "type": "string",
                "enum": [
                  "observed",
                  "completed_empty",
                  "missing",
                  "unsupported"
                ]
              },
              "error_code": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "intent_history_unavailable",
                      "intent_accounting_pending",
                      "google_reconnect_required",
                      "unauthorized",
                      "not_found_or_forbidden",
                      "dependency_unavailable",
                      "quota_exceeded",
                      "invalid_input",
                      "invalid_source",
                      "stale_attempt",
                      "conflict",
                      "unknown_commit",
                      "not_configured"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "date",
              "search_type",
              "profile",
              "source",
              "revision_id",
              "row_count",
              "aggregation",
              "truncated",
              "truncation_basis",
              "extraction_complete",
              "metric_usable",
              "refresh_state",
              "availability",
              "error_code"
            ],
            "additionalProperties": false
          }
        },
        "coverage": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "page": {
                  "type": "object",
                  "properties": {
                    "baseline": {
                      "type": "object",
                      "properties": {
                        "expected_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "complete_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "empty_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "missing_dates": {
                          "maxItems": 90,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          }
                        },
                        "aggregation": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "byPage",
                                "byProperty"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "expected_days",
                        "complete_days",
                        "empty_days",
                        "missing_dates",
                        "aggregation",
                        "truncated"
                      ],
                      "additionalProperties": false
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "expected_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "complete_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "empty_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "missing_dates": {
                          "maxItems": 90,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          }
                        },
                        "aggregation": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "byPage",
                                "byProperty"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "expected_days",
                        "complete_days",
                        "empty_days",
                        "missing_dates",
                        "aggregation",
                        "truncated"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "baseline",
                    "current"
                  ],
                  "additionalProperties": false
                },
                "page_query": {
                  "type": "object",
                  "properties": {
                    "baseline": {
                      "type": "object",
                      "properties": {
                        "expected_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "complete_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "empty_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "missing_dates": {
                          "maxItems": 90,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          }
                        },
                        "aggregation": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "byPage",
                                "byProperty"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "expected_days",
                        "complete_days",
                        "empty_days",
                        "missing_dates",
                        "aggregation",
                        "truncated"
                      ],
                      "additionalProperties": false
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "expected_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "complete_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "empty_days": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "missing_dates": {
                          "maxItems": 90,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          }
                        },
                        "aggregation": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "byPage",
                                "byProperty"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "expected_days",
                        "complete_days",
                        "empty_days",
                        "missing_dates",
                        "aggregation",
                        "truncated"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "baseline",
                    "current"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "page",
                "page_query"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "warnings": {
          "maxItems": 30,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 200
          }
        },
        "evidence_ids": {
          "maxItems": 1,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-zA-Z0-9._:-]+$"
          }
        },
        "page_metrics": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "ok",
                "ok_with_warnings",
                "insufficient_data",
                "incompatible_aggregation",
                "scan_budget_exceeded"
              ]
            },
            "metric_scope": {
              "type": "string",
              "const": "observed_page_rows"
            },
            "baseline": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "observation": {
                      "type": "string",
                      "enum": [
                        "observed",
                        "not_observed"
                      ]
                    },
                    "entity_observed_days": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "clicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "impressions": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ctr": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "position": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "observation",
                    "entity_observed_days",
                    "clicks",
                    "impressions",
                    "ctr",
                    "position"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "current": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "observation": {
                      "type": "string",
                      "enum": [
                        "observed",
                        "not_observed"
                      ]
                    },
                    "entity_observed_days": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "clicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "impressions": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ctr": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "position": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "observation",
                    "entity_observed_days",
                    "clicks",
                    "impressions",
                    "ctr",
                    "position"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "deltas": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "clicks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "impressions": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "clicks_percent": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "impressions_percent": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "ctr_percentage_points": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "position": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "clicks",
                    "impressions",
                    "clicks_percent",
                    "impressions_percent",
                    "ctr_percentage_points",
                    "position"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "status",
            "metric_scope",
            "baseline",
            "current",
            "deltas"
          ],
          "additionalProperties": false
        },
        "query_attribution": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "ok",
                "ok_with_warnings",
                "insufficient_data",
                "incompatible_aggregation",
                "scan_budget_exceeded"
              ]
            },
            "aggregation": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "byPage",
                    "byProperty"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "total_distinct_queries": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "requested_limit": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "returned_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "omitted_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "byte_limited": {
              "type": "boolean"
            },
            "full_observed_query_click_delta": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "tail_click_delta": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "queries": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string"
                  },
                  "baseline": {
                    "type": "object",
                    "properties": {
                      "observation": {
                        "type": "string",
                        "enum": [
                          "observed",
                          "not_observed"
                        ]
                      },
                      "entity_observed_days": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "clicks": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "impressions": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ctr": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "position": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "observation",
                      "entity_observed_days",
                      "clicks",
                      "impressions",
                      "ctr",
                      "position"
                    ],
                    "additionalProperties": false
                  },
                  "current": {
                    "type": "object",
                    "properties": {
                      "observation": {
                        "type": "string",
                        "enum": [
                          "observed",
                          "not_observed"
                        ]
                      },
                      "entity_observed_days": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "clicks": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "impressions": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "ctr": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "position": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "observation",
                      "entity_observed_days",
                      "clicks",
                      "impressions",
                      "ctr",
                      "position"
                    ],
                    "additionalProperties": false
                  },
                  "click_delta": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "query",
                  "baseline",
                  "current",
                  "click_delta"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "status",
            "aggregation",
            "total_distinct_queries",
            "requested_limit",
            "returned_count",
            "omitted_count",
            "byte_limited",
            "full_observed_query_click_delta",
            "tail_click_delta",
            "queries"
          ],
          "additionalProperties": false
        },
        "arithmetic_residual": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ]
            },
            "label": {
              "type": "string",
              "const": "observed_breakdown_arithmetic_residual"
            }
          },
          "required": [
            "value",
            "reason",
            "label"
          ],
          "additionalProperties": false
        },
        "scan_policy": {
          "type": "object",
          "properties": {
            "max_rows": {
              "type": "number",
              "const": 6000000
            },
            "statement_timeout_ms": {
              "type": "number",
              "const": 5000
            },
            "admission_order": {
              "type": "array",
              "items": [
                {
                  "type": "string",
                  "const": "page"
                },
                {
                  "type": "string",
                  "const": "page_query"
                }
              ],
              "additionalItems": false,
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": [
            "max_rows",
            "statement_timeout_ms",
            "admission_order"
          ],
          "additionalProperties": false
        },
        "sitemap": {
          "type": "object",
          "properties": {
            "version": {
              "type": "string",
              "const": "1.0.0"
            },
            "status": {
              "type": "string",
              "enum": [
                "ready",
                "no_sitemap_snapshot",
                "invalid_url"
              ]
            },
            "snapshot_day": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "source": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "google",
                    "fixture"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "history_start": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "in_latest_sitemap": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "variant_in_latest_sitemap": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "latest_lastmod": {
              "type": [
                "string",
                "null"
              ]
            },
            "lastmod_tracking_start": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "intervals": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "first_seen_day": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "last_seen_day": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "first_seen_day",
                  "last_seen_day"
                ],
                "additionalProperties": false
              }
            },
            "events": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "added"
                      },
                      "observed_day": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      }
                    },
                    "required": [
                      "type",
                      "observed_day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "removed"
                      },
                      "observed_day": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "last_listed_day": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      }
                    },
                    "required": [
                      "type",
                      "observed_day",
                      "last_listed_day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "lastmod_changed"
                      },
                      "observed_day": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "lastmod": {
                        "type": "string"
                      },
                      "previous_lastmod": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "bulk": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "type",
                      "observed_day",
                      "lastmod",
                      "previous_lastmod",
                      "bulk"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "events_truncated": {
              "type": "boolean"
            },
            "caveats": {
              "maxItems": 10,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "version",
            "status",
            "snapshot_day",
            "source",
            "history_start",
            "in_latest_sitemap",
            "variant_in_latest_sitemap",
            "latest_lastmod",
            "lastmod_tracking_start",
            "intervals",
            "events",
            "events_truncated",
            "caveats"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "kind",
        "schema_version",
        "analysis_version",
        "property_id",
        "page",
        "source",
        "windows",
        "filters",
        "source_revisions",
        "coverage",
        "warnings",
        "evidence_ids",
        "page_metrics",
        "query_attribution",
        "arithmetic_residual",
        "scan_policy"
      ],
      "additionalProperties": false
    },
    "input_fingerprint": {
      "type": [
        "string",
        "null"
      ]
    },
    "currency": {
      "type": "string",
      "enum": [
        "current",
        "historical"
      ]
    },
    "source": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "fixture",
            "google"
          ]
        },
        "demo": {
          "type": "boolean"
        }
      },
      "required": [
        "kind",
        "demo"
      ],
      "additionalProperties": false
    },
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "intent_history_unavailable",
            "intent_accounting_pending",
            "google_reconnect_required",
            "unauthorized",
            "not_found_or_forbidden",
            "dependency_unavailable",
            "quota_exceeded",
            "invalid_input",
            "invalid_source",
            "stale_attempt",
            "conflict",
            "unknown_commit",
            "not_configured"
          ]
        },
        "retryable": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "correlation_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "^[a-zA-Z0-9._:-]+$"
        }
      },
      "required": [
        "code",
        "retryable",
        "message",
        "correlation_id"
      ],
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "id",
        "result",
        "input_fingerprint",
        "currency",
        "source"
      ],
      "not": {
        "required": [
          "error"
        ]
      }
    },
    {
      "required": [
        "error"
      ],
      "maxProperties": 1
    }
  ]
}

View as Markdown