{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Elections — TSE Candidatos e Bens (1994–2024)",
    "description": "Histórico eleitoral do Brasil de 1994 a 2024. 2,9M candidatos, 5M registros de bens, 16 eleições. Consulte por nome, partido, município, estado ou ranking.\n\n\nBrazilian electoral history from 1994 to 2024. Query by name, party, municipality, state or ranking.",
    "version": "2.0",
    "x-build-id": "MMBIcfnXq2yj7YqS5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jenko_systems~brazil-elections-tse/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jenko_systems-brazil-elections-tse",
        "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~brazil-elections-tse/runs": {
      "post": {
        "operationId": "runs-sync-jenko_systems-brazil-elections-tse",
        "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~brazil-elections-tse/run-sync": {
      "post": {
        "operationId": "run-sync-jenko_systems-brazil-elections-tse",
        "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",
        "properties": {
          "mode": {
            "title": "Modo",
            "enum": [
              "candidato",
              "partido",
              "municipio",
              "estado",
              "bens",
              "ranking",
              "estatisticas",
              "evolucao_patrimonial"
            ],
            "type": "string",
            "description": "Tipo de consulta. Campos vazios recebem um exemplo tirado dos dados (indicado em 'defaults_used'). Campos de cada modo:\n• candidato / bens / evolucao_patrimonial: nome (vazio = o eleito com maior patrimônio do ano)\n• partido: partido (vazio = o que mais elegeu no ano)\n• municipio: município (vazio = o com mais candidatos; filtra pela UF se informada)\n• estado: UF (vazio = SP)\n• ranking / estatisticas: filtros opcionais",
            "default": "ranking"
          },
          "ano": {
            "title": "Ano da eleição",
            "minimum": 1994,
            "maximum": 2026,
            "type": "integer",
            "description": "Anos pares de 1994 a 2026. Vazio = última eleição (no modo município, a última municipal; no modo candidato, todas)."
          },
          "nome": {
            "title": "Nome do candidato",
            "type": "string",
            "description": "Nome completo ou parte (ex.: Lula, Tarcísio, Maria Silva). Acentos são ignorados."
          },
          "partido": {
            "title": "Partido (sigla)",
            "type": "string",
            "description": "Ex.: PT, PL, MDB, PSD, NOVO, UNIÃO."
          },
          "municipio": {
            "title": "Município",
            "type": "string",
            "description": "Ex.: São Paulo, Piracicaba. Use junto com a UF se o nome se repetir."
          },
          "uf": {
            "title": "UF",
            "type": "string",
            "description": "Sigla do estado (SP, MG...). BR = presidente."
          },
          "cargo": {
            "title": "Cargo",
            "type": "string",
            "description": "Ex.: PREFEITO, VEREADOR, GOVERNADOR, SENADOR, DEPUTADO FEDERAL, PRESIDENTE."
          },
          "situacao": {
            "title": "Resultado",
            "type": "string",
            "description": "ELEITO (inclui eleitos por QP e por média), NÃO ELEITO, SUPLENTE ou 2º TURNO."
          },
          "sq_candidato": {
            "title": "Código do candidato (SQ_CANDIDATO)",
            "type": "string",
            "description": "Código do TSE. Use junto com o ano."
          },
          "tipo_ranking": {
            "title": "Tipo de ranking",
            "enum": [
              "mais_ricos",
              "eleitos_por_partido",
              "candidatos_por_partido",
              "maior_crescimento_patrimonial"
            ],
            "type": "string",
            "description": "Usado no modo ranking.",
            "default": "mais_ricos"
          },
          "incluir_suspeitos": {
            "title": "Incluir valores suspeitos",
            "type": "boolean",
            "description": "Por padrão os rankings de patrimônio ignoram declarações com prováveis erros de digitação (ex.: um bem de R$ 10 bi de vereador).",
            "default": false
          },
          "top_n": {
            "title": "Top N (rankings)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Quantas posições trazer nos rankings.",
            "default": 20
          },
          "max_resultados": {
            "title": "Máximo de resultados (listas)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Limite de candidatos nos modos de lista.",
            "default": 100
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}