{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/octen-ai/json-schema/octen-ai-broad-search-response-schema.json",
  "title": "BroadSearchResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/octen-ai-broad-search-api-openapi.yml#/components/schemas/BroadSearchResponse",
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "description": "Business status code. 0 indicates success."
    },
    "request_id": {
      "type": "string",
      "description": "The unique identifier for this request."
    },
    "data": {
      "$ref": "#/$defs/BroadSearchData"
    },
    "meta": {
      "$ref": "#/$defs/SearchMeta"
    }
  },
  "$defs": {
    "BroadSearchData": {
      "type": "object",
      "description": "The main response payload.",
      "properties": {
        "query": {
          "type": "string",
          "description": "The original query."
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Sub-queries generated from the query."
        },
        "search_results": {
          "type": "array",
          "description": "Results are grouped by sub-query and are not de-duplicated across groups.",
          "items": {
            "$ref": "#/$defs/SearchResultGroup"
          }
        }
      }
    },
    "SearchMeta": {
      "type": "object",
      "description": "Additional metadata for the search request.",
      "properties": {
        "usage": {
          "$ref": "#/$defs/SearchUsage"
        },
        "latency": {
          "type": "number",
          "description": "Response time in milliseconds."
        },
        "warning": {
          "type": [
            "string",
            "null"
          ],
          "description": "Warning message, if any."
        }
      }
    },
    "SearchResult": {
      "type": "object",
      "description": "A single search result.",
      "properties": {
        "title": {
          "type": "string",
          "description": "The title of the result page."
        },
        "url": {
          "type": "string",
          "description": "The URL of the result page."
        },
        "highlight": {
          "type": "string",
          "description": "Query-relevant highlight snippets. Returned only if highlight.enable is true."
        },
        "full_content": {
          "type": "string",
          "description": "Full raw page content. Returned only if full_content.enable is true."
        },
        "authors": {
          "type": "string",
          "description": "Website name or author."
        },
        "time_published": {
          "type": "string",
          "format": "date-time",
          "description": "Publish time in ISO 8601."
        },
        "time_last_crawled": {
          "type": "string",
          "format": "date-time",
          "description": "Last crawl time in ISO 8601."
        },
        "favicon": {
          "type": "string",
          "description": "The favicon URL of the result site."
        },
        "cover_image": {
          "type": "object",
          "description": "The page cover image. Returned only when `include_images` is true and the page has a cover image.",
          "properties": {
            "url": {
              "type": "string",
              "description": "The cover image URL."
            },
            "description": {
              "type": "string",
              "description": "Text description of the cover image."
            }
          }
        },
        "images": {
          "type": "array",
          "description": "In-body images of the page, in order of appearance. Returned only when `include_images` is true.",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "The image URL."
              },
              "description": {
                "type": "string",
                "description": "Text description of the image."
              }
            }
          }
        }
      }
    },
    "SearchResultGroup": {
      "type": "object",
      "description": "A group of search results for a single sub-query.",
      "properties": {
        "query": {
          "type": "string",
          "description": "The sub-query that produced these results."
        },
        "results": {
          "type": "array",
          "description": "The search results for this sub-query.",
          "items": {
            "$ref": "#/$defs/SearchResult"
          }
        },
        "latency": {
          "type": "integer",
          "description": "Search latency for this query in milliseconds."
        }
      }
    },
    "SearchUsage": {
      "type": "object",
      "description": "Usage information for the search request.",
      "properties": {
        "num_search_queries": {
          "type": "integer",
          "description": "Number of search queries executed."
        },
        "full_content_extra_count": {
          "type": "integer",
          "description": "Billable full_content results beyond the free allowance."
        }
      }
    }
  }
}