Docs menu

TOOLS

find_page_one_candidates

Which queries are close to page one, and which pages get seen but not clicked, over the last few months?

  • Read-only
  • No external calls

When to use it

Looks at one long window of 28 to 365 days (90 by default) and returns two lists: queries whose average Search Console position is between 4 and 20 with real impressions, and pages whose click-through rate is well below similar pages at the same average position. Use it to pick what to improve next; it doesn't predict extra clicks.

Ask your AI

  • Which of my queries are just off page one over the last 6 months?
  • Which pages get lots of impressions but few clicks compared with similar pages this year?
  • Show queries averaging positions 4 to 20 over the last 90 days and how they did in the last 28.

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.
daysintegerdefault 90minimum 28maximum 365How many days the window covers, from 28 to 365. Defaults to 90.
endstringpattern ^\d{4}-\d{2}-\d{2}$Optional last day of the window (YYYY-MM-DD). Leave it out to end at the latest complete day of data.
sectionsarray of "queries" | "pages"default ["queries","pages"]1–2 itemsWhich lists to return: "queries", "pages" or both (the default). Each may appear once.
limitintegerdefault 25minimum 1maximum 50How many entries to return per section, from 1 to 50. Defaults to 25.
threshold_mode"scaled" | "fixed"default "scaled""scaled" (default) sizes the thresholds to each section's window impressions, scaled to 28 days; "fixed" uses the same fixed defaults for every site.
thresholdsobject—Optional overrides: min_impressions, peer_min_count, peer_min_impressions and ctr_max_ratio (the page's click-through rate must be at most this share of its peers', 0.05 to 0.95). Any other field is rejected. The peer settings apply to pages only.
thresholds.min_impressionsintegerminimum 1maximum 1000000Part of thresholds; see the thresholds row.
thresholds.peer_min_countintegerminimum 1maximum 1000Part of thresholds; see the thresholds row.
thresholds.peer_min_impressionsintegerminimum 1maximum 100000000Part of thresholds; see the thresholds row.
thresholds.ctr_max_rationumberminimum 0.05maximum 0.95Part of thresholds; see the thresholds row.

What it returns

For each section you asked for (queries, pages or both), up to limit entries (25 by default, at most 50). Each query has its clicks, impressions, click-through rate and average position over the whole window and over its last 28 days (marked not observed, with no figures, if it wasn't seen then). Each page has its window figures plus the position band, the number of comparable pages, their combined clicks, impressions and click-through rate, and the gap in percentage points. Each section also gives its status, data coverage with missing date ranges, the thresholds it used and how they were scaled, how many candidates were found and left out, and, when the window is too large to read, the most days that would fit (max_days_within_budget). The result also lists warnings 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_one_candidates"—
result.schema_version"1.0.0"—
result.analysis_version"1.0.0"—
result.policy_version"1.0.0"—
result.property_idstring1–200 characterspattern ^[a-zA-Z0-9._:-]+$
result.sourceobject—
result.requested_daysintegerminimum 28maximum 365
result.requested_limitintegerminimum 1maximum 50
result.rangeobject or null—
result.recent_rangeobject or null—
result.policyobject—
result.sectionsobject—
result.source_manifestobject—
result.scan_policyobject—
result.warningsarray of stringat most 30 items
result.evidence_idsarray of stringat most 1 items
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

  • Position is Search Console's average position across all impressions in the window, not a rank checked on a live results page. A long average can hide a recent change, which is why each query also shows its last 28 days.
  • Pages are compared with other pages of your site in the same average-position band (1–3, 3–6, 6–11, 11–21, 21+), leaving the page itself out. Brand, device and query mix can make a page look low against its peers.
  • By default (threshold_mode "scaled") the thresholds scale to each section's impressions over the window, scaled to 28 days: ceil(impressions × 28 / days). You can override min_impressions, peer_min_count, peer_min_impressions or ctr_max_ratio, or use the fixed defaults.
  • QueryHippo reads at most one million stored rows for each section, checked separately for queries and pages. A section that would need more isn't read or sampled: it returns scan_budget_exceeded and the most days that would fit, so you can ask again with fewer days.
  • Every day of the window must be collected. If some days are missing, the section returns insufficient_data and lists the missing date ranges instead of candidates.
  • 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

Up to 365 days: queries with Search Console mean position 4–20 and real impressions, and pages with impressions but CTR below position-band peers. Disclosed scaled thresholds; no predicted lift or SERP ranking. No external calls.

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": {
      "default": 90,
      "type": "integer",
      "minimum": 28,
      "maximum": 365
    },
    "end": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "sections": {
      "default": [
        "queries",
        "pages"
      ],
      "minItems": 1,
      "maxItems": 2,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "queries",
          "pages"
        ]
      }
    },
    "limit": {
      "default": 25,
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    },
    "threshold_mode": {
      "default": "scaled",
      "type": "string",
      "enum": [
        "scaled",
        "fixed"
      ]
    },
    "thresholds": {
      "type": "object",
      "properties": {
        "min_impressions": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000
        },
        "peer_min_count": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "peer_min_impressions": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000000
        },
        "ctr_max_ratio": {
          "type": "number",
          "minimum": 0.05,
          "maximum": 0.95
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "propertyId"
  ],
  "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_one_candidates"
        },
        "schema_version": {
          "type": "string",
          "const": "1.0.0"
        },
        "analysis_version": {
          "type": "string",
          "const": "1.0.0"
        },
        "policy_version": {
          "type": "string",
          "const": "1.0.0"
        },
        "property_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "^[a-zA-Z0-9._:-]+$"
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "fixture",
                "google"
              ]
            },
            "demo": {
              "type": "boolean"
            }
          },
          "required": [
            "kind",
            "demo"
          ],
          "additionalProperties": false
        },
        "requested_days": {
          "type": "integer",
          "minimum": 28,
          "maximum": 365
        },
        "requested_limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "range": {
          "anyOf": [
            {
              "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
            },
            {
              "type": "null"
            }
          ]
        },
        "recent_range": {
          "anyOf": [
            {
              "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
            },
            {
              "type": "null"
            }
          ]
        },
        "policy": {
          "type": "object",
          "properties": {
            "version": {
              "type": "string",
              "const": "1.0.0"
            },
            "position_min": {
              "type": "number",
              "const": 4
            },
            "position_max": {
              "type": "number",
              "const": 20
            },
            "position_basis": {
              "type": "string",
              "const": "search_console_impression_weighted_mean_position"
            },
            "recent_days": {
              "type": "number",
              "const": 28
            },
            "basis_days": {
              "type": "number",
              "const": 28
            },
            "basis_formula": {
              "type": "string",
              "const": "ceil(section_window_impressions*28/days)"
            },
            "position_bands": {
              "type": "array",
              "items": [
                {
                  "type": "array",
                  "items": [
                    {
                      "type": "number",
                      "const": 1
                    },
                    {
                      "type": "number",
                      "const": 3
                    }
                  ],
                  "additionalItems": false,
                  "minItems": 2,
                  "maxItems": 2
                },
                {
                  "type": "array",
                  "items": [
                    {
                      "type": "number",
                      "const": 3
                    },
                    {
                      "type": "number",
                      "const": 6
                    }
                  ],
                  "additionalItems": false,
                  "minItems": 2,
                  "maxItems": 2
                },
                {
                  "type": "array",
                  "items": [
                    {
                      "type": "number",
                      "const": 6
                    },
                    {
                      "type": "number",
                      "const": 11
                    }
                  ],
                  "additionalItems": false,
                  "minItems": 2,
                  "maxItems": 2
                },
                {
                  "type": "array",
                  "items": [
                    {
                      "type": "number",
                      "const": 11
                    },
                    {
                      "type": "number",
                      "const": 21
                    }
                  ],
                  "additionalItems": false,
                  "minItems": 2,
                  "maxItems": 2
                },
                {
                  "type": "array",
                  "items": [
                    {
                      "type": "number",
                      "const": 21
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "additionalItems": false,
                  "minItems": 2,
                  "maxItems": 2
                }
              ],
              "additionalItems": false,
              "minItems": 5,
              "maxItems": 5
            },
            "peer_scope": {
              "type": "string",
              "const": "same_property_profile_aggregation_window_leave_one_out"
            },
            "query_rule": {
              "type": "string",
              "const": "window_position_within_min_max_and_impressions_at_least_min"
            },
            "page_rule": {
              "type": "string",
              "const": "high_impressions_low_ctr_against_leave_one_out_band_peers"
            },
            "query_sort": {
              "type": "string",
              "const": "window_impressions_desc_then_exact_key_C"
            },
            "page_sort": {
              "type": "string",
              "const": "gap_desc_then_window_impressions_desc_then_exact_key_C"
            }
          },
          "required": [
            "version",
            "position_min",
            "position_max",
            "position_basis",
            "recent_days",
            "basis_days",
            "basis_formula",
            "position_bands",
            "peer_scope",
            "query_rule",
            "page_rule",
            "query_sort",
            "page_sort"
          ],
          "additionalProperties": false
        },
        "sections": {
          "type": "object",
          "properties": {
            "queries": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "ok_with_warnings",
                    "insufficient_data",
                    "incompatible_aggregation",
                    "scan_budget_exceeded"
                  ]
                },
                "coverage": {
                  "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_days": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "missing_ranges": {
                      "maxItems": 60,
                      "type": "array",
                      "items": {
                        "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
                      }
                    },
                    "missing_ranges_truncated": {
                      "type": "boolean"
                    },
                    "aggregation": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "byPage",
                            "byProperty"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "expected_days",
                    "complete_days",
                    "empty_days",
                    "missing_days",
                    "missing_ranges",
                    "missing_ranges_truncated",
                    "aggregation",
                    "truncated"
                  ],
                  "additionalProperties": false
                },
                "aggregation": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "byPage",
                        "byProperty"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "thresholds": {
                  "type": "object",
                  "properties": {
                    "threshold_mode": {
                      "type": "string",
                      "enum": [
                        "scaled",
                        "fixed"
                      ]
                    },
                    "min_impressions": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000000
                    },
                    "peer_min_count": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000
                    },
                    "peer_min_impressions": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100000000
                    },
                    "ctr_max_ratio": {
                      "type": "number",
                      "minimum": 0.05,
                      "maximum": 0.95
                    },
                    "overridden": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "min_impressions",
                          "peer_min_count",
                          "peer_min_impressions",
                          "ctr_max_ratio"
                        ]
                      }
                    },
                    "scaling_basis": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "window_impressions": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "window_days": {
                              "type": "integer",
                              "minimum": 28,
                              "maximum": 365
                            },
                            "normalized_28_day_impressions": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "window_impressions",
                            "window_days",
                            "normalized_28_day_impressions"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "threshold_mode",
                    "min_impressions",
                    "peer_min_count",
                    "peer_min_impressions",
                    "ctr_max_ratio",
                    "overridden",
                    "scaling_basis"
                  ],
                  "additionalProperties": false
                },
                "total_candidates": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "returned_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "omitted_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "byte_limited": {
                  "type": "boolean"
                },
                "max_days_within_budget": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 365
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "items": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "window": {
                        "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
                      },
                      "recent": {
                        "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
                      }
                    },
                    "required": [
                      "key",
                      "window",
                      "recent"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "status",
                "coverage",
                "aggregation",
                "thresholds",
                "total_candidates",
                "returned_count",
                "omitted_count",
                "byte_limited",
                "max_days_within_budget",
                "items"
              ],
              "additionalProperties": false
            },
            "pages": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "ok_with_warnings",
                    "insufficient_data",
                    "incompatible_aggregation",
                    "scan_budget_exceeded"
                  ]
                },
                "coverage": {
                  "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_days": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "missing_ranges": {
                      "maxItems": 60,
                      "type": "array",
                      "items": {
                        "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
                      }
                    },
                    "missing_ranges_truncated": {
                      "type": "boolean"
                    },
                    "aggregation": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "byPage",
                            "byProperty"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "expected_days",
                    "complete_days",
                    "empty_days",
                    "missing_days",
                    "missing_ranges",
                    "missing_ranges_truncated",
                    "aggregation",
                    "truncated"
                  ],
                  "additionalProperties": false
                },
                "aggregation": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "byPage",
                        "byProperty"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "thresholds": {
                  "type": "object",
                  "properties": {
                    "threshold_mode": {
                      "type": "string",
                      "enum": [
                        "scaled",
                        "fixed"
                      ]
                    },
                    "min_impressions": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000000
                    },
                    "peer_min_count": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000
                    },
                    "peer_min_impressions": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100000000
                    },
                    "ctr_max_ratio": {
                      "type": "number",
                      "minimum": 0.05,
                      "maximum": 0.95
                    },
                    "overridden": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "min_impressions",
                          "peer_min_count",
                          "peer_min_impressions",
                          "ctr_max_ratio"
                        ]
                      }
                    },
                    "scaling_basis": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "window_impressions": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "window_days": {
                              "type": "integer",
                              "minimum": 28,
                              "maximum": 365
                            },
                            "normalized_28_day_impressions": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "window_impressions",
                            "window_days",
                            "normalized_28_day_impressions"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "threshold_mode",
                    "min_impressions",
                    "peer_min_count",
                    "peer_min_impressions",
                    "ctr_max_ratio",
                    "overridden",
                    "scaling_basis"
                  ],
                  "additionalProperties": false
                },
                "total_candidates": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "returned_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "omitted_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "byte_limited": {
                  "type": "boolean"
                },
                "max_days_within_budget": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 365
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "items": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "window": {
                        "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
                      },
                      "band": {
                        "type": "array",
                        "items": [
                          {
                            "type": "number"
                          },
                          {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        ],
                        "additionalItems": false,
                        "minItems": 2,
                        "maxItems": 2
                      },
                      "peer_count": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "peer_impressions": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "peer_clicks": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "peer_ctr": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "gap_percentage_points": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "key",
                      "window",
                      "band",
                      "peer_count",
                      "peer_impressions",
                      "peer_clicks",
                      "peer_ctr",
                      "gap_percentage_points"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "status",
                "coverage",
                "aggregation",
                "thresholds",
                "total_candidates",
                "returned_count",
                "omitted_count",
                "byte_limited",
                "max_days_within_budget",
                "items"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "source_manifest": {
          "type": "object",
          "properties": {
            "query": {
              "type": "object",
              "properties": {
                "header_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "digest": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "by_source": {
                  "type": "object",
                  "properties": {
                    "performance": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "history": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "none": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "performance",
                    "history",
                    "none"
                  ],
                  "additionalProperties": false
                },
                "refreshing_days": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "truncated_days": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "header_count",
                "digest",
                "by_source",
                "refreshing_days",
                "truncated_days"
              ],
              "additionalProperties": false
            },
            "page": {
              "type": "object",
              "properties": {
                "header_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "digest": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "by_source": {
                  "type": "object",
                  "properties": {
                    "performance": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "history": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "none": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "performance",
                    "history",
                    "none"
                  ],
                  "additionalProperties": false
                },
                "refreshing_days": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "truncated_days": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "header_count",
                "digest",
                "by_source",
                "refreshing_days",
                "truncated_days"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "scan_policy": {
          "type": "object",
          "properties": {
            "section_row_budget": {
              "type": "number",
              "const": 1000000
            },
            "statement_timeout_ms": {
              "type": "number",
              "const": 5000
            }
          },
          "required": [
            "section_row_budget",
            "statement_timeout_ms"
          ],
          "additionalProperties": false
        },
        "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._:-]+$"
          }
        }
      },
      "required": [
        "kind",
        "schema_version",
        "analysis_version",
        "policy_version",
        "property_id",
        "source",
        "requested_days",
        "requested_limit",
        "range",
        "recent_range",
        "policy",
        "sections",
        "source_manifest",
        "scan_policy",
        "warnings",
        "evidence_ids"
      ],
      "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