Access Brazil CVM Filings with Clojure

Need a Clojure CVM filings API client? apicvm speaks HTTPS JSON. Use clj-http, hato, or JDK HttpClient — there is no official Clojure library.

The problem

JVM research notebooks and Ring/Pedestal workers that pull Brazilian filings often inherit scrapers or one-off ZIP parsers. You want stable document IDs, filterable lists, and Bearer auth that fits REPL-driven workflows.

Setup

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

Resolve with clj-http

(require '[clj-http.client :as http]
         '[cheshire.core :as json])

(def base (System/getenv "APICVM_URL"))
(def key (System/getenv "APICVM_KEY"))

(def company
  (-> (http/get (str base "/v1/companies/resolve")
                {:headers {"Authorization" (str "Bearer " key)}
                 :query-params {:query "VALE3" :by "ticker"}
                 :as :json})
      :body))

List ITR documents

(def docs
  (-> (http/get (str base "/v1/documents")
                {:headers {"Authorization" (str "Bearer " key)}
                 :query-params {:ticker "VALE3" :type "ITR" :year 2024 :perPage 20}
                 :as :json})
      :body))

(doseq [d (:data docs)]
  (println (:id d) (:name d)))

Download a file

GET /v1/documents/:id/file returns the original PDF bytes. Persist with the document UUID as your object-store key. File download does not consume extraction credits.

When to extract text

For page-level markdown, use POST /v1/document-text-extractions with an HTTPS callback (Pro). The API is async — there is no poll endpoint; wait for the callback. See Async PDF extraction.

Current limitations

  • No official SDK; you own retries and JSON decoding
  • Rate limits apply per API key (X-RateLimit-* headers)
  • Student keys cannot run text extraction (403)

Next steps

Ready to integrate?

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