Brazilian Politics Data API avatar

Brazilian Politics Data API

Pricing

Pay per usage

Go to Apify Store
Brazilian Politics Data API

Brazilian Politics Data API

Official Brazilian politics data in one format: deputies, senators, their expenses and votes, bills, TSE candidates and assets, budget amendments, municipal gazettes and SAPL legislatures. Run as a job or as an HTTP API.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Adriano Henrique

Adriano Henrique

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

22 days ago

Last modified

Categories

Features

Limited permissionsSingle-tenantServer interface

Share

One Apify Actor for official Brazilian politics data. It reads the government's own open-data APIs and bulk files and returns everything in a single normalized format: federal deputies and senators, what they spend and how they vote, bills, election candidates and declared assets, budget amendments, municipal official gazettes, and state and city legislatures that run SAPL.

Run it as a normal job (results go to the dataset) or keep it up as an HTTP API in Standby mode.

Datasets

DatasetWhatOfficial source
camara.deputadosFederal deputies in officeCâmara dos Deputados API v2
camara.despesasDeputies' expense claims (cota parlamentar), with receipt linksCâmara yearly bulk file (/cotas/Ano-YYYY.csv.zip)
camara.votacoesPlenary votes; per person when filtered by name, party or stateCâmara API v2
camara.proposicoesBills and other proposalsCâmara API v2
senado.senadoresSenators in officeSenado Dados Abertos
senado.despesasSenators' expense claims (CEAPS)Senado administrative open data
senado.votacoesPlenary roll-call votes, with each senator's voteSenado Dados Abertos
tse.candidatosCandidates for any office: mayors, councillors, governors, deputies, senators, presidentTSE bulk files
tse.bensAssets each candidate declared, joined with the candidate's name and officeTSE bulk files
transparencia.emendasParliamentary amendments to the federal budget (who sent money where)Portal da Transparência (CGU), needs a free key
diarios.publicacoesMunicipal official gazettes: appointments, decrees, contractsQuerido Diário (Open Knowledge Brasil)
sapl.parlamentaresCouncillors or state deputies of any SAPL legislatureSAPL REST API
sapl.materiasBills from any SAPL legislature, with author namesSAPL REST API

Output format

Every row has the same shape, whatever the source:

{
"dataset": "camara.despesas",
"source": "Câmara dos Deputados",
"level": "federal",
"kind": "expense",
"id": "8165015",
"date": "2026-10-09",
"title": "MANUTENÇÃO DE ESCRITÓRIO DE APOIO À ATIVIDADE PARLAMENTAR — STARLINK BRAZIL ...",
"politician": { "id": "204534", "name": "Tabata Amaral", "party": "PSB", "uf": "SP", "role": "Deputado(a) Federal" },
"amount": 619,
"url": "https://www.camara.leg.br/cota-parlamentar/documentos/publ/...pdf",
"details": { "category": "...", "supplier": "...", "supplierDocument": "...", "month": 10, "year": 2026 }
}

level is federal, estadual or municipal. kind is one of politician, expense, vote (one person's vote), voting (a whole voting session), bill, candidate, asset, amendment or gazette. Source-specific fields live in details.

Examples

How did a deputy vote in the last 30 days?

{ "datasets": ["camara.votacoes"], "name": "erika hilton" }

Everything about one senator: profile, expenses this year, votes.

{ "datasets": ["senado.senadores", "senado.despesas", "senado.votacoes"], "name": "randolfe" }

Who won for mayor in Campinas in 2024?

{ "datasets": ["tse.candidatos"], "electionYear": 2024, "uf": ["SP"], "municipality": "campinas", "office": "prefeito", "electedOnly": true }

What did the elected governors of Acre and Amapá declare in 2022?

{ "datasets": ["tse.bens"], "electionYear": 2022, "uf": ["AC", "AP"], "office": "governador", "electedOnly": true }

Appointments ("nomeia") in São Paulo's municipal gazette this month:

{ "datasets": ["diarios.publicacoes"], "territoryIds": ["3550308"], "keywords": "nomeia", "dateFrom": "2026-10-01" }

Latest bills at the Acre state assembly:

{ "datasets": ["sapl.materias"], "saplUrls": ["https://sapl.al.ac.leg.br"] }

HTTP API (Standby mode)

With Standby enabled, the Actor answers GET requests. Every input field is a query parameter; lists are comma-separated.

GET /datasets
GET /?datasets=camara.deputados&uf=SP&party=PSOL&maxItems=20
GET /?datasets=senado.votacoes,camara.votacoes&name=lula&dateFrom=2026-01-01

The response is { count, counts, errors, items }. maxItems defaults to 50 per dataset here. In Standby the Transparência key is read from the TRANSPARENCIA_API_KEY environment variable, never from the URL.

Run locally

npm install
apify run --input '{"datasets":["camara.deputados"],"uf":["SP"]}'
npm run serve:dev # Standby API on http://localhost:4321
npm test

Deploy with apify push.

Notes and limits

  • Partial failure is normal. Datasets run in parallel and one failing upstream doesn't stop the others. Failures are listed in the SUMMARY record of the key-value store. The run only fails if every dataset fails.
  • Câmara expenses come from the bulk file because the /deputados/{id}/despesas endpoint has been returning empty lists. The file is updated daily.
  • TSE files are large (about 70 MB per election for candidates). Always pass uf when you can. Downloads are cached within a run, so tse.candidatos and tse.bens together download the candidate file once.
  • Senado expenses have no party or state in the feed. They're filled in from the current senators list, so former senators have neither, and the uf and party filters skip them.
  • Senado vote totals are counted from the ballots when the feed leaves them empty, except for secret votes, where ballots only say "Votou".
  • Budget amendments filter by author name through the API. Locations are free text, so filter places with keywords.
  • State and city coverage. City councils and state assemblies are only reachable when they use SAPL (add their URL to saplUrls) or publish to Querido Diário. Many do, but not all. Other legislatures would need their own adapter in src/sources/.
  • Privacy (LGPD). CPFs, voter IDs and e-mails in TSE data are dropped, and only the birth year is kept. Supplier CPFs in expense data are masked the way government portals mask them. Company CNPJs are kept.

Adding a source

Write an async generator in src/sources/ that yields PoliticalRecords (see src/types.ts), add its name to DATASET_NAMES, register it in src/collect.ts, and add it to the datasets enum in .actor/input_schema.json.