# Brazil CNPJ Lookup & Monitor (Receita Federal company data) (`rodrigon/brazil-cnpj-lookup`) Actor

Look up Brazilian companies by CNPJ in bulk from Receita Federal open data (via BrasilAPI / Minha Receita): legal name, status, CNAE, address, Simples/MEI, capital and partners (QSA). Free CNPJ validation, change monitor. No captcha bypass; LGPD-aware, not for spam.

- **URL**: https://apify.com/rodrigon/brazil-cnpj-lookup.md
- **Developed by:** [RODRIGO](https://apify.com/rodrigon) (community)
- **Categories:** Business, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 company founds

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 Lookup & Monitor

**Look up Brazilian companies by CNPJ in bulk** and get clean, English-named fields from the Receita Federal open data: legal and trade name, registration status, opening date, CNAE activities, full address, phones, e-mail, Simples Nacional / MEI, share capital, tax regime and partners (QSA).

🇧🇷 *Versão em português abaixo.*

### Why this Actor

- ✅ **Free validation** – CNPJs with a wrong check digit are flagged as `INVALID_CNPJ` and **never charged**.
- 🔤 **Ready for the new alphanumeric CNPJ** (Receita Federal, July 2026), e.g. `12.ABC.345/01DE-35`.
- 🔁 **Multiple open sources with automatic fallback and retries** (BrasilAPI → Minha Receita), so one source being down does not ruin your run.
- 🔔 **Change monitor** – schedule the Actor and get a `changes` list per company (status, address, partners, activities, Simples/MEI…). Turn on *Output only changed companies* to pay only for what changed.
- 💸 **You pay only for companies found.** Not found, invalid and failed lookups are free.

### Input

| Field | Description |
|---|---|
| `cnpjs` | List of CNPJs, with or without punctuation. Duplicates are removed. |
| `includePartners` | Include partners / shareholders (QSA). Default `true`. |
| `monitorChanges` | Remember results between runs and output a `changes` field. |
| `onlyChanged` | With monitoring, output only new or changed companies. |
| `maxConcurrency` | Parallel lookups (1–10, default 4). |

```json
{ "cnpjs": ["00.000.000/0001-91", "33000167000101"], "includePartners": true }
```

### Output (one item per CNPJ)

```json
{
  "cnpj": "00000000000191",
  "cnpjFormatted": "00.000.000/0001-91",
  "legalName": "BANCO DO BRASIL SA",
  "tradeName": "DIRECAO GERAL",
  "branchType": "MATRIZ",
  "status": "ATIVA",
  "statusDate": "2005-11-03",
  "openingDate": "1966-08-01",
  "legalNature": "Sociedade de Economia Mista",
  "companySize": "DEMAIS",
  "shareCapital": 120000000000,
  "mainActivity": { "code": "6422100", "description": "Bancos múltiplos, com carteira comercial" },
  "secondaryActivities": [{ "code": "6423900", "description": "Caixas econômicas" }],
  "street": "SAUS QUADRA 5 BLOCO B TORRE I, II, III",
  "number": "1",
  "neighborhood": "ASA NORTE",
  "city": "BRASILIA",
  "state": "DF",
  "zipCode": "70040912",
  "phones": ["6134939002"],
  "email": "secex@bb.com.br",
  "simplesNacional": { "optedIn": false, "optInDate": null, "exclusionDate": null },
  "mei": { "optedIn": false, "optInDate": null, "exclusionDate": null },
  "partners": [{ "name": "…", "qualification": "Presidente", "entryDate": "2023-01-16", "ageRange": "Entre 41 a 50 anos" }],
  "lookupStatus": "OK",
  "source": "brasilapi",
  "fetchedAt": "2026-10-05T02:00:00.000Z"
}
```

`lookupStatus` is one of `OK`, `NOT_FOUND`, `INVALID_CNPJ`, `ERROR`. Only `OK` items are charged.

### Pricing

Pay per event: a small start fee plus a fee per **company found**. See the *Pricing* tab.

### Use cases

KYC and supplier onboarding, due diligence, CRM data clean-up, compliance monitoring of customers and suppliers (status changes, partner changes), B2B market research.

### Data source and legality

- **Source:** the official CNPJ open dataset published by Receita Federal (*Dados Abertos do CNPJ*, open government data free for any use, including commercial), served by two free open-source public APIs: [BrasilAPI](https://brasilapi.com.br) and [Minha Receita](https://minhareceita.org). Neither publishes terms forbidding commercial use.
- **No scraping of Receita Federal's website and no captcha solving.** The Actor never touches the Receita's consultation pages.
- **Polite rate:** at most ~3 requests per second in total, with retries and back-off on errors.
- **Personal data (LGPD):** partner names and the e-mail/phone of sole proprietors are personal data even though they are public. You are the data controller of what you do with the results: use them only for a legitimate purpose (KYC, due diligence, supplier checks, B2B research) under the LGPD (Lei 13.709/2018). **Do not use this Actor for spam or mass cold e-mail/phone/WhatsApp campaigns.** Turn off *Include partners* if you do not need them.

***

## 🇧🇷 Consulta e Monitor de CNPJ

**Consulte empresas brasileiras por CNPJ em lote**: razão social, nome fantasia, situação cadastral, data de abertura, CNAE principal e secundários, endereço completo, telefones, e-mail, Simples Nacional / MEI, capital social, regime tributário e quadro de sócios (QSA), a partir dos dados abertos da Receita Federal.

### Diferenciais

- ✅ **Validação grátis**: CNPJ com dígito errado sai como `INVALID_CNPJ` e **não é cobrado**.
- 🔤 **Pronto para o CNPJ alfanumérico** (Receita Federal, julho de 2026).
- 🔁 **Várias fontes abertas com fallback automático** (BrasilAPI → Minha Receita).
- 🔔 **Monitor de alterações**: agende o Actor e receba o campo `changes` com o que mudou (situação, endereço, sócios, atividades, Simples/MEI…). Com *Output only changed companies*, você paga só pelo que mudou.
- 💸 **Você paga só pelas empresas encontradas.** Não encontrado, inválido ou erro não são cobrados.

### Como usar

1. Cole a lista de CNPJs no campo **CNPJs** (com ou sem pontuação).
2. Clique em **Start**.
3. Baixe o resultado em Excel, CSV ou JSON, ou integre pela API.

Para monitorar uma carteira de clientes ou fornecedores, ligue **Monitor changes between runs** e crie um agendamento (Schedule) diário ou semanal.

### Fonte, legalidade e LGPD

- **Fonte:** dados abertos do CNPJ publicados pela Receita Federal (dados abertos governamentais, livres inclusive para uso comercial), servidos pelas APIs públicas e de código aberto [BrasilAPI](https://brasilapi.com.br) e [Minha Receita](https://minhareceita.org), que não proíbem uso comercial.
- **Não acessa o site da Receita e não quebra captcha.**
- **Ritmo educado:** no máximo cerca de 3 consultas por segundo no total, com novas tentativas espaçadas em caso de erro.
- **LGPD:** nome de sócios e e-mail/telefone de empresários individuais são dados pessoais, mesmo sendo públicos. Quem usa o resultado é o controlador: use só para finalidade legítima (cadastro de clientes e fornecedores, due diligence, compliance, pesquisa B2B). **Não use para spam nem disparo em massa de e-mail, telefone ou WhatsApp.** Desligue *Include partners* se não precisar dos sócios.

# Actor input Schema

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

List of CNPJs (14 digits, with or without punctuation). Invalid CNPJs are reported but never charged. / Lista de CNPJs, com ou sem pontuação.

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

Include the list of partners/shareholders published by Receita Federal. / Incluir quadro de sócios.

## `monitorChanges` (type: `boolean`):

Remember each company in a key-value store of your account and add a 'changes' field listing what changed since the previous run (status, address, partners, activities...). Ideal for scheduled runs. / Compara com a execução anterior.

## `onlyChanged` (type: `boolean`):

With monitoring on, only companies that changed (or are new) are written and charged.

## `maxConcurrency` (type: `integer`):

Parallel lookups. Public sources rate-limit, so keep it low.

## Actor input object example

```json
{
  "cnpjs": [
    "00.000.000/0001-91",
    "33.000.167/0001-01"
  ],
  "includePartners": true,
  "monitorChanges": false,
  "onlyChanged": false,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

# 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": [
        "00.000.000/0001-91",
        "33.000.167/0001-01"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rodrigon/brazil-cnpj-lookup").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": [
        "00.000.000/0001-91",
        "33.000.167/0001-01",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rodrigon/brazil-cnpj-lookup").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": [
    "00.000.000/0001-91",
    "33.000.167/0001-01"
  ]
}' |
apify call rodrigon/brazil-cnpj-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rodrigon/brazil-cnpj-lookup"
        }
    }
}
```

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/MfFAE29m7tiwL1cOG/builds/xpiuGaRO9Dtn25UjL/openapi.json
