cvm-sqlite Local DB vs apicvm HTTP API
Developers comparing cvm-sqlite vs CVM API options usually want SQL access to Brazilian regulatory datasets. cvm-sqlite downloads CVM open-data files into a local SQLite database. apicvm is a hosted HTTP API for ticker-first document workflows (list → download PDF → optional text extraction).
Both are useful — different layers.
What cvm-sqlite provides
eduresser/cvm-sqlite automates download/processing of CVM open-data into SQLite. Typical use:
Fetch CIA_ABERTA dumps → load tables → SQL on DFP/ITR line items
Strengths: offline SQL, full historical panels from open data, free once you run the ETL, great for econometrics and account-level queries (e.g. DRE lines by CNPJ).
Conceptual usage (see upstream docs for current API):
# Pattern: local processor → SQL
# from cvm_sqlite import CVMDataProcessor
# processor = CVMDataProcessor(db_path="cvm.db", verbose=True)
# results = processor.query("SELECT ... FROM dfp_cia_aberta_DRE WHERE ...")
What apicvm provides
resolve company → list documents → download file → optional async markdown extraction
export APICVM_KEY='apicvm_...'
export APICVM_URL='https://apicvm.dev'
curl -H "Authorization: Bearer $APICVM_KEY" \
"$APICVM_URL/v1/documents?ticker=VALE3&type=DFP&year=2024&perPage=20"
| Capability | cvm-sqlite | apicvm |
|---|---|---|
| Interface | Local SQLite / SQL | HTTP REST /v1/* |
| Input | Bulk open-data refresh | Ticker / CNPJ / filters |
| Account-line panels | Yes (from CSV schemas) | No (document metadata + PDFs) |
| Per-filing PDF by UUID | DIY from open-data links | GET /v1/documents/:id/file |
| Page markdown extraction | DIY | Async callback job |
| Ops | You run ETL + disk | Hosted |
When to use each
| Use cvm-sqlite | Use apicvm |
|---|---|
| SQL over multi-year DFP/ITR tables | Product / agent HTTP integration |
| Offline notebooks, zero SaaS cost | Stable document.id + PDF download |
| Cross-sectional accounting research | FRE section PDFs by name= filter |
| You already maintain a data lake | RAG / extraction callbacks |
Can you use both?
Yes:
cvm-sqlite → structured financial statement panels
apicvm → original PDFs, FRE sections, agent tools
pandas users often load API metadata into frames for the document layer — see pandas + apicvm — while keeping SQLite for line-item history.
Current limitations (apicvm)
- Not a SQL warehouse of CVM CSV schemas.
- Corpus coverage and lag.
- Paid API + rate limits; extraction credits on Pro.
Current limitations (cvm-sqlite)
- You operate downloads, schema drift, and disk.
- Not a drop-in REST layer for SaaS or tool-calling agents.
- PDF / FRE section workflows still need extra tooling.
Next steps
Ready to integrate?
Get an API key and start querying Brazilian CVM filings programmatically.