Access Brazil CVM Filings with Haskell

Need a Haskell CVM filings API client? apicvm speaks HTTPS JSON. Use http-conduit, req, or wreq with a Bearer token — there is no official Haskell package.

The problem

Research notebooks and batch jobs in Haskell often end up shelling out to scrapers. Stable document UUIDs and typed filters (ticker, type, year) fit functional pipelines better than portal HTML.

Setup

export APICVM_URL='https://apicvm.dev'
export APICVM_KEY='apicvm_...'

Resolve and list with curl

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

curl -H "Authorization: Bearer $APICVM_KEY" \
  "$APICVM_URL/v1/documents?ticker=VALE3&type=ITR&year=2024&perPage=20"

Example: http-conduit sketch

{-# LANGUAGE OverloadedStrings #-}
-- GET /v1/documents with Authorization: Bearer <key>
-- Decode aeson Value; walk ["data"] for document ids

Wire the same query params as the curl guide.

Python mirror

import os, requests

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

company = requests.get(
    f"{BASE}/v1/companies/resolve",
    headers=H,
    params={"query": "VALE3", "by": "ticker"},
).json()
print(company.get("data", company))

Download a filing

curl -OJ -H "Authorization: Bearer $APICVM_KEY" \
  "$APICVM_URL/v1/documents/<document-id>/file"

Current limitations

  • Async text extraction only via HTTPS callback — no sync markdown endpoint in the paid path.
  • List perPage max 50.
  • Demo routes are VALE3-only and public; production keys use full /v1.

Next steps

Ready to integrate?

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