# Brazil Elections — TSE Candidatos e Bens (1994–2024) (`jenko_systems/brazil-elections-tse`) Actor

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.

Brazilian electoral history from 1994 to 2024. Query by name, party, municipality, state or ranking.

- **URL**: https://apify.com/jenko\_systems/brazil-elections-tse.md
- **Developed by:** [Jenko Systems](https://apify.com/jenko_systems) (community)
- **Categories:** News, Automation, Integrations
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Brazil Elections — TSE Candidates & Assets (1994–2024) | Candidatos e Bens TSE

---

### 🇺🇸 English

The most complete Brazilian electoral database available as an API. **2.9 million candidates** and **5 million asset records** across **16 elections from 1994 to 2024** — all in one actor.

#### What you get

- **2,920,211 candidates** across all Brazilian elections from 1994 to 2024
- **5,023,354 asset records** with declared patrimony per candidate (2006–2024)
- **Full profile**: name, party, office, municipality, state, gender, education, ethnicity, occupation
- **Election results**: elected, runner-up, substitute, not elected
- **R$ 698 billion** in declared assets mapped across all elections

#### Query modes

**`candidato` — Search by name**
```json
{ "mode": "candidato", "nome": "Bolsonaro", "ano": 2022 }
````

**`partido` — All candidates from a party**

```json
{ "mode": "partido", "partido": "PT", "ano": 2024, "uf": "SP", "cargo": "PREFEITO" }
```

**`municipio` — Candidates from a city**

```json
{ "mode": "municipio", "municipio": "São Paulo", "ano": 2024, "cargo": "VEREADOR" }
```

**`estado` — Candidates from a state**

```json
{ "mode": "estado", "uf": "MG", "ano": 2022, "situacao": "ELEITO" }
```

**`bens` — Declared assets of a candidate**

```json
{ "mode": "bens", "nome": "Cresio Vieira Campos", "ano": 2024 }
```

**`ranking` — Top candidates by patrimony or party performance**

```json
{ "mode": "ranking", "tipo_ranking": "mais_ricos", "ano": 2024, "top_n": 20 }
```

```json
{ "mode": "ranking", "tipo_ranking": "eleitos_por_partido", "ano": 2024, "uf": "SP" }
```

**`estatisticas` — Electoral summary**

```json
{ "mode": "estatisticas", "ano": 2024, "uf": "RJ", "cargo": "VEREADOR" }
```

#### Use cases

- **Journalism & investigations**: track politicians' declared wealth across elections
- **Academic research**: 30 years of Brazilian electoral data in one query
- **Political analysis**: party performance, candidate profiles, electoral trends
- **Compliance & due diligence**: verify if a person ran for office and their declared assets
- **Data journalism**: who are the richest candidates? Which party elects the most?

#### Data highlights (2024)

| Rank | Candidate | City | Declared Assets |
|------|-----------|------|-----------------|
| 1 | Cresio Vieira Campos (PL) | Ipatinga/MG | R$ 12.1 billion |
| 2 | João Henrique Pinheiro (PRTB) | Marília/SP | R$ 2.8 billion |
| 3 | Eronildes Torres Neto (PRD) | Anapu/PA | R$ 2.4 billion |

Top parties by candidates in 2024: MDB (44,541), PP (39,948), PSD (38,956), UNIÃO (36,635), PL (36,089)

#### Coverage

| Years | Election type | Candidates |
|-------|--------------|------------|
| 1994, 1998, 2002, 2006, 2010, 2014, 2018, 2022 | General (federal + state) | ~20k each |
| 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024 | Municipal | ~400–560k each |

#### Data source

Official data from [Portal de Dados Abertos do TSE](https://dadosabertos.tse.jus.br) — Brazil's Superior Electoral Court. Updated after each election cycle.

***

### 🇧🇷 Português

O banco de dados eleitoral brasileiro mais completo disponível como API. **2,9 milhões de candidatos** e **5 milhões de registros de bens** em **16 eleições de 1994 a 2024** — tudo em um único actor.

#### O que você recebe

- **2.920.211 candidatos** em todas as eleições brasileiras de 1994 a 2024
- **5.023.354 registros de bens** com patrimônio declarado por candidato (2006–2024)
- **Perfil completo**: nome, partido, cargo, município, estado, gênero, instrução, raça, ocupação
- **Resultados eleitorais**: eleito, suplente, não eleito
- **R$ 698 bilhões** em patrimônio declarado mapeados em todas as eleições

#### Modos de consulta

**`candidato` — Busca por nome**

```json
{ "mode": "candidato", "nome": "Lula", "ano": 2022 }
```

**`partido` — Candidatos de um partido**

```json
{ "mode": "partido", "partido": "PT", "ano": 2024, "uf": "SP", "cargo": "PREFEITO" }
```

**`municipio` — Candidatos de uma cidade**

```json
{ "mode": "municipio", "municipio": "São Paulo", "ano": 2024 }
```

**`estado` — Candidatos de um estado**

```json
{ "mode": "estado", "uf": "MG", "ano": 2022, "situacao": "ELEITO" }
```

**`bens` — Bens declarados de um candidato**

```json
{ "mode": "bens", "nome": "Cresio Vieira Campos", "ano": 2024 }
```

**`ranking` — Rankings**

```json
{ "mode": "ranking", "tipo_ranking": "mais_ricos", "ano": 2024, "top_n": 20 }
```

**`estatisticas` — Resumo eleitoral**

```json
{ "mode": "estatisticas", "ano": 2024, "uf": "SP" }
```

#### Casos de uso

- **Jornalismo investigativo**: rastrear patrimônio de políticos ao longo das eleições
- **Pesquisa acadêmica**: 30 anos de dados eleitorais brasileiros em uma consulta
- **Análise política**: desempenho de partidos, perfil de candidatos, tendências eleitorais
- **Compliance e due diligence**: verificar se uma pessoa concorreu a cargo público e seu patrimônio declarado
- **Data journalism**: quem são os candidatos mais ricos? Qual partido elege mais?

#### Fonte dos dados

Dados oficiais do [Portal de Dados Abertos do TSE](https://dadosabertos.tse.jus.br) — Tribunal Superior Eleitoral. Atualizados após cada ciclo eleitoral.

# Actor input Schema

## `mode` (type: `string`):

Choose the query mode. Each mode returns different data about Brazilian elections.

## `ano` (type: `integer`):

Election year. Municipal: 1996,2000,2004,2008,2012,2016,2020,2024. General: 1994,1998,2002,2006,2010,2014,2018,2022.

## `nome` (type: `string`):

Partial name search. Ex: Lula, Bolsonaro, Maria Silva.

## `partido` (type: `string`):

Ex: PT, PL, MDB, PSDB, PP, PSD, UNIÃO.

## `municipio` (type: `string`):

Partial name search. Ex: São Paulo, Campinas, Fortaleza.

## `uf` (type: `string`):

Ex: SP, MG, RJ, BA, RS, PR.

## `cargo` (type: `string`):

Ex: PREFEITO, VEREADOR, GOVERNADOR, SENADOR, DEPUTADO FEDERAL.

## `situacao` (type: `string`):

Ex: ELEITO, NÃO ELEITO, SUPLENTE.

## `tipo_ranking` (type: `string`):

Type of ranking to generate.

## `top_n` (type: `integer`):

Number of results to return in ranking mode.

## `max_resultados` (type: `integer`):

Maximum number of results to return.

## Actor input object example

```json
{
  "mode": "ranking",
  "ano": 2024,
  "tipo_ranking": "mais_ricos",
  "top_n": 20,
  "max_resultados": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jenko_systems/brazil-elections-tse").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("jenko_systems/brazil-elections-tse").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call jenko_systems/brazil-elections-tse --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jenko_systems/brazil-elections-tse",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "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": "1.0",
        "x-build-id": "aYbzlxYvPhxLOtuNP"
    },
    "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",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Query mode",
                        "enum": [
                            "candidato",
                            "partido",
                            "municipio",
                            "estado",
                            "bens",
                            "ranking",
                            "estatisticas"
                        ],
                        "type": "string",
                        "description": "Choose the query mode. Each mode returns different data about Brazilian elections.",
                        "default": "ranking"
                    },
                    "ano": {
                        "title": "Election year",
                        "minimum": 1994,
                        "maximum": 2026,
                        "type": "integer",
                        "description": "Election year. Municipal: 1996,2000,2004,2008,2012,2016,2020,2024. General: 1994,1998,2002,2006,2010,2014,2018,2022.",
                        "default": 2024
                    },
                    "nome": {
                        "title": "Candidate name",
                        "type": "string",
                        "description": "Partial name search. Ex: Lula, Bolsonaro, Maria Silva."
                    },
                    "partido": {
                        "title": "Party (sigla)",
                        "type": "string",
                        "description": "Ex: PT, PL, MDB, PSDB, PP, PSD, UNIÃO."
                    },
                    "municipio": {
                        "title": "Municipality",
                        "type": "string",
                        "description": "Partial name search. Ex: São Paulo, Campinas, Fortaleza."
                    },
                    "uf": {
                        "title": "State (UF)",
                        "type": "string",
                        "description": "Ex: SP, MG, RJ, BA, RS, PR."
                    },
                    "cargo": {
                        "title": "Office / Cargo",
                        "type": "string",
                        "description": "Ex: PREFEITO, VEREADOR, GOVERNADOR, SENADOR, DEPUTADO FEDERAL."
                    },
                    "situacao": {
                        "title": "Election result",
                        "type": "string",
                        "description": "Ex: ELEITO, NÃO ELEITO, SUPLENTE."
                    },
                    "tipo_ranking": {
                        "title": "Ranking type",
                        "enum": [
                            "mais_ricos",
                            "eleitos_por_partido",
                            "candidatos_por_partido"
                        ],
                        "type": "string",
                        "description": "Type of ranking to generate.",
                        "default": "mais_ricos"
                    },
                    "top_n": {
                        "title": "Top N results (rankings)",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of results to return in ranking mode.",
                        "default": 20
                    },
                    "max_resultados": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of results to return.",
                        "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
                                    }
                                }
                            },
                            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
