Brazilian Politics Data API
Pricing
Pay per usage
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
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
22 days ago
Last modified
Categories
Features
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
| Dataset | What | Official source |
|---|---|---|
camara.deputados | Federal deputies in office | Câmara dos Deputados API v2 |
camara.despesas | Deputies' expense claims (cota parlamentar), with receipt links | Câmara yearly bulk file (/cotas/Ano-YYYY.csv.zip) |
camara.votacoes | Plenary votes; per person when filtered by name, party or state | Câmara API v2 |
camara.proposicoes | Bills and other proposals | Câmara API v2 |
senado.senadores | Senators in office | Senado Dados Abertos |
senado.despesas | Senators' expense claims (CEAPS) | Senado administrative open data |
senado.votacoes | Plenary roll-call votes, with each senator's vote | Senado Dados Abertos |
tse.candidatos | Candidates for any office: mayors, councillors, governors, deputies, senators, president | TSE bulk files |
tse.bens | Assets each candidate declared, joined with the candidate's name and office | TSE bulk files |
transparencia.emendas | Parliamentary amendments to the federal budget (who sent money where) | Portal da Transparência (CGU), needs a free key |
diarios.publicacoes | Municipal official gazettes: appointments, decrees, contracts | Querido Diário (Open Knowledge Brasil) |
sapl.parlamentares | Councillors or state deputies of any SAPL legislature | SAPL REST API |
sapl.materias | Bills from any SAPL legislature, with author names | SAPL 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 /datasetsGET /?datasets=camara.deputados&uf=SP&party=PSOL&maxItems=20GET /?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 installapify run --input '{"datasets":["camara.deputados"],"uf":["SP"]}'npm run serve:dev # Standby API on http://localhost:4321npm 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
SUMMARYrecord 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}/despesasendpoint has been returning empty lists. The file is updated daily. - TSE files are large (about 70 MB per election for candidates). Always pass
ufwhen you can. Downloads are cached within a run, sotse.candidatosandtse.benstogether 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
ufandpartyfilters 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 insrc/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.