Gov APItransparenciaportal.gov.br ↗
Access Brazilian federal transparency data: parliamentary amendments, public servant records, payment card transactions, and beneficiary expenditures via 5 structured endpoints.
What is the Gov API?
This API exposes 5 endpoints covering Brazilian federal government financial records from transparenciaportal.gov.br, including parliamentary amendments, public servant rosters, and payment card transactions. The get_emendas endpoint returns amendment spending broken down by author, program, and budget action, while get_servidores delivers paginated federal employee records with CPF, name, agency, and employment status.
curl -X GET 'https://api.parse.bot/scraper/62c5c8b9-c58a-4896-8b8d-66c2b87eb1b7/get_emendas?year=2024&limit=5&offset=0' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace transparenciaportal-gov-br-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Portal da Transparência SDK — Brazilian government transparency data."""
from parse_apis.portal_da_transparência_api import (
Transparencia, ExpensePhase, TokenExtractionFailed
)
client = Transparencia()
# List parliamentary amendments for 2024
for amendment in client.amendments.list(year="2024", limit=3):
print(amendment.autor, amendment.funcao, amendment.valorPago)
# List government payment card transactions for a period
card = client.cardtransactions.list(date_from="01/01/2024", date_to="31/01/2024", limit=1).first()
if card:
print(card.tipoCartao, card.portador, card.orgaoSuperior)
# List expenditures filtered by phase (Empenho) using the enum
for exp in client.expenditures.list(
date_from="01/01/2024", date_to="31/01/2024",
fase=ExpensePhase.EMPENHO, limit=3
):
print(exp.favorecido, exp.valor, exp.fase)
# Typed error handling on public servants listing
try:
servant = client.publicservants.list(limit=1).first()
if servant:
print(servant.nome, servant.cargo, servant.situacao)
except TokenExtractionFailed as exc:
print(f"Token extraction failed: {exc}")
print("exercised: amendments.list / cardtransactions.list / expenditures.list / publicservants.list")
Get parliamentary amendments (spending by politicians) for a specific year. Returns paginated results ordered by author. Each amendment includes budget details such as committed, liquidated, and paid values across multiple government functions and programs. Pagination is offset-based: advance by incrementing offset by limit.
| Param | Type | Description |
|---|---|---|
| year | string | Year to query amendments for in YYYY format. |
| limit | integer | Maximum number of results per page. |
| offset | integer | Pagination offset (number of records to skip). |
{
"type": "object",
"fields": {
"data": "array of amendment objects with fields like autor, tipoEmenda, valorEmpenhado, valorPago, funcao, programa, acao",
"draw": "integer draw counter",
"recordsTotal": "integer total number of records available",
"recordsFiltered": "integer total filtered records"
},
"sample": {
"data": {
"data": [
{
"ano": 2024,
"acao": "8581 - ESTRUTURACAO DA REDE DE SERVICOS DE ATENCAO PRIMARIA A SAUDE",
"autor": "4290 - ABILIO BRUNINI",
"funcao": "Saúde",
"programa": "5119 - ATENCAO PRIMARIA A SAUDE",
"subfuncao": "Atenção básica",
"valorPago": "1.748.960,00",
"tipoEmenda": "Emenda Individual - Transferências com Finalidade Definida",
"codigoEmenda": "202442900001",
"numeroEmenda": "0001",
"valorEmpenhado": "2.359.960,00",
"valorLiquidado": "1.748.960,00",
"valorRestoPago": "611.000,00",
"localidadeDoGasto": "MÚLTIPLO",
"valorRestoInscrito": "611.000,00",
"valorRestoCancelado": "0,00"
}
],
"draw": 0,
"error": null,
"recordsTotal": 9223372036854776000,
"recordsFiltered": 9223372036854776000
},
"status": "success"
}
}About the Gov API
What the API Covers
Five endpoints map directly to major datasets published by Brazil's Portal da Transparência. get_emendas queries parliamentary amendments by year (year in YYYY format) and returns per-amendment fields including autor, tipoEmenda, valorEmpenhado (committed value), valorPago (paid value), funcao, programa, and acao. get_despesas_favorecido drills into expenditures by beneficiary across three budget phases — Empenho (1), Liquidação (2), and Pagamento (3) — selectable via the fase parameter, with results sorted by value descending.
Payment Cards and Beneficiary Transfers
get_cartoes returns government payment card transactions filtered by date range (date_from / date_to in DD/MM/YYYY format). Each record includes tipoCartao, orgaoSuperior, portador, valorTotal, and dataTransacao. get_despesas_recursos_recebidos covers resources received by beneficiaries over a given period, returning mesAno, favorecido, tipoFavorecido, ufFavorecido, municipioFavorecido, and valorRecebido — useful for mapping transfers by state or municipality.
Public Servants
get_servidores provides federal public servant data paginated by name. Each record includes tipo, cpf, nome, orgaoServidorLotacao (agency of assignment), matricula, situacao (employment status), cargo, and funcao. All five endpoints share a consistent pagination model using limit and offset parameters, and every response includes recordsTotal and recordsFiltered counts alongside the data array.
The Gov API is a managed, monitored endpoint for transparenciaportal.gov.br — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when transparenciaportal.gov.br changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official transparenciaportal.gov.br API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track how individual parliamentarians allocate amendment budgets (
valorEmpenhado,valorPago) across programs and budget actions. - Audit government payment card usage by cardholder (
portador) and issuing agency (orgaoSuperior) over custom date ranges. - Build a directory of federal public servants filtered by agency (
orgaoServidorLotacao) and employment status (situacao). - Map federal transfers to municipalities using
municipioFavorecidoandufFavorecidofrom the resources-received endpoint. - Compare expenditure commitment versus payment phases for the same beneficiary using
fasevalues 1, 2, and 3 inget_despesas_favorecido. - Monitor year-over-year shifts in parliamentary amendment spending by querying
get_emendasacross multipleyearvalues. - Identify top beneficiaries of federal spending by sorting
get_despesas_favorecidoresults, which are pre-ordered by value descending.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does transparenciaportal.gov.br have an official developer API?+
What does `get_emendas` return and how do I scope it to a specific year?+
autor, tipoEmenda, valorEmpenhado, valorPago, funcao, programa, and acao. Pass the year parameter in YYYY format to filter results to a specific budget year. Results are ordered by author name and support limit/offset pagination.Can I filter public servant records by agency or employment status?+
get_servidores currently returns all federal public servants paginated by name. The response includes orgaoServidorLotacao and situacao fields per record, so you can filter client-side, but the endpoint does not accept agency or status as query parameters. You can fork this API on Parse and revise it to add server-side filtering by those fields.Are state or municipal government expenditures covered?+
How fresh is the data returned by `get_cartoes` and `get_despesas_recursos_recebidos`?+
date_to and date_from parameters to bound your queries and avoid pulling ranges where data may be incomplete.