> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dados.rio/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Search Endpoint



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/app-eai-agent-surkai/refs/heads/staging/docs/swagger/swagger.json post /api/v1/web_search
openapi: 3.1.0
info:
  title: Web Search Tool API
  description: API para ferramentas de busca web e agentes inteligentes
  version: 0.1.0
  contact:
    name: Equipe de Desenvolvimento
    email: dev@exemplo.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://services.staging.app.dados.rio/eai-agent-surkai/
    description: Staging
security:
  - bearerAuth: []
paths:
  /api/v1/web_search:
    post:
      tags:
        - web_search
      summary: Web Search Endpoint
      operationId: web_search_endpoint_api_v1_web_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebSearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WebSearchRequest:
      properties:
        query:
          type: string
          title: Query
          description: Pergunta ou termos de busca.
        k:
          type: integer
          maximum: 20
          minimum: 1
          title: K
          description: Número máximo de resultados iniciais.
          default: 6
        lang:
          type: string
          title: Lang
          description: Idioma preferido para resultados e summary.
          default: pt-BR
        freshness_days:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Freshness Days
          description: Restringe busca a conteúdos recentes (opcional).
      type: object
      required:
        - query
      title: WebSearchRequest
      description: Schema da requisição para /web_search.
    WebSearchResponse:
      properties:
        summary:
          type: string
          title: Summary
          description: Resumo objetivo que responde à query.
        sources:
          items:
            type: string
            maxLength: 2083
            minLength: 1
            format: uri
          type: array
          maxItems: 8
          minItems: 0
          title: Sources
          description: Lista de URLs citadas na resposta.
      type: object
      required:
        - summary
        - sources
      title: WebSearchResponse
      description: Schema da resposta retornada pela rota /web_search.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````