Access the 'TransfereGov' Open Data APIs
Overview
Provides a modern interface to the open data application programming interfaces of the Brazilian federal government's 'TransfereGov' platform (https://www.gov.br/transferegov/pt-br/ferramentas-gestao/dados-abertos). Covers the special transfers, fund-to-fund transfers, partnership management, and decentralized credit ('TED') modules, which together publish seventy-four tables on action plans, programs, proposals, partnerships, budget commitments, credit notes, financial execution, management reports, and payment orders. Filters are the services' own typed query parameters, validated against the published schema before a request is made, and results are returned as tidy tibbles with types taken from that schema. Automatic pagination, request throttling, retries with exponential backoff, and an optional response cache are included.
The package now targets the public API host,
api-publica.transferegov.gestao.gov.br. That host serves a different kind of
service from the 'PostgREST' one the package was built against, so this release
rewrites the client rather than extending it. Code written against 0.1.0 will
need changing.
What is covered
- **
parceriasis new**: partnership management, 17 tables, including about 89,000 partnerships and their proposals, budget commitments, payment orders and bank statements. It has no equivalent in the previous release. - **
especiaisreplacestransferenciasespeciais**, and grows from 14 tables to 23. The additions are the financial ones: transaction entries, sub-entries, account balances, beneficiaries, returned funds, management report analyses and settlement documents, and three history tables.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
- **
fundoafundostays**, at 20 tables against the previous 21, with several child tables folded into their parents as nested columns. - **
tedstays**, moved to the public host with the others: 14 tables against the previous 13. Its table and column names follow the new service, which mostly means plurals —eventois noweventos,plano_acaoisplanos_acao, andtrfisprogramacoes_financeiras_trf— so code written against 0.1.0 needs its table names checked.tg_ted()is kept. "transferenciasespeciais"still resolves, as an alias for"especiais".tg_transferencias_especiais()is removed, andtg_parcerias()andtg_especiais()jointg_fundo_a_fundo()andtg_ted().
74 tables and 1,045 columns in all, against 48 and 599.
Filters
- Filters are now the endpoints' own typed query parameters rather than 'PostgREST' operators.
tg_params()lists what each table accepts, with the permitted values of the enumerated ones. - **The comparison operators are removed** —
eq(),neq(),gt(),gte(),lt(),lte(),like(),ilike(),re_match(),re_imatch(),in_(),is_null(),is_true(),is_false(),not()andtg_operators(). These services compare for equality, with "is one of" only on the identifiers described below. - **An unknown parameter name is an error.** These services ignore a parameter they do not recognize and answer
200with the whole table, so a typo would return a plausible, unfiltered result. Names are checked against the frozen schema before the request is made, and a near miss is suggested. - Enumerated values are checked client-side too, so a bad value fails before the round trip rather than as a 422 after it.
- **Some identifier parameters take several values**, sent as one comma-separated value and matching any of them: 113 of them, in all four modules.
tg_params()marks them asmultipleand gives the most each accepts inmax_values— 100 inespeciais, 200 elsewhere. The OpenAPI documents do not say which parameters these are, so the schema builder asks the service. - Any other filter with several values, and any parameter given twice, is refused. The service keeps the last occurrence of a repeated parameter and discards the rest without reporting it.
Pagination
- Pagination is by page number, and the cap on rows per request is the one each module declares: 200 for
especiaisandparcerias, 1000 forfundoafundoandted..page_sizedefaults to that cap, andtg_modules()reports it..limitstill counts rows and.offsetstill counts rows, including when the offset falls inside a page. - **
.orderand.selectare removed.** These APIs publish no ordering or column-selection parameter. - Row order is therefore the server's. It was verified rather than assumed: the same rows come back in the same sequence across page sizes, across repeated calls, 100,000 rows deep, on tables with no key, and on tables with nested columns.
Other changes
tg_updated_at()reports when a module's data was last loaded, from the/data-atualizacaoendpoint each module publishes. It is the only freshness signal these APIs give.tg_fields()gains anestedargument, describing the columns of the objects inside a list column. 22 columns acrossfundoafundo,parceriasandtedarrive as list columns because the API folds a child table into its parent.tg_fields()reportsapi_typerather thanpg_type, and no longer reports a primary key: these documents declare none.tg_tables()gainspath, the endpoint a table maps to, andparams, how many filters it accepts. A table may be named with either a hyphen or an underscore.- Integer columns are returned as double. These documents declare no
format, so int32 and int64 cannot be told apart, and identifiers here genuinely exceed.Machine$integer.max—cd_parceriareaches 202500037062. - HTTP errors surface the validation detail the service reports, naming the parameter it objected to.
From NEWS.md in the release
Install
Health
- OK13 OKNow
- OK6 OK2026-08-09
Documentation
The repository also keeps web-only articles.
- Help pages
- 14 (1 internal)includes a package overview page
- Examples that run
- 100%13 run in a plain check (4 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
Releases over time
14 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/strategicprojects/transferegovr on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-29 · The repository has a site deploy workflow
pkgdown site last built 2026-09-29
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-07-31Named in .Rbuildignore: .claude, CLAUDE.local.md, CLAUDE.mdNamed in .gitignore: .claude, CLAUDE.local.md, CLAUDE.mdCommits: at least 27 crediting it in the message
- Claude Opus 519 commits · Jul to Aug 2026
- Claude Opus 5.58 commits · Sep 2026
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.2.0Latest2026-09-28 · current release · diff ↗ ·
removed 18 exports
eq, gt, gte, ilike, in_, is_false, is_null, is_true, like, lt, lte, neq, not, re_imatch, re_match, tg_operadores, tg_operators, tg_transferencias_especiaisadded 6 exports
tg_atualizado_em, tg_especiais, tg_parametros, tg_params, tg_parcerias, tg_updated_at - 0.1.0first seen 2026-08-08
- RR 4.6.0 released · 2026-04-24
Package metadata
- First seen
- 2026-08-08
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 131 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("transferegovr")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.