Brazil CVM Filings for AI Agents
You are building an AI agent that answers questions about Brazilian public companies — earnings, risks, governance, quarterly trends. The agent needs Brazil filings for AI agents: structured access to CVM documents, not a browser scraping CVM portals.
apicvm gives agent builders a stable tool surface: resolve a ticker, list DFP/ITR/FRE filings, download originals, and stream page-level markdown through callbacks.
The persona
Typical builders:
- Research agents — "What were Petrobras capex trends?" backed by DFP/ITR text
- Compliance copilots — trace answers to original CVM PDFs
- Cross-border quant tools — add Brazil alongside US/EU data without custom scrapers
Common blocker: CVM filings are PDFs in Portuguese with complex layouts. Raw PDF bytes do not fit LLM context windows, and naive text extraction loses tables.
The problem
Agent loops need three things CVM portals do not provide out of the box:
- Ticker-first lookup —
PETR4→ company → documents - Typed filters — DFP (annual), ITR (quarterly), FRE (reference form)
- Machine-readable text — page-level markdown, not OCR soup
Scraping breaks. Bulk open-data ZIPs lack a per-filing download workflow. Your agent needs an API contract it can call repeatedly.
Solution: apicvm agent flow
User question about PETR4
→ GET /v1/companies/resolve?query=PETR4
→ GET /v1/documents?ticker=PETR4&type=DFP&year=2024
→ Pick document.id from results
→ POST /v1/document-text-extractions (callback_url = your agent server)
→ Receive page markdown callbacks → chunk → embed → answer with citations
Step 1: Resolve company
curl -H "Authorization: Bearer $APICVM_KEY" \
"$APICVM_URL/v1/companies/resolve?query=PETR4&by=ticker"
Returns company id, name, cnpj, and tickers[] — enough to disambiguate the issuer before listing filings.
Step 2: List filings by type
curl -H "Authorization: Bearer $APICVM_KEY" \
"$APICVM_URL/v1/documents?ticker=PETR4&type=DFP&year=2024&perPage=20"
Your agent (or orchestrator) should pick an explicit document.id. The API returns 409-style ambiguity errors when filters match multiple companies — it never silently guesses.
Step 3: Extract text for the agent loop
curl -X POST -H "Authorization: Bearer $APICVM_KEY" \
-H "Content-Type: application/json" \
-d '{"callback_url":"https://your-agent.example.com/callbacks/apicvm","document":{"id":"<uuid>"}}' \
"$APICVM_URL/v1/document-text-extractions"
Each callback delivers one page of markdown. Feed pages into your vector store or pass relevant chunks into the LLM context with document_id and page number for citations.
Example agent architecture
┌─────────────┐ resolve/list ┌──────────┐
│ Agent / LLM │ ────────────────────► │ apicvm │
└─────────────┘ └──────────┘
▲ │
│ page markdown callbacks │
└─────────────────────────────────────┘
│
▼
Vector store (ticker, type, year, page)
Tool design tip: expose apicvm as three tools — resolve_company, list_documents, enqueue_extraction — rather than one mega-tool. Lets the model plan steps and handle ambiguity errors.
LLM discovery
For agent frameworks that read site metadata, apicvm publishes /llms.txt with endpoint summaries and the recommended flow. Point tool-description loaders at it during agent setup.
Current limitations
- Extraction is async via callback — no synchronous "give me all text" endpoint.
- Callback URL must be HTTPS in production.
- Corpus coverage grows with ingestion — not every B3 company may be available yet.
- Original filings are in Portuguese — plan translation in your agent if needed.
Next steps
- Read the API docs
- Get an API key
- Download llms.txt
- Extract text from CVM PDFs — callback handler details
- PETR4 CVM filings — concrete company example
Ready to integrate?
Get an API key and start querying Brazilian CVM filings programmatically.