Monitor Brazil CVM Filings Coverage in Grafana

Need Grafana CVM filings monitoring? apicvm has no Grafana plugin. Export list/metadata into Prometheus, Loki, or a SQL datasource, then alert on missing coverage for your watchlist.

The problem

Ops and research platforms need to know when ITR inventory for a ticker is empty after a quarter window — not when the portal HTML changed. Stable document UUIDs and HTTP status codes are alert-friendly; scrapers are not.

Pattern

scheduled list job → metrics (documents_found{ticker,type,year}) → Grafana alert
import os, requests

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

for ticker in ["CIEL3", "PSSA3", "ASAI3"]:
    r = requests.get(
        f"{BASE}/v1/documents",
        headers=H,
        params={"ticker": ticker, "type": "ITR", "year": 2024, "perPage": 50},
        timeout=60,
    )
    r.raise_for_status()
    # emit gauge documents_found{ticker=...,type="ITR",year="2024"} = len(r.json()["data"])

Alert ideas

  • documents_found == 0 for more than N days after expected ITR window
  • Rising 429 / rate-limit headers from the collector
  • Extraction callback failures (logged separately; no poll endpoint)

Current limitations

  • Grafana does not query apicvm natively
  • Empty lists can be corpus gaps — tune alerts with resolve-first checks
  • No real-time material-fact stream in v1 MVP scope

Next steps

Ready to integrate?

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