Load Brazil CVM Filings Metadata into Metabase

Want Metabase CVM filings coverage charts? apicvm returns JSON document lists. Stage them in Postgres/DuckDB, then point Metabase at the warehouse. apicvm is not a native Metabase driver for PDF contents.

The problem

Ops and research leads ask: "Which tickers lack 2024 DFP in our corpus?" Portal clicks do not answer that. You need document-level rows with ticker, type, year, and UUID.

Pattern

Prefect/cron → GET /v1/documents → staging table → Metabase question
import os, requests, psycopg2

BASE = os.environ["APICVM_URL"]
H = {"Authorization": f"Bearer {os.environ['APICVM_KEY']}"}

def fetch(ticker, doc_type, year):
    r = requests.get(
        f"{BASE}/v1/documents",
        headers=H,
        params={"ticker": ticker, "type": doc_type, "year": year, "perPage": 50},
    )
    r.raise_for_status()
    return r.json()["data"]

rows = fetch("SBSP3", "DFP", 2024)
# insert id, name, ticker, type, year into filings_documents

What to chart

Question Source field
Missing annual packs count of DFP by ticker/year
Earnings season readiness ITR presence by quarter year
FRE refresh lag max(reference date) if present in payload

Do not invent counts offline — refresh from the API. See Paginate and filter.

PDF text in Metabase?

Usually no. Keep PDFs in object storage; use Metabase for inventory. For page markdown, use async extraction and a separate search index (RAG guide).

Current limitations

  • No official Metabase plugin from apicvm
  • File download needs Authorization headers (not a public CDN URL)
  • Corpus ≠ full B3 universe

Next steps

Ready to integrate?

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