CVM publishes two financial-statement datasets with the same eleven tables and the same schema, differing only in cadence:
-
ITR — Informações Trimestrais. One CSV per
table per year, with one row per
(company, quarter, account). -
DFP — Demonstrações Financeiras
Padronizadas. One CSV per table per year, with one row per
(company, fiscal year, account).
The package’s tooling is identical for both: pass "itr"
or "dfp" as dataset, the same
table name, and the same arguments. Eight tables out of
eleven publish individual / consolidated variants selected through
basis.
Reference: tables available
| Table | What it carries |
basis required? |
Notes |
|---|---|---|---|
bpa |
Asset side of the balance sheet | Yes (ind / con / both) |
VL_CONTA × ESCALA_MOEDA applied
(multiply_by_scale). |
bpp |
Liabilities + equity side | Yes | Idem. |
dre |
Income statement | Yes | Idem. |
dra |
Statement of comprehensive income | Yes | Idem. |
dfc_md |
Cash-flow statement, direct method | Yes | Idem. |
dfc_mi |
Cash-flow statement, indirect method | Yes | Idem. |
dmpl |
Statement of changes in equity | Yes | Idem; wider table (multiple equity columns). |
dva |
Statement of value added (Brazilian-specific) | Yes | Idem. |
composicao_capital |
Capital composition (share counts by class) | No (leave unset) | No cd_cvm column; indexed by
cnpj_cia. |
parecer |
Auditor opinion (free-text) | No | One row per filing, with full opinion text in
texto. |
submissao |
Filing header — id_doc, dt_receb,
link_doc, etc. |
No | The dataset’s index: one row per delivery, re-filings included; the
current one is the last by dt_receb,
id_doc. |
The eight tables that take basis always carry a
basis column in the result, whether you asked for one
variant or for c("ind", "con") (which stacks both).
Use cvm_dictionary("dfp", "<table>") to see the
column-level metadata (descriptions, domain, data type, size) for any of
the eleven tables;
cvm_codelist("dfp", "<table>", "<column>")
returns enumerated categorical values.
Workflow 1 — Side-by-side total assets across two issuers
Goal: compare 2024 total assets for BCO BRASIL S.A.
(CNPJ 00.000.000/0001-91) and MAGAZINE LUIZA
S.A. (CNPJ 47.960.950/0001-21) using the
individual balance sheet (dfp/bpa).
bpa <- cvm_fetch(
"dfp", "bpa",
cnpj = c("00.000.000/0001-91", "47.960.950/0001-21"),
year = 2024,
basis = "ind"
)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
bpa
#> ℹ source: "mirror" | release: "mirror-companhias-dfp-snapshot-2026-11-24" |
#> fetched_at: 2026-11-26 23:11:13.475723
#> ℹ group: "companhias" | dataset: "dfp" | table: "bpa"
#> # A tibble: 226 × 14
#> cnpj_cia dt_refer versao denom_cia cd_cvm grupo_dfp moeda ordem_exerc
#> <chr> <date> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL PENÚLTIMO
#> 2 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL ÚLTIMO
#> 3 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL PENÚLTIMO
#> 4 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL ÚLTIMO
#> 5 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL PENÚLTIMO
#> 6 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL ÚLTIMO
#> 7 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL PENÚLTIMO
#> 8 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL ÚLTIMO
#> 9 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL PENÚLTIMO
#> 10 00.000.000/00… 2024-12-31 1 BCO BRAS… 001023 DF Indiv… REAL ÚLTIMO
#> # ℹ 216 more rows
#> # ℹ 6 more variables: dt_fim_exerc <date>, cd_conta <chr>, ds_conta <chr>,
#> # vl_conta <dbl>, st_conta_fixa <chr>, basis <chr>The tibble carries provenance attributes and the package has already:
- multiplied
VL_CONTAbyESCALA_MOEDAand dropped the scale column (values are in absolute reais); - converted
DT_REFER,DT_FIM_EXERCto RDate; - kept only the filing delivered last per
(cnpj_cia, dt_refer)— so re-filings do not produce duplicated rows. Thesubmissaoindex is the exception: it lists every delivery, with its receipt date.
Total assets is the top of the asset hierarchy
(cd_conta == "1"):
ativo_total <- bpa[
bpa$cd_conta == "1" & bpa$ordem_exerc == "ÚLTIMO",
c("cnpj_cia", "denom_cia", "dt_fim_exerc", "vl_conta")
]
ativo_total
#> ℹ source: "mirror" | release: "mirror-companhias-dfp-snapshot-2026-11-24" |
#> fetched_at: 2026-11-26 23:11:13.475723
#> ℹ group: "companhias" | dataset: "dfp" | table: "bpa"
#> # A tibble: 2 × 4
#> cnpj_cia denom_cia dt_fim_exerc vl_conta
#> <chr> <chr> <date> <dbl>
#> 1 00.000.000/0001-91 BCO BRASIL S.A. 2024-12-31 2395432208000
#> 2 47.960.950/0001-21 MAGAZINE LUIZA S.A. 2024-12-31 32482619000CVM publishes each fiscal year’s CSV with two reference columns —
ÚLTIMO (the declared year, here 2024) and
PENÚLTIMO (the comparative previous year). To pick up an
older comparative, request the matching upstream year explicitly:
bpa_history <- cvm_fetch(
"dfp", "bpa",
cnpj = "00.000.000/0001-91",
year = 2022:2024,
basis = "ind"
)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
ativo_history <- bpa_history[
bpa_history$cd_conta == "1" & bpa_history$ordem_exerc == "ÚLTIMO",
c("dt_fim_exerc", "vl_conta")
]
ativo_history[order(ativo_history$dt_fim_exerc), ]
#> ℹ source: "mirror" | release: "mirror-companhias-dfp-snapshot-2026-11-24" |
#> fetched_at: 2026-11-26 23:11:14.344546
#> ℹ group: "companhias" | dataset: "dfp" | table: "bpa"
#> # A tibble: 3 × 2
#> dt_fim_exerc vl_conta
#> <date> <dbl>
#> 1 2022-12-31 2062674549000
#> 2 2023-12-31 2208053634000
#> 3 2024-12-31 2395432208000The PENÚLTIMO column is the comparative the issuer
presented a year later, and issuers restate it. reading
reads an exercise by its own year and labels the two readings — the
figures originally filed (ÚLTIMO of that year’s file) and
the comparative of the following year’s file (PENÚLTIMO
there):
bpa_2023 <- cvm_fetch(
"dfp", "bpa",
cnpj = "00.000.000/0001-91",
year = 2023,
basis = "con",
reading = c("original", "restated")
)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
bpa_2023[
bpa_2023$cd_conta %in% c("1", "1.02"),
c("dt_refer", "ordem_exerc", "dt_fim_exerc", "cd_conta", "vl_conta",
"reading")
]
#> ℹ source: "mirror" | release: "mirror-companhias-dfp-snapshot-2026-11-24" |
#> fetched_at: 2026-11-26 23:11:14.945374
#> ℹ group: "companhias" | dataset: "dfp" | table: "bpa"
#> # A tibble: 4 × 6
#> dt_refer ordem_exerc dt_fim_exerc cd_conta vl_conta reading
#> <date> <chr> <date> <chr> <dbl> <chr>
#> 1 2023-12-31 ÚLTIMO 2023-12-31 1 2153878452000 original
#> 2 2023-12-31 ÚLTIMO 2023-12-31 1.02 1937460342000 original
#> 3 2024-12-31 PENÚLTIMO 2023-12-31 1 2153878452000 restated
#> 4 2024-12-31 PENÚLTIMO 2023-12-31 1.02 1935460343000 restatedWorkflow 2 — Capital composition and the filing header
composicao_capital does not carry cd_cvm —
it indexes by cnpj_cia, which is exactly what
cnpj matches, so the call is the same as for any other
table:
cap <- cvm_fetch(
"dfp", "composicao_capital",
cnpj = c("00.000.000/0001-91", "47.960.950/0001-21"),
year = 2024
)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
cap
#> ℹ source: "mirror" | release: "mirror-companhias-dfp-snapshot-2026-11-24" |
#> fetched_at: 2026-11-26 23:11:15.423906
#> ℹ group: "companhias" | dataset: "dfp" | table: "composicao_capital"
#> # A tibble: 2 × 10
#> cnpj_cia dt_refer versao denom_cia qt_acao_ordin_cap_in…¹
#> <chr> <date> <chr> <chr> <dbl>
#> 1 00.000.000/0001-91 2024-12-31 1 BCO BRASIL S.A. 5730834040
#> 2 47.960.950/0001-21 2024-12-31 1 MAGAZINE LUIZA S.… 738995248
#> # ℹ abbreviated name: ¹qt_acao_ordin_cap_integr
#> # ℹ 5 more variables: qt_acao_pref_cap_integr <dbl>,
#> # qt_acao_total_cap_integr <dbl>, qt_acao_ordin_tesouro <dbl>,
#> # qt_acao_pref_tesouro <dbl>, qt_acao_total_tesouro <dbl>Note: no basis argument —
composicao_capital is a single concept, not split into
individual / consolidated, and passing basis to it
aborts.
Cross-check against the underlying submissao header, which is also
where a CVM code (cd_cvm) meets its CNPJ:
sub <- cvm_fetch(
"dfp", "submissao",
cnpj = c("00.000.000/0001-91", "47.960.950/0001-21"),
year = 2024
)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
sub[, c("cd_cvm", "denom_cia", "dt_refer", "id_doc")]
#> ℹ source: "mirror" | release: "mirror-companhias-dfp-snapshot-2026-11-24" |
#> fetched_at: 2026-11-26 23:11:15.558863
#> ℹ group: "companhias" | dataset: "dfp" | table: "submissao"
#> # A tibble: 2 × 4
#> cd_cvm denom_cia dt_refer id_doc
#> <chr> <chr> <date> <chr>
#> 1 001023 BCO BRASIL S.A. 2024-12-31 144874
#> 2 022470 MAGAZINE LUIZA S.A. 2024-12-31 145377ITR works the same way — replace "dfp" with
"itr". The trimester breakdown then shows up in
dt_refer, dt_fim_exerc and in the
ds_conta / grupo_dfp columns; the underlying
mechanics (multiply_by_scale,
keep_latest_version, date conversion via the dictionary)
are shared. To pick quarters rather than whole years, pass a
from/to window on the reference date:
h1 <- cvm_fetch(
"itr", "bpa",
cnpj = "00.000.000/0001-91",
from = "2024-01-01", to = "2024-06-30",
basis = "con"
)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
unique(h1$dt_refer)
#> [1] "2024-03-31" "2024-06-30"Workflow 3 — Comparing companies: the CVM’s fixed accounts
Each statement row carries st_conta_fixa.
"S" marks an account of the CVM’s standard chart, the same
in every company that follows the chart. "N" marks an
account the company opened under it. To compare companies, keep the
fixed accounts. The package adds no argument for this, because the
column is already there:
dre <- cvm_fetch(
"dfp", "dre",
cnpj = c("33.000.167/0001-01", "47.960.950/0001-21", "60.872.504/0001-23"),
year = 2024,
basis = "con"
)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpmKmhYx/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
fixas <- dre[dre$st_conta_fixa == "S" & dre$ordem_exerc == "ÚLTIMO", ]
fixas[fixas$cd_conta == "3.01", c("denom_cia", "cd_conta", "ds_conta")]
#> ℹ source: "mirror" | release: "mirror-companhias-dfp-snapshot-2026-11-24" |
#> fetched_at: 2026-11-26 23:11:16.381386
#> ℹ group: "companhias" | dataset: "dfp" | table: "dre"
#> # A tibble: 3 × 3
#> denom_cia cd_conta ds_conta
#> <chr> <chr> <chr>
#> 1 PETROLEO BRASILEIRO S.A. PETROBRAS 3.01 Receita de Venda de Bens e/ou Ser…
#> 2 MAGAZINE LUIZA S.A. 3.01 Receita de Venda de Bens e/ou Ser…
#> 3 ITAU UNIBANCO HOLDING S.A. 3.01 Receitas da Intermediação Finance…The output shows the caveat. The CVM has more than one standard
chart: one for companies in general, others for banks and for insurers.
Under 3.01, Petrobras and Magazine Luiza report the revenue
from sales and Itaú Unibanco reports the revenue from financial
intermediation. The code is fixed in all three charts, but it does not
mean the same thing in all of them. The CVM does not publish which chart
a company follows. setor_ativ in
cvm_fetch("cad", "companhias") tells banks and insurers
apart.
What the fixed accounts are worth, measured on 2026-11-01 on the mirror. The measurement covered every DFP (2010-2025) and ITR (2011-2025) statement table, both bases and the current-exercise column, about 21 million rows from about 1,200 companies:
-
Comparable within a chart. A fixed account used by
20 or more companies carries one name for 99.2% of them on average (DFP
consolidated 2024). Where the names differ, the minority is a bank or an
insurer:
1.02.03is Imobilizado for 450 companies and a class of financial assets for 17. A non-fixed code carries a median of 45 different names across companies. It is not a basis for comparison. - Stable within a company. For the same company and account the flag changes between years in 0.3% of the pairs (DFP) and 0.4% (ITR). The changes cluster in a few years (2018, 2020, 2023), when the chart itself was revised.
-
Small. Accounts fixed for at least 95% of the
companies that use them number about 51-72 in the consolidated balance
sheet assets (
bpa), 100-130 in liabilities (bpp), 25-28 in the income statement (dre) and 10 in the cash flow (dfc_mi). Of the 467 companies in the 2024 consolidated DFP, 448 carry every one of them. The 19 that do not are 15 banks, 2 insurers and 2 holding companies. -
The top of the tree. Every level-1 account
(
1,2,3…) is fixed, and 97.5% of level-2 rows are. The share falls to about 70% from level 4 down, where companies open their own accounts.