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

# Get query statistics



## OpenAPI

````yaml /api-reference/openapi.json get /v2/queries/stats
openapi: 3.1.0
info:
  title: Base39 API
  description: Base39 API
  version: 1.0.0
  contact:
    name: Base39 Team
    url: https://base39.com.br
    email: suporte@base39.com.br
  termsOfService: https://base39.com.br/termos
  license:
    name: Proprietary
    url: https://base39.com.br/termos
servers:
  - url: http://localhost:3000
    description: Local
  - url: https://api.dev.base39.cloud
    description: Development
  - url: https://api.base39.com.br
    description: Production
security:
  - OAuth2: []
tags:
  - name: pages
    description: Profiles and reports pages
  - name: pipelines
    description: Pipeline boards (kanban) of pages
  - name: blocks
    description: Blocks operations
  - name: search
    description: Search across content
  - name: targets
    description: Lookup targets via datasets
  - name: CognitoTriggers
    description: Cognito triggers
paths:
  /v2/queries/stats:
    get:
      tags:
        - queries
      summary: Get query statistics
      operationId: query_get_stats
      parameters: []
      responses:
        '200':
          description: Query statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryStats'
components:
  schemas:
    QueryStats:
      type: object
      properties:
        object:
          type: string
          description: Object type identifier
          example: query_stats
          enum:
            - query_stats
        today:
          description: Estatísticas do dia atual
          allOf:
            - $ref: '#/components/schemas/PeriodStats'
        currentMonth:
          description: Estatísticas do mês atual
          allOf:
            - $ref: '#/components/schemas/PeriodStats'
        last90Days:
          description: Estatísticas dos últimos 90 dias
          allOf:
            - $ref: '#/components/schemas/PeriodStats'
        byDay:
          description: Estatísticas por dia (últimos 90 dias)
          type: array
          items:
            $ref: '#/components/schemas/DayStats'
        cacheHitRate:
          type: number
          description: Taxa de cache hit em porcentagem (0-100)
          example: 32.5
      required:
        - object
        - today
        - currentMonth
        - last90Days
        - byDay
        - cacheHitRate
    PeriodStats:
      type: object
      properties:
        total:
          type: number
          description: Total de consultas no período
          example: 150
        cached:
          type: number
          description: Total de consultas em cache (hit)
          example: 45
      required:
        - total
        - cached
    DayStats:
      type: object
      properties:
        date:
          type: string
          description: Data no formato YYYY-MM-DD
          example: '2025-12-07'
        total:
          type: number
          description: Total de consultas no dia
          example: 25
        cached:
          type: number
          description: Total de consultas em cache (hit)
          example: 8
      required:
        - date
        - total
        - cached
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://id.local.base39.cloud/oauth2/authorize
          tokenUrl: https://id.local.base39.cloud/oauth2/token
          scopes:
            profile: Read user profile
            email: Read user email
            openid: OpenID authentication
      description: OAuth2 Authorization Code flow

````