{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatapi/json-schema/beatapi-web-search-response-schema.json",
  "title": "WebSearchResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatapi-web-search-api-openapi.yml#/components/schemas/WebSearchResponse",
  "type": "object",
  "required": [
    "object",
    "request_id",
    "query",
    "type",
    "results"
  ],
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "web.search"
      ]
    },
    "request_id": {
      "type": "string",
      "description": "Quote it in support requests."
    },
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "web",
        "news",
        "images",
        "videos",
        "scholar",
        "patents",
        "shopping",
        "places"
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebSearchResult"
      }
    },
    "answer_box": {
      "type": "object",
      "additionalProperties": true,
      "description": "A direct answer, present only when the search produced one.",
      "properties": {
        "title": {
          "type": "string"
        },
        "snippet": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "related_searches": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Related queries, present only when available."
    },
    "usage": {
      "$ref": "#/$defs/WebCallUsage"
    }
  },
  "$defs": {
    "WebCallUsage": {
      "type": "object",
      "description": "What this call was charged, in US dollars. The same object a social-data call answers with.",
      "required": [
        "billing_unit",
        "quantity",
        "price_usd",
        "price_version"
      ],
      "properties": {
        "billing_unit": {
          "type": "string",
          "enum": [
            "request",
            "page"
          ],
          "description": "request for search and research; page for read (pages read) and map (URLs returned)."
        },
        "quantity": {
          "type": "integer",
          "description": "How many units the reply shows were billed."
        },
        "price_usd": {
          "type": "string",
          "description": "The settled charge for this call",
          "in US dollars.": null
        },
        "price_version": {
          "type": "string",
          "description": "Fingerprint of the price this call was charged at."
        }
      }
    },
    "WebSearchResult": {
      "type": "object",
      "required": [
        "position",
        "title"
      ],
      "additionalProperties": true,
      "description": "One search result. Every type returns `position` and `title`; `places` results\nhave no `url` and `news` results have no `snippet`. Fields added per type:\n`news` — `source`, `published_at`, `image_url`;\n`images` — `image_url`, `thumbnail_url`, `width`, `height`, `source`;\n`videos` — `source`, `duration`, `published_at`, `image_url`;\n`scholar` — `publication_info`, `year`, `cited_by`, `pdf_url`;\n`patents` — `publication_number`, `priority_date`, `filing_date`, `grant_date`, `published_at`, `inventor`, `assignee`, `pdf_url`;\n`shopping` — `source`, `price`, `rating`, `rating_count`, `image_url`;\n`places` — `address`, `latitude`, `longitude`, `rating`, `rating_count`, `category`, `phone`, `website`.\n",
      "properties": {
        "position": {
          "type": "integer",
          "minimum": 1,
          "description": "1-based rank within this response."
        },
        "title": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "description": "Result page. Absent for `places`."
        },
        "snippet": {
          "type": "string",
          "description": "Short excerpt. Absent for `news`."
        },
        "published_at": {
          "type": "string",
          "description": "Publication date as the source reports it",
          "when known.": null
        }
      }
    }
  }
}