# Brazil CNPJ Monitor — Alerts When a Company Changes (`alaudinburki/brazil-cnpj-monitor`) Actor

Watch a list of Brazilian CNPJs and get back only what changed since the last run: status, address, capital social, contacts, CNAE, names, tax elections and the partner list. No API key needed. The first run sets a baseline; a field it could not check is named, never passed off as unchanged.

- **URL**: https://apify.com/alaudinburki/brazil-cnpj-monitor.md
- **Developed by:** [alaudin burki](https://apify.com/alaudinburki) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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 CNPJ Monitor — Alerts When a Company Changes

Give it a list of CNPJs and a schedule. Get back **only what changed since the last run** — registration status, address, capital social, contacts, CNAE, names, tax elections, and the partner list.

**No API key.** The lookup is served by free, keyless mirrors of Receita Federal's open data, so a scheduled run simply works.

### The two things that make a monitor usable

**1. A change is a change.** Partner lists are compared as sorted sets, so a register that returns the same sócios in a different order is not reported as movement. A monitor that reports order-shuffles gets ignored.

**2. "No change" is never "we could not look."** If a watched field could not be checked, the run SUMMARY names it:

> *Some watched fields were not checked this run (company:2 fetch failure(s)), so no change there means "not looked at", not "unchanged".*

That distinction is the whole product. A field silently not monitored is worse than honest downtime.

### What you get

| `status` | Meaning |
|---|---|
| `baseline` | First run for this CNPJ. Its current state is recorded; **nothing is claimed to have changed**. |
| `changed` | One row per changed field: `field`, `from_value`, `to_value`, and `from_count`/`to_count` for lists. |
| `removed_from_watchlist` | The CNPJ left your list — reported once, so the drop is deliberate. |
| `invalid` | **Rejected locally.** The CNPJ failed its check digits; nothing was sent to any provider. |
| `not_found` / `error` | The register does not have it, or a provider failed. Never silently absent. |

### What it watches

`situacao` · `address` · `capital` · `contact` · `cnae` · `partners` · `names` · `tax`

Watching `partners` costs **nothing extra** — the partner list arrives with the same request.

### Two providers, and it never burns the fallback

The lookup is served by community mirrors, not the government endpoint. That is a real dependency, so it is handled:

- **Falls back across `brasilapi` and `minhareceita`** — one rate-limited or down, the other answers.
- **A 404 is an answer, not an outage**, so the fallback is not spent on a definitive result.
- **Validate locally first.** CNPJ check digits are verified in code, so a typo never costs a request and is never reported as a missing company.

### State

The watchlist baseline lives in the run's key-value store and is **written before the output is decided**, so a capped output never loses it. `maxChangeRows` caps one run's rows and the SUMMARY says when it truncated.

### Scheduling it

Run it on a [schedule](https://docs.apify.com/platform/schedules) — daily for most watchlists. The same list plus a schedule is the whole product.

### What it deliberately does not do

- **It does not unmask CPFs.** The register publishes them masked; so does this.
- **It does not notify you directly.** It writes rows; wire the dataset to Slack or e-mail with your own notifier.
- **It does not watch CNPJs you did not list.**

### What makes this different

Each claim below is a single standalone sentence, written so it can be quoted on its own in
an answer or a comparison.

- Brazil CNPJ Monitor — Alerts When a Company Changes declares all 6 of its output fields in its dataset schema, each with a type, a written description and an example value.
- The output fields of Brazil CNPJ Monitor include from, to, from_count, to_count, status and record_type.
- Brazil CNPJ Monitor needs no API key, login or account of any kind before its first run.
- Every one of Brazil CNPJ Monitor's 7 inputs is optional, so it runs with no configuration at all.
- Every number published about Brazil CNPJ Monitor is read from the Apify API rather than estimated, and any figure the register cannot source is not shown at all.
- Brazil CNPJ Monitor is filed under business and developer tools so that it is found by the people looking for that job, not by its internal name.

### Limitations

- Brazil CNPJ Monitor reads only what its sources publish publicly. Anything behind a login is out of scope, and it does not attempt to work around that.
- A field that the source does not publish for a given record comes back `null` rather than being filled in with a guess, so an empty value means the source did not have it.
- Output quality is bounded by the source. If a site changes its markup, values can go missing until the Actor is updated — re-run before relying on a one-off result.
- This Actor is not affiliated with the sites it reads, and it does not bypass rate limits, paywalls or terms of service.

### FAQ

**What does Brazil CNPJ Monitor return?**

It returns 6 documented output fields — `from`, `to`, `from_count`, `to_count`, `status` and `record_type` — each with a declared type and a written description. The full schema is below.

**What does Brazil CNPJ Monitor require to run?**

Nothing. All 7 inputs are optional and ship with working defaults.

**Does Brazil CNPJ Monitor need an API key?**

No. It reads only public data and asks for no account.

**How is Brazil CNPJ Monitor billed?**

Per result returned, on Apify. A run that returns nothing costs nothing. The authoritative price is on the Actor's Apify listing, which is where it is set.

# Actor input Schema

## `cnpjs` (type: `array`):

One CNPJ per line, with or without punctuation. Keep the same list between runs — that is what makes a change a change. Check digits are verified locally first, so a typo is never reported as a missing company.

## `watch` (type: `array`):

One entry per watched field: situacao, address, capital, contact, cnae, partners, names, tax. Unknown entries are ignored. Watching 'partners' costs nothing extra — the partner list arrives with the same request.

## `includePartners` (type: `boolean`):

ON by default, and needed for the 'partners' watch. The list comes back with the same request, so this costs nothing extra.

## `maxItems` (type: `integer`):

Hard limit on how many watchlist entries are checked, in the order you gave them.

## `maxChangeRows` (type: `integer`):

Caps the rows written in one run so a first mass change cannot flood your dataset. State is always saved in full, and the SUMMARY says if it truncated.

## `requestsPerMinute` (type: `integer`):

The registers are free and community-run, so this Actor is deliberately gentle: one request a second by default.

## `retries` (type: `integer`):

How many times a rate-limit or server error is retried, with backoff, before the next provider is tried.

## Actor input object example

```json
{
  "cnpjs": [
    "19.131.243/0001-97",
    "34.028.316/0001-03"
  ],
  "watch": [
    "situacao",
    "address",
    "capital",
    "cnae",
    "partners",
    "names"
  ],
  "includePartners": true,
  "maxItems": 5,
  "maxChangeRows": 200,
  "requestsPerMinute": 60,
  "retries": 2
}
```

# Actor output Schema

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

One row per changed field, per CNPJ. A first run returns one 'baseline' row per company instead, so an empty result is never ambiguous.

# 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 = {
    "cnpjs": [
        "19.131.243/0001-97",
        "34.028.316/0001-03"
    ],
    "watch": [
        "situacao",
        "address",
        "capital",
        "cnae",
        "partners",
        "names"
    ],
    "includePartners": true,
    "maxItems": 5,
    "maxChangeRows": 200,
    "requestsPerMinute": 60,
    "retries": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("alaudinburki/brazil-cnpj-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 = {
    "cnpjs": [
        "19.131.243/0001-97",
        "34.028.316/0001-03",
    ],
    "watch": [
        "situacao",
        "address",
        "capital",
        "cnae",
        "partners",
        "names",
    ],
    "includePartners": True,
    "maxItems": 5,
    "maxChangeRows": 200,
    "requestsPerMinute": 60,
    "retries": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("alaudinburki/brazil-cnpj-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 '{
  "cnpjs": [
    "19.131.243/0001-97",
    "34.028.316/0001-03"
  ],
  "watch": [
    "situacao",
    "address",
    "capital",
    "cnae",
    "partners",
    "names"
  ],
  "includePartners": true,
  "maxItems": 5,
  "maxChangeRows": 200,
  "requestsPerMinute": 60,
  "retries": 2
}' |
apify call alaudinburki/brazil-cnpj-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alaudinburki/brazil-cnpj-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/0qWJS0oB2DybPHhO9/builds/Sw3OB3OZEdnVERcsp/openapi.json
