{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Insider Trades — 84K+ Director & Board Movements",
    "description": "All CVM Form 358 insider filings (84K+, 2003-2026), with parsed transactions by group (Controller, Board, Officers) + director names from FRE. Brazil's SEC Form 4 as API. Todas as declarações 358 da CVM (84K+, 2003-2026), parseadas por grupo (Controlador, Conselho, Diretoria) + nomes do FRE.",
    "version": "2.0",
    "x-build-id": "SbhdYf9GXuv9i2cz0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jenko_systems~cvm-insider-358/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jenko_systems-cvm-insider-358",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/jenko_systems~cvm-insider-358/runs": {
      "post": {
        "operationId": "runs-sync-jenko_systems-cvm-insider-358",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/jenko_systems~cvm-insider-358/run-sync": {
      "post": {
        "operationId": "run-sync-jenko_systems-cvm-insider-358",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Modo de consulta",
            "enum": [
              "recent",
              "empresa",
              "busca",
              "alerts",
              "ranking",
              "setor",
              "estatisticas",
              "administradores"
            ],
            "type": "string",
            "description": "Tipo de consulta a executar.",
            "default": "recent"
          },
          "days": {
            "title": "Período em dias",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Quantos dias atrás considerar (para recent, alerts, ranking, setor, estatisticas).",
            "default": 30
          },
          "empresa": {
            "title": "Nome da empresa",
            "type": "string",
            "description": "Nome parcial ou completo. Ex: Petrobras, Vale, Itaú, Ambev."
          },
          "cnpj": {
            "title": "CNPJ",
            "type": "string",
            "description": "CNPJ da companhia (formato: 33.000.167/0001-01)."
          },
          "ticker": {
            "title": "Ticker B3",
            "type": "string",
            "description": "Código de negociação na B3 (ex: PETR4, VALE3, ITUB4). Cobertura: ~175 empresas principais."
          },
          "busca": {
            "title": "Termo de busca",
            "type": "string",
            "description": "Busca por nome parcial de empresa. Ex: Banco, Energia, Construção."
          },
          "min_value_brl": {
            "title": "Valor mínimo (BRL) — modo alerts",
            "minimum": 1000,
            "type": "integer",
            "description": "Filtra movimentações com volume mínimo em reais.",
            "default": 1000000
          },
          "operacao": {
            "title": "Tipo de operação — modo alerts",
            "enum": [
              "all",
              "COMPRA",
              "VENDA",
              "SUBSCRICAO"
            ],
            "type": "string",
            "description": "Filtra por tipo: COMPRA, VENDA, SUBSCRICAO, ou 'all'.",
            "default": "all"
          },
          "grupo": {
            "title": "Grupo — modo alerts",
            "enum": [
              "all",
              "Controlador",
              "Conselho de Administração",
              "Diretoria",
              "Conselho Fiscal",
              "Órgãos Técnicos",
              "Tesouraria"
            ],
            "type": "string",
            "description": "Filtra por grupo de pessoas ligadas.",
            "default": "all"
          },
          "tipo_ranking": {
            "title": "Tipo de ranking — modo ranking",
            "enum": [
              "maiores_compradores",
              "maiores_vendedores",
              "mais_ativos",
              "maior_filing_count",
              "strongest_buy_signals",
              "strongest_sell_signals"
            ],
            "type": "string",
            "description": "Qual ranking gerar.",
            "default": "maiores_vendedores"
          },
          "top_n": {
            "title": "Top N — modo ranking",
            "minimum": 5,
            "maximum": 100,
            "type": "integer",
            "description": "Quantos resultados retornar no ranking.",
            "default": 20
          },
          "setor_filter": {
            "title": "Setor — modo setor",
            "type": "string",
            "description": "Filtra por setor específico (parcial). Ex: Bancos, Energia, Mineração."
          },
          "include_movimentacoes": {
            "title": "Incluir movimentações",
            "type": "boolean",
            "description": "Para recent/empresa: inclui movimentações parseadas com signal score.",
            "default": true
          },
          "include_administradores": {
            "title": "Incluir administradores (FRE)",
            "type": "boolean",
            "description": "Para modo empresa: cruza com FRE e mostra membros do grupo (nomes/CPFs/cargos) — útil pra identificar quem possivelmente está por trás das movimentações.",
            "default": false
          },
          "nome_pessoa": {
            "title": "Nome da pessoa — modo administradores",
            "type": "string",
            "description": "Busca por nome parcial de administrador/conselheiro. Ex: 'Roberto Setúbal', 'Magda Chambriard'."
          },
          "ano_min": {
            "title": "Ano mínimo — modo administradores",
            "minimum": 0,
            "maximum": 2050,
            "type": "integer",
            "description": "Filtra registros do FRE a partir desse ano. Default: todos.",
            "default": 0
          },
          "max_resultados": {
            "title": "Máximo de resultados",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Número máximo de registros retornados.",
            "default": 100
          },
          "auto_parse_recent": {
            "title": "Auto-parse recentes (Apify)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Quantos PDFs recentes parsear ANTES de responder. Útil pra schedule runs (mantém base atualizada). Default: 0 (não parseia).",
            "default": 0
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}