Load Brazil CVM Filings into Power BI
Need Power BI CVM filings metadata in a desktop or service dataset? apicvm returns JSON you can load with Power Query Web.Contents. Use Power BI for tables and refresh; keep PDF binaries in blob storage or a local archive — not inside the PBIX.
The problem
Analysts covering Brazilian names often:
- Paste portal tables into Excel, then re-import to Power BI
- Lose document IDs when the portal HTML changes
- Cannot refresh filing inventories on a schedule without scrapers
An HTTP list endpoint with Bearer auth fits Power BI’s Web connector pattern.
Setup
- Get a key at /signup
- In Power BI Desktop: Get data → Blank query → Advanced Editor
- Prefer storing the key in a parameter or Azure Key Vault — not hard-coded in shared PBIX files
export APICVM_KEY='apicvm_...'
export APICVM_URL='https://apicvm.dev'
Power Query: list DFP for a ticker
let
BaseUrl = "https://apicvm.dev",
ApiKey = "apicvm_...", // prefer Parameter
Ticker = "PETR4",
Year = "2024",
Url = BaseUrl & "/v1/documents?ticker=" & Ticker
& "&type=DFP&year=" & Year & "&perPage=50",
Source = Json.Document(
Web.Contents(
Url,
[
Headers = [ #"Authorization" = "Bearer " & ApiKey ]
]
)
),
Data = Source[data],
ToTable = Table.FromList(Data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
Expand = Table.ExpandRecordColumn(
ToTable, "Column1",
{"id", "name", "type", "year", "dateRef", "ticker"},
{"id", "name", "type", "year", "dateRef", "ticker"}
)
in
Expand
perPage max is 50. For multi-page inventories, loop page until meta[lastPage] — same pagination as Excel Power Query.
Resolve before hard-coding CNPJ
curl -H "Authorization: Bearer $APICVM_KEY" \
"$APICVM_URL/v1/companies/resolve?query=PETR4&by=ticker"
Use resolve in a separate query if you need legal name / CNPJ columns next to the document table.
What belongs in the model vs outside
| In Power BI | Outside Power BI |
|---|---|
| Document id, name, type, year, dateRef | PDF bytes (GET /v1/documents/:id/file) |
| Refreshable inventory tables | Async text extraction callbacks |
| Relationships to your ticker dim | Large binary archives |
Download files from a Python/Airflow job (or curl); join on id in the warehouse if needed.
Scheduled refresh notes
- Power BI Service refresh needs a gateway or cloud credentials that can reach
https://apicvm.dev - Respect rate limits (
60 req / 60sper key on published plans) when refreshing many tickers - Student plans have a daily request cap — see pricing
Current limitations
- apicvm is a filings API, not a Power BI visual pack or DAX measure library.
- Text extraction is async and credit-based on Pro — not a Power Query sync step.
- Corpus coverage depends on ingestion; empty
dataarrays mean “not in corpus yet,” not “company never filed.”
Next steps
Ready to integrate?
Get an API key and start querying Brazilian CVM filings programmatically.