Access Brazil CVM Filings with Crystal

Need a Crystal CVM filings API client? apicvm is REST over HTTPS. Use Crystal's HTTP::Client with a Bearer token — there is no official shard.

The problem

Crystal services that archive Brazil filings usually inherit brittle scrapers from Ruby prototypes. Document UUIDs and typed filters make a thin HTTP client preferable.

Setup

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

Resolve a ticker

require "http/client"
require "uri"

base = ENV["APICVM_URL"]
key = ENV["APICVM_KEY"]
uri = URI.parse("#{base}/v1/companies/resolve?query=PETR4&by=ticker")
response = HTTP::Client.get(uri, headers: HTTP::Headers{"Authorization" => "Bearer #{key}"})
puts response.body

List ITR documents

list_uri = URI.parse("#{base}/v1/documents?ticker=PETR4&type=ITR&year=2024&perPage=20")
list_res = HTTP::Client.get(list_uri, headers: HTTP::Headers{"Authorization" => "Bearer #{key}"})

Download a PDF

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

File download does not consume extraction credits. See the Ruby guide for a similar client shape.

Current limitations

  • Text extraction is async via callback (Pro).
  • perPage max 50.
  • Corpus coverage varies by issuer and year.

Next steps

Ready to integrate?

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