Build Evidence.dev Reports on Brazil CVM Filings

Want Evidence.dev CVM filings reports for coverage gaps? Stage apicvm document lists into DuckDB/Postgres, then render markdown+SQL pages. Evidence is the presentation layer; apicvm is the filings API.

The problem

Analysts ask for shareable "ITR missing" pages. Spreadsheets drift; Evidence can version SQL with git if the warehouse is fed nightly.

Flow

apicvm list → DuckDB/Postgres staging → Evidence SQL blocks → static site

Stage with Python + DuckDB

import os, requests, duckdb

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

docs = requests.get(
    f"{BASE}/v1/documents",
    headers=H,
    params={"ticker": "VALE3", "type": "FRE", "year": 2024, "perPage": 50},
).json()["data"]

con = duckdb.connect("cvm_staging.duckdb")
con.execute("CREATE TABLE IF NOT EXISTS documents (id VARCHAR, name VARCHAR, type VARCHAR, ticker VARCHAR)")
con.executemany(
    "INSERT INTO documents VALUES (?, ?, ?, ?)",
    [(d["id"], d.get("name"), "FRE", "VALE3") for d in docs],
)

Point Evidence at that database and write:

SELECT name, id FROM documents WHERE type = 'FRE' LIMIT 20

Resolve before multi-ticker jobs

curl -H "Authorization: Bearer $APICVM_KEY" \
  "$APICVM_URL/v1/companies/resolve?query=VALE3&by=ticker"

Adjacent tooling: DuckDB guide, dbt staging.

Current limitations

  • Evidence does not call apicvm natively — you stage first
  • Async extraction callbacks are outside Evidence's SQL model
  • Do not invent document counts; query live lists

Next steps

Ready to integrate?

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