{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/irmu-com/json-schema/irmu-com-google-ai-overview-result-schema.json",
  "title": "GoogleAiOverviewResult",
  "description": "What `/google-ai-overview` answers. `ai_overview` is null while it is\nstill running and when Google showed none; `status` tells those apart.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/irmu-com-google-api-openapi.yml#/components/schemas/GoogleAiOverviewResult",
  "type": "object",
  "required": [
    "query",
    "domain",
    "url",
    "ai_overview",
    "sources",
    "credits_charged",
    "credits_remaining",
    "job_id",
    "status",
    "debug"
  ],
  "properties": {
    "query": {
      "type": "string",
      "description": "The search, as it was asked."
    },
    "domain": {
      "type": "string",
      "description": "The extension of the Google that was asked, lowercased."
    },
    "url": {
      "type": "string",
      "description": "The results page the crawl was run against."
    },
    "ai_overview": {
      "type": [
        "string",
        "null"
      ],
      "description": "The overview's answer as text, without its heading or Google's standing notice."
    },
    "sources": {
      "type": "array",
      "description": "The pages the overview cites. Empty when it cites none.",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "credits_charged": {
      "type": "integer"
    },
    "credits_remaining": {
      "type": "integer"
    },
    "job_id": {
      "type": "string",
      "description": "What this ran under. Collect a `202` from `/crawl/{job}` with it."
    },
    "status": {
      "type": "string",
      "enum": [
        "done",
        "queued",
        "running",
        "failed"
      ]
    },
    "position": {
      "type": [
        "integer",
        "null"
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "debug": {
      "oneOf": [
        {
          "$ref": "#/$defs/CrawlSnapshot"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "CrawlSnapshot": {
      "type": "object",
      "description": "Where a crawl had got to, for one that is still running or failed. Only\nsent when the request carries `debuga=1`.\n\nThe crawler stops waiting long before it stops working, and when it stops\nwaiting it looks at the tab: the url the browser is on, a picture of what\nis on screen, and the page source as it stands. That is what this is --\na diagnosis for a request that timed out, not a result. Nothing is\ncharged for it.\n\nNull on anything that is not still running. A finished or failed crawl has\nno tab left to look at, and a crawl still in the queue has not opened one\nyet.\n\nTwo things to know when reading one. The image is the **viewport**, not\nthe whole page, so it is not the picture `/screenshot` sells -- it is a\nthumbnail at quality 60, meant to be looked at rather than kept. And\neither artefact may be missing: they are captured independently, because a\nnavigation can destroy one without touching the other, so half a snapshot\nis ordinary. The missing half reads as null rather than going absent.\n\nA blank image beside a near-empty `html` is not a broken capture -- it\nmeans the crawl stalled *inside* a navigation, with the old document\nalready replaced. That is itself the answer.\n",
      "required": [
        "url",
        "screenshot",
        "html"
      ],
      "properties": {
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The url the tab was on, which a redirect may have moved away from the\none you asked for.\n"
        },
        "screenshot": {
          "type": [
            "string",
            "null"
          ],
          "format": "byte",
          "description": "A base64 JPEG of the viewport, with no `data:` prefix -- decode it as\nit stands. Null when the capture raced a navigation and lost.\n"
        },
        "html": {
          "type": [
            "string",
            "null"
          ],
          "description": "The page source at that moment, half-loaded and all. Null when the\ncapture raced a navigation and lost.\n"
        }
      }
    }
  }
}