Access Brazilian National Treasury Open Data APIs
Overview
Provides a unified interface to access open data from the Brazilian National Treasury ('Tesouro Nacional') and related government APIs. Covers six data sources: 'SICONFI' https://apidatalake.tesouro.gov.br/docs/siconfi/ for fiscal reports ('RREO', 'RGF', 'DCA', 'MSC') and entity information; 'CUSTOS' https://apidatalake.tesouro.gov.br/docs/custos/ for federal government cost data; 'SADIPEM' https://apidatalake.tesouro.gov.br/docs/sadipem/ for public debt and credit operations; 'Transferencias Constitucionais' https://apiapex.tesouro.gov.br/aria/v1/transferencias_constitucionais/docs for constitutional transfers to states and municipalities; 'SIORG' https://estruturaorganizacional.dados.gov.br for federal organizational structure; and 'SIOPE' ('FNDE'/'MEC') for education spending data. Features automatic pagination, in-memory caching, retry logic, and tidy output.
Transferencias: municipal endpoints follow the new server contract
The Transferencias Constitucionais API changed on the server side: parameter
names became case-sensitive (lower case) and the municipal endpoints became
paginated (page/pageSize, 10 rows per page by default). With the old
upper-case names the server ignored every filter and timed out (HTTP 504),
which looked like an outage.
get_tc_por_municipio()/get_tc_by_municipality()and the_detalhe/_detailvariants now sendp_estado,p_municipio(singular),p_ano,p_mes,p_transferenciaandp_sn_detalhar, and fetch every page (new argumentspage_size = 1000andmax_rows = Inf). A page failing after the first returns the rows fetched so far withattr(x, "partial") = TRUE.
Show all changes in 0.3.1Hide the rest of the changes in 0.3.1
get_tc_por_municipio_detalhe()/get_tc_by_municipality_detail()keep the original contract, which that endpoint still uses: upper-case names,P_MUNICIPIOS, no pagination. It now also documents the ten-day installment columns it returns.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-07
- OK7 OK2026-05-07
Documentation
- Help pages
- 49 (2 internal)includes a package overview page
- Examples that run
- 6%3 run in a plain check · 44 never run
- Exported functions with examples
- 98%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
- CUSTOS API – Federal government costs HTML
- Getting started with tesouror HTML
- RREO longitudinal — handling layout drift across years HTML
- SADIPEM API – Public debt & credit operations HTML
- SICONFI API – Fiscal data HTML
- SIOPE API – Education spending data HTML
- SIORG – Organizational Structure HTML
- Transferências Constitucionais API HTML
- Transferências Constitucionais para Municípios de Pernambuco HTML
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 0
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Commits over time
10 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/strategicprojects/tesouror on 2026-10-25.
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 2 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-05-02Named in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claude, CLAUDE.mdCommits: at least 30 crediting it in the message
- Claude Opus 4.810 commits · Jun 2026
- Claude Opus 4.79 commits · May 2026
- Claude Fable 5.15 commits · Sep 2026
- Claude Fable 53 commits · Aug 2026
- Claude Opus 5.53 commits · Sep 2026
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.3.1Latest
- 0.3.02026-08-19 · diff ↗ ·
added 12 exports
get_annual_accounts_municipalities, get_annual_accounts_ufs, get_budget_report_municipalities, get_budget_report_ufs, get_dca_municipios, get_dca_ufs, get_fiscal_report_municipalities, get_fiscal_report_ufs, get_rgf_municipios, get_rgf_ufs, get_rreo_municipios, get_rreo_ufs - 0.2.32026-06-09 · diff ↗
- 0.2.22026-05-06
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-05-06
- Total releases
- 4 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 5.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("tesouror")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.