# CVM Filing Change Detector (`amcbstudio/cvm-filing-change-detector`) Actor

Compare consecutive CVM DFP filings and detect restated values, added or removed accounts, and description changes with official source hashes.

- **URL**: https://apify.com/amcbstudio/cvm-filing-change-detector.md
- **Developed by:** [AMCB Studio](https://apify.com/amcbstudio) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 verified filing comparisons

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## CVM Filing Change Detector

Compare two consecutive Brazilian CVM annual financial filings and receive an exact, source-linked account of what changed.

This is a filing-to-filing comparison tool, not a general financial-data extractor. It answers a narrower question: **were the same fiscal-year figures presented differently in the following annual filing?**

### What this Actor does

- Downloads annual DFP archives directly from CVM open data.
- Selects the latest submitted version for each requested year.
- Compares the original period with the corresponding prior-period figures in the following annual filing.
- Reports numeric changes, added or removed accounts, and description changes.
- Preserves document IDs, received dates, official URLs, units, scales, and SHA-256 hashes.
- Returns a clear no-change result when the selected statements match.
- Returns a structured rejection when the source, schema, period, or units do not permit a reliable comparison.
- Optionally preserves both official ZIP archives in the run key-value store.

### Common uses

- equity research and portfolio monitoring;
- corporate credit review and covenant monitoring;
- compliance, risk, and audit trails;
- accounting reconciliation;
- M\&A and financial due diligence;
- structured evidence for internal agents and automations.

### Why this is different

Most financial-data tools return the latest statements, ratios, or a time series. This Actor compares two official document snapshots and retains the identity of each source. The output distinguishes:

- a numeric restatement from a newly added or removed account;
- a changed account description from a changed value;
- a verified no-change result from a comparison that could not be completed reliably.

### Input

```json
{
  "companyCnpj": "33.228.024/0001-51",
  "baselineYear": 2016,
  "comparisonYear": 2017,
  "referenceMonthDay": "12-31",
  "scope": "con",
  "statements": ["BPA", "BPP", "DRE"],
  "preserveSourceArchives": true
}
```

| Field | Type | Default | Purpose |
| --- | --- | --- | --- |
| `companyCnpj` | string | required | CNPJ exactly as represented in CVM open data |
| `baselineYear` | integer | required | Year containing the original figures |
| `comparisonYear` | integer | required | Immediately following annual filing |
| `referenceMonthDay` | string | `12-31` | Fiscal year-end shared by both filings |
| `scope` | string | `con` | Consolidated (`con`) or individual (`ind`) statements |
| `statements` | string array | BPA, BPP, DRE | Statements included in the comparison |
| `preserveSourceArchives` | boolean | `true` | Save both official archives with the run |
| `timeoutSeconds` | integer | `30` | Timeout for each archive download |
| `maxArchiveBytes` | integer | `40000000` | Maximum accepted size for each archive |

The comparison year must immediately follow the original year. This keeps the period mapping explicit: the original exercise is compared with the same exercise shown as the prior period in the following DFP.

### Output

The Actor writes one report to the default dataset and to the `REPORT` key in the run key-value store.

```json
{
  "schemaVersion": "1.0",
  "recordType": "filing_change_report",
  "status": "verified_change",
  "companyCnpj": "33.228.024/0001-51",
  "baselineYear": 2016,
  "comparisonYear": 2017,
  "difference": {
    "summary": {
      "numericChanges": 36,
      "addedRows": 2,
      "removedRows": 0,
      "descriptionChanges": 1
    }
  }
}
```

Possible statuses:

- `verified_change`: at least one observable difference was found;
- `verified_no_change`: all requested rows matched;
- `rejected`: the requested comparison could not be completed reliably; inspect `error.code` and `error.message`.

Every numeric difference includes the account code and description, old and new values, absolute and percentage change, currency, and scale. Added and removed rows retain their full source identity.

### Source preservation

When `preserveSourceArchives` is enabled, the Actor stores the downloaded archives under `BASELINE_SOURCE` and `COMPARISON_SOURCE`. The report records a SHA-256 hash for each archive, even when preservation is disabled.

The run key-value store groups these records as **Comparison report**, **Original CVM archive**, and **Following CVM archive** so each output remains easy to identify in the Apify Console.

### API and agent use

Run the Actor from Apify Console, REST API, schedules, tasks, or webhooks. The output is deterministic JSON suitable for a human review queue, an audit record, or an agent that must cite the exact source and changed lines.

### Pricing

- **Verified filing comparison:** US$ 0.10 for one completed report with status `verified_change` or `verified_no_change`.
- **Actor start:** US$ 0.00005 per run.
- A report with status `rejected` remains visible for diagnosis and does not trigger the verified-comparison charge.
- Platform usage is included rather than charged separately.

A standard successful run therefore costs US$ 0.10005 before any Apify account-level discounts.

### Boundaries

This Actor identifies observable differences between official filings. It does not determine accounting materiality, explain the economic cause of a change, provide an audit opinion, make an investment or credit recommendation, give legal advice, or allege misconduct.

Coverage is currently limited to annual DFP archives and the BPA, BPP, and DRE statements. Source availability and update timing are controlled by CVM. A first observation cannot reconstruct a file version that is no longer available from the official source unless it was previously preserved.

# Actor input Schema

## `companyCnpj` (type: `string`):

CNPJ exactly as used in CVM open data.

## `baselineYear` (type: `integer`):

Year containing the original figures.

## `comparisonYear` (type: `integer`):

Must immediately follow the original year.

## `referenceMonthDay` (type: `string`):

Month and day used by both filings.

## `scope` (type: `string`):

Consolidated or individual financial statements.

## `statements` (type: `array`):

Balance sheet assets, balance sheet liabilities and equity, and income statement.

## `preserveSourceArchives` (type: `boolean`):

Save both downloaded CVM archives in the run key-value store.

## `timeoutSeconds` (type: `integer`):

Timeout for each official archive download.

## `maxArchiveBytes` (type: `integer`):

Reject an archive that exceeds this size.

## Actor input object example

```json
{
  "companyCnpj": "33.228.024/0001-51",
  "baselineYear": 2016,
  "comparisonYear": 2017,
  "referenceMonthDay": "12-31",
  "scope": "con",
  "statements": [
    "BPA",
    "BPP",
    "DRE"
  ],
  "preserveSourceArchives": true,
  "timeoutSeconds": 30,
  "maxArchiveBytes": 40000000
}
```

# Actor output Schema

## `report` (type: `string`):

The complete report in the default key-value store.

## `results` (type: `string`):

The comparison report as one dataset item.

## `baselineSource` (type: `string`):

Preserved when source preservation is enabled.

## `comparisonSource` (type: `string`):

Preserved when source preservation is enabled.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "companyCnpj": "33.228.024/0001-51",
    "baselineYear": 2016,
    "comparisonYear": 2017
};

// Run the Actor and wait for it to finish
const run = await client.actor("amcbstudio/cvm-filing-change-detector").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "companyCnpj": "33.228.024/0001-51",
    "baselineYear": 2016,
    "comparisonYear": 2017,
}

# Run the Actor and wait for it to finish
run = client.actor("amcbstudio/cvm-filing-change-detector").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "companyCnpj": "33.228.024/0001-51",
  "baselineYear": 2016,
  "comparisonYear": 2017
}' |
apify call amcbstudio/cvm-filing-change-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,amcbstudio/cvm-filing-change-detector"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Oz2CGaCbivgXhx8Qy/builds/t8v5FobN7bff0ujTN/openapi.json
