Load Brazil CVM Filings into Excel with Power Query

Want Excel Power Query CVM filings tables without downloading ZIPs from the portal? Point Power Query at apicvm, send a Bearer API key, and expand the JSON from GET /v1/documents. This is not an official Microsoft connector — it is a Web API call you control.

The problem

Equity and credit analysts often need a live list of Brazilian filings in a workbook:

  • Portal UI does not refresh cleanly in shared Excel files
  • CSV dumps from open data are hard to filter by ticker + year
  • Research assistants re-download the same DFP every quarter

Power Query + apicvm keeps the table refreshable.

Prerequisites

  1. Get an API key
  2. Excel for Windows/Mac with Power Query (Get Data → From Web / Blank Query)
  3. Base URL https://apicvm.dev

Auth header

apicvm accepts Authorization: Bearer (or X-API-Key). In Power Query, prefer a parameter for the key so you do not paste secrets into shared workbooks.

Blank Query (M) — list PETR4 DFP 2024

let
    Base = "https://apicvm.dev",
    Key = Excel.CurrentWorkbook(){[Name="ApiKey"]}[Content]{0}[Column1],
    Url = Base & "/v1/documents?ticker=PETR4&type=DFP&year=2024&perPage=50",
    Source = Json.Document(
        Web.Contents(
            Url,
            [
                Headers = [
                    #"Authorization" = "Bearer " & Key,
                    #"Accept" = "application/json"
                ]
            ]
        )
    ),
    Data = Source[data],
    Table = Table.FromList(Data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Expanded = Table.ExpandRecordColumn(
        Table, "Column1",
        {"id", "name", "type", "year", "deliveryDate"},
        {"id", "name", "type", "year", "deliveryDate"}
    )
in
    Expanded

Store the key in a named Excel table ApiKey (one cell) or an environment-specific parameter. See Authentication.

Resolve a company first

curl -H "Authorization: Bearer $APICVM_KEY" \
  "https://apicvm.dev/v1/companies/resolve?query=HYPE3&by=ticker"

Use the confirmed ticker in the Power Query URL. Company pages such as HYPE3 CVM filings show the same filters.

What you can put in columns

From each document row: id, name, type (DFP/ITR/FRE), year, delivery metadata when present. Build a second query that concatenates https://apicvm.dev/v1/documents/ & [id] & /file for archive links (download still needs the auth header outside Excel, or a small script).

Pagination

perPage max is 50. If meta.lastPage > 1, either:

  • Raise filters (year, type) so one page is enough for the sheet, or
  • Use a small Python/pandas job and land a CSV that Excel refreshes

Current limitations

  • Power Query will not run async text extraction callbacks — use async extraction outside Excel.
  • Nested JSON shapes may differ slightly by document; expand only fields you need.
  • Do not commit API keys into .xlsx files shared broadly.

Next steps

Ready to integrate?

Get an API key and start querying Brazilian CVM filings programmatically.