# Brazil IBS/CBS cClassTrib Table Monitor (`kman-br/cclasstrib-monitor`) Actor

Downloads the official SVRS cClassTrib spreadsheet (IBS/CBS), compares it with the previous version in a key-value store, and returns the diff: new, removed and changed codes (rate or description). Optional full table. Public file, no login. Not a tax calculator.

- **URL**: https://apify.com/kman-br/cclasstrib-monitor.md
- **Developed by:** [Kman](https://apify.com/kman-br) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / official table monitor run

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Brazil IBS/CBS cClassTrib Table Monitor (Monitor cClassTrib)

Watches the **official cClassTrib spreadsheet** (IBS/CBS tax classification codes) published by the SVRS Portal da Conformidade Fácil, compares it with the previous version stored in a named key-value store, and returns a **diff**: codes added, removed, or changed (rate or description). You can also ask for the full current table.

This is **not a tax calculator** and it does not replace assisted assessment or the official one-by-one lookup. The official portal already lets you query a single `cClassTrib`. What this Actor sells is the **version alert** for ERPs, accounting firms and integrators that have to follow the table before the reform deadlines:

- **16/11/2026** — production of NT 2026.005 (IBS/CBS fields for Simples) and the NF-e/NFC-e package
- **14/12/2026** — validation rules (CT-e; the NF-e/NFC-e package also has a 16/11/2026 date)
- **01/12/2026** — DANFE of the reform
- **01/01/2027** — CBS/IBS collection starts

> Independent tool. Not affiliated with, endorsed or sponsored by SVRS, the Receita Federal, the IBS management committee or any Brazilian tax administration. Each run links to the official file.

To **simulate** IBS/CBS scenarios (estimates only, not this table monitor), see [Brazil Tax Reform Calculator - IBS and CBS](https://apify.com/kman-br/brazil-tax-reform-calculator).

### Use cases

- **ERP / issuer update:** detect a new official version (for example IT 2025.002 v1.70 → v1.71) and see exactly which `cClassTrib` codes appeared, disappeared or changed `pRedIBS` / `pRedCBS` or their description, before the 16/11/2026 and 01/01/2027 cutovers.
- **Scheduled watch:** run weekly on the same key-value store; a run with no file change returns `sem_mudanca` and an empty diff.
- **Legal-text follow-up:** description changes (as in the v1.71 “doações e amostras grátis” wording) show up as `categoria: descricao`.
- **Optional snapshot:** turn on `incluirTabelaCompleta` to export every current code with CST, rates, validity dates and the official link.

### Example tasks

The default input (empty form) is enough: download the current official XLSX, compare it with the previous run, write the summary and the diff. Ready-made inputs in `examples/`:

1. **`examples/diff-padrao.json`** — monitor only (default). Suitable for a scheduled run around 16/11/2026, 14/12/2026 and 01/01/2027.
2. **`examples/tabela-completa.json`** — same monitor, plus one dataset item per current `cClassTrib`.

Click Try for free with the empty form, or paste one of those JSON files.

### How it works

1. Reads the public documents page `https://dfe-portal.svrs.rs.gov.br/Cff/Documentos` (no login, no ICP-Brasil certificate). The authenticated Conformidade Fácil API is **out of scope**.
2. Picks the latest official `cClassTrib` XLSX (IT 2025.002 and later versions; `cCredPres` files are ignored).
3. Downloads it from ` /DFE/DownloadArquivoEstatico/` and parses the `cClass` sheet.
4. Compares `CST`, name, description, rate type, `pRedIBS`, `pRedCBS` and validity dates with the snapshot in `estadoStoreName`.
5. First run (`primeira_coleta`) only stores the baseline and does not invent “new” codes. Later runs return `ok` (there is a diff) or `sem_mudanca`.

### Output

| `tipo` | When | Content |
|---|---|---|
| `resumo` | Always | `status`, `versao`, `versao_anterior`, `informe`, `nome_arquivo`, SHA-256, `totais` (current / previous / new / removed / changed), `source_url`, `retrieved_at`, `warnings` |
| `diff` | When there is a change | One item per code: `mudanca` = `novo` | `removido` | `alterado`, `antes` / `depois`, `campos_alterados`, `categoria` (`aliquota`, `descricao`, `aliquota_e_descricao`, `outro`) |
| `codigo` | Only if `incluirTabelaCompleta` | One item per current code, with CST, descriptions, rates, indicators, validity and the official legal link |

Every item has `fonte`, `source_page`, `source_url` and `retrieved_at`. A `RUN_SUMMARY` is also written to the default key-value store. A failed source or a bad input never produces a silent empty green run.

### Input

| Field | Default | Description |
|---|---|---|
| `incluirTabelaCompleta` | `false` | Also emit the full current table |
| `estadoStoreName` | `cclasstrib-monitor-estado` | Named store for the previous snapshot. Keep it stable on scheduled runs |
| `timeoutSecs` | `10` | Timeout for the documents page (5–120). The XLSX download is capped at 10 seconds, or this value if lower. Bodies over 10 MB (XLSX) or 2 MB (HTML) are rejected. |

### Pricing (pay per event)

One event, **`diff-versao`**, **US$ 0.10**, charged once per successful run after the official file is downloaded and parsed (baseline, unchanged, or with a diff). Dataset items are included. Invalid input and source failures are not charged. Automatic `apify-actor-start` and per-item charges must stay at zero.

Compute for two public HTTP GETs and a ~170-row workbook is a fraction of a cent (256 MB, typically under 30 s). The price is set so the run pays for itself. Prices are approved for private use; Store publication is not enabled.

### Limits

- The Actor stops itself after 25 seconds, or 10 seconds before the platform timeout, whichever comes first (`prazo interno`). A failed source is retried at most once, with a short wait, so an uncharged error run stays cheap.
- Only the public static spreadsheet is used. The certificate-authenticated Conformidade Fácil API (`cff.svrs.rs.gov.br`) is not called.
- The official portal may replace the file in place (same name, new bytes) or publish a new version in the file name. Both cases are detected (hash and version).
- This Actor does not calculate IBS/CBS, does not issue a payment slip and does not classify your invoices.

### Privacy and legal

The spreadsheet is official public tax-classification data. No personal data is collected. Using the data is the user's responsibility. This is not legal or tax advice.

**Is it legal?** The Actor downloads only the public file already offered on the documents page, without login or a restricted area.

**Is this from the government?** No. Independent tool, not affiliated with SVRS or the Brazilian government. Each run links to the official source.

### FAQ

**Do I need a login or an ICP-Brasil certificate?** No. The XLSX is a public static file on the documents page. The certificate API is not used.

**Is this a replacement for the official cClassTrib lookup?** No. The official page queries one code at a time. This Actor returns the **diff between official versions**.

**What changed in IT 2025.002 v1.71 (30/10/2026)?** Public commentary on that version described wording changes (for example donations / free samples) without adding or removing codes. When that happens, the Actor reports `alterado` with `categoria: descricao`. Always check the official file.

**Why do I pay if nothing changed?** The run still has to download and parse the official file to know that. Use a weekly schedule, or run around the 16/11/2026, 14/12/2026 and 01/01/2027 dates.

**How do I export to Excel or JSON?** Use the dataset export on the run page, or the Apify API.

***

## Monitor da tabela oficial cClassTrib (IBS/CBS)

Acompanha a **planilha oficial cClassTrib** (códigos de classificação tributária do IBS e da CBS) publicada no Portal da Conformidade Fácil da SVRS, compara com a versão anterior guardada em um key-value store nomeado e devolve um **diff**: códigos incluídos, excluídos ou alterados (alíquota ou descrição). Também pode devolver a tabela completa da versão atual.

**Não é calculadora de imposto** e não substitui a apuração assistida nem a consulta oficial um a um. O portal já consulta um `cClassTrib` por vez. O que este Actor vende é o **alerta de versão** para ERP, escritório e integrador que precisam acompanhar a tabela antes dos prazos da reforma:

- **16/11/2026** — produção da NT 2026.005 (campos IBS/CBS do Simples) e o pacote da NF-e/NFC-e
- **14/12/2026** — regras de validação (CT-e; o pacote da NF-e/NFC-e também tem data em 16/11/2026)
- **01/12/2026** — DANFE da reforma
- **01/01/2027** — início da cobrança de CBS/IBS

> Ferramenta independente. Sem vínculo, endosso ou patrocínio da SVRS, da Receita Federal, do comitê gestor do IBS ou de qualquer administração tributária. Cada run traz o link do arquivo oficial.

Para **simular** cenários de IBS/CBS (só estimativa, não é este monitor), veja o [Brazil Tax Reform Calculator - IBS and CBS](https://apify.com/kman-br/brazil-tax-reform-calculator).

### Casos de uso

- **Atualização de ERP / emissor:** detectar uma versão oficial nova (por exemplo IT 2025.002 v1.70 → v1.71) e ver exatamente quais códigos `cClassTrib` entraram, saíram ou mudaram `pRedIBS` / `pRedCBS` ou a descrição, antes dos cortes de 16/11/2026 e 01/01/2027.
- **Monitoramento agendado:** rode semanalmente no mesmo key-value store; um run sem mudança no arquivo devolve `sem_mudanca` e diff vazio.
- **Acompanhamento de redação:** mudanças de descrição (como “doações e amostras grátis” na v1.71) aparecem como `categoria: descricao`.
- **Retrato opcional:** ligue `incluirTabelaCompleta` para exportar todos os códigos atuais com CST, alíquotas, vigência e o link oficial.

### Exemplos prontos

O input padrão (formulário vazio) basta: baixa o XLSX oficial, compara com o run anterior, grava o resumo e o diff. Inputs prontos em `examples/`:

1. **`examples/diff-padrao.json`** — só o monitor (padrão). Serve para um run agendado em torno de 16/11/2026, 14/12/2026 e 01/01/2027.
2. **`examples/tabela-completa.json`** — o mesmo monitor, mais um item no dataset por `cClassTrib` atual.

### Como funciona

1. Lê a página pública de documentos `https://dfe-portal.svrs.rs.gov.br/Cff/Documentos` (sem login e sem certificado ICP-Brasil). A API autenticada do Conformidade Fácil **fica fora**.
2. Escolhe o XLSX oficial mais recente de `cClassTrib` (IT 2025.002 e versões seguintes; arquivos de `cCredPres` são ignorados).
3. Baixa em `/DFE/DownloadArquivoEstatico/` e lê a aba `cClass`.
4. Compara CST, nome, descrição, tipo de alíquota, `pRedIBS`, `pRedCBS` e vigência com o retrato em `estadoStoreName`.
5. O primeiro run (`primeira_coleta`) só grava a base e não inventa códigos “novos”. Os seguintes devolvem `ok` (houve diff) ou `sem_mudanca`.

### Saída, entrada, preço e limites

Os campos, a tabela de saída, o preço proposto e os limites são os mesmos da seção em inglês. Evento **`diff-versao`**: **US$ 0,10** por run bem-sucedido (base, sem mudança ou com diff). Input inválido e falha da fonte não são cobrados. Preço aprovado para uso privado; publicação na Store não está habilitada.

### Privacidade e legalidade

A planilha é dado público oficial de classificação tributária. Nenhum dado pessoal é coletado. O uso é responsabilidade de quem usa. Não é aconselhamento jurídico nem fiscal.

**É legal?** O Actor baixa só o arquivo público já oferecido na página de documentos, sem login e sem área restrita.

**Isso é do governo?** Não. Ferramenta independente, sem afiliação com a SVRS ou o governo brasileiro. Cada run traz o link da fonte oficial.

### Perguntas frequentes

**Preciso de login ou certificado ICP-Brasil?** Não. O XLSX é um arquivo estático público na página de documentos. A API com certificado não é usada.

**Isso substitui a consulta oficial de cClassTrib?** Não. A página oficial consulta um código por vez. Este Actor devolve o **diff entre versões oficiais**.

**O que mudou no IT 2025.002 v1.71 (30/10/2026)?** Comentários públicos sobre essa versão descreveram mudanças de redação (por exemplo doações / amostras grátis), sem inclusão ou exclusão de códigos. Nesse caso o Actor aponta `alterado` com `categoria: descricao`. Confira sempre o arquivo oficial.

**Por que pago se nada mudou?** O run ainda precisa baixar e ler o arquivo oficial para saber disso. Use agenda semanal, ou rode perto de 16/11/2026, 14/12/2026 e 01/01/2027.

**Como exportar para Excel ou JSON?** Pela exportação do dataset na página da execução, ou pela API da Apify.

### Related Actors

- [Brazil Tax Reform Calculator - IBS and CBS](https://apify.com/kman-br/brazil-tax-reform-calculator): simula cenários da reforma com cálculo passo a passo, premissas com fonte e avisos de que é estimativa. Não substitui este monitor de versões.
- [Brazil CNPJ Bulk Lookup - Receita Federal (CNPJ em Lote)](https://apify.com/kman-br/cnpj-lote): consulta CNPJ em lote nos dados abertos da Receita Federal. Só pessoa jurídica, sem sócios nem contatos.

Browse the full catalog: [kman-br.github.io](https://kman-br.github.io/) ([Português](https://kman-br.github.io/pt/)).

# Actor input Schema

## `incluirTabelaCompleta` (type: `boolean`):

Se ligado, além do resumo e do diff, grava um item por cClassTrib da versão atual. A tabela oficial tem da ordem de 170 códigos; o evento cobrado continua sendo um por run.

## `estadoStoreName` (type: `string`):

Store nomeado que guarda a versão anterior (hash, arquivo e campos comparados). Use o mesmo nome entre runs agendados.

## `timeoutSecs` (type: `integer`):

Tempo máximo da página de documentos, incluindo a leitura da resposta. O download do XLSX usa no máximo 10 s, ou este valor se for menor.

## Actor input object example

```json
{
  "incluirTabelaCompleta": false,
  "estadoStoreName": "cclasstrib-monitor-estado",
  "timeoutSecs": 10
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

RUN_SUMMARY: status, versions, counts, charged events.

# 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 = {
    "incluirTabelaCompleta": false,
    "estadoStoreName": "cclasstrib-monitor-estado",
    "timeoutSecs": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/cclasstrib-monitor").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 = {
    "incluirTabelaCompleta": False,
    "estadoStoreName": "cclasstrib-monitor-estado",
    "timeoutSecs": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("kman-br/cclasstrib-monitor").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 '{
  "incluirTabelaCompleta": false,
  "estadoStoreName": "cclasstrib-monitor-estado",
  "timeoutSecs": 10
}' |
apify call kman-br/cclasstrib-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kman-br/cclasstrib-monitor"
        }
    }
}
```

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/go9m4rcURMqsls9Au/builds/dxFGPFVYZjTc1aaG7/openapi.json
