{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatapi/json-schema/beatapi-web-search-request-schema.json",
  "title": "WebSearchRequest",
  "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/WebSearchRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 400,
      "pattern": "\\S",
      "description": "Search query. Surrounding whitespace is trimmed before the length check."
    },
    "type": {
      "type": "string",
      "enum": [
        "web",
        "news",
        "images",
        "videos",
        "scholar",
        "patents",
        "shopping",
        "places"
      ],
      "default": "web",
      "description": "Result type. Each type adds its own fields to every result."
    },
    "max_results": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "default": 5,
      "description": "Number of results to return."
    },
    "time_range": {
      "type": "string",
      "enum": [
        "day",
        "week",
        "month",
        "year"
      ],
      "description": "Only results from this period. Only for `web`, `news`, `images` and `videos`."
    },
    "include_domains": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "string",
        "minLength": 1
      },
      "description": "Only return results from these domains. Only for `web`, `news`, `images` and `videos`."
    },
    "exclude_domains": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "string",
        "minLength": 1
      },
      "description": "Leave out results from these domains. Only for `web`, `news`, `images` and `videos`."
    },
    "country": {
      "type": "string",
      "pattern": "^[a-z]{2}$",
      "description": "ISO 3166-1 alpha-2 country code in lowercase, such as `us` or `cn`. With `country` and `language` both left out, a query written in Chinese, Japanese or Korean searches in that language and region."
    },
    "language": {
      "type": "string",
      "pattern": "^[a-z]{2}$",
      "description": "Two-letter language code, such as `en` or `zh`."
    }
  }
}