# Consulta CNPJ em lote — Receita Federal e monitoramento (`boliveira/cnpj-empresas`) Actor

Consulte milhares de CNPJs de uma vez: razão social, situação cadastral, CNAEs, porte, capital, Simples/MEI e endereço, a partir dos dados abertos da Receita Federal, com modo de monitoramento que retorna só empresas alteradas. Brazil CNPJ bulk lookup.

- **URL**: https://apify.com/boliveira/cnpj-empresas.md
- **Developed by:** [Bruno Scherer Oliveira](https://apify.com/boliveira) (community)
- **Categories:** Business, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.85 / 1,000 empresa retornadas

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

## Consulta CNPJ em lote — Receita Federal e monitoramento

Consulte **milhares de CNPJs de uma vez** e receba os dados cadastrais limpos e normalizados: **razão social, nome
fantasia, situação cadastral (e data/motivo), data de abertura e idade, natureza jurídica, porte, capital social,
CNAE principal e secundários, Simples Nacional, MEI, regime tributário e endereço completo com código IBGE**.
Os dados vêm dos **dados abertos da Receita Federal**.

Com **"Monitorar mudanças"**, agende a execução (diária ou semanal) e receba **apenas os CNPJs que mudaram** —
empresa baixada, suspensa ou inapta, mudança de endereço, saída do Simples, novo CNAE. Ideal para acompanhar
fornecedores, clientes e carteiras de crédito.

*English below.*

### Para que serve

- **Due diligence e cadastro de fornecedores/clientes**: validar situação cadastral e CNAE em lote.
- **Monitoramento de carteira**: alertas quando uma empresa da sua lista muda de situação.
- **Enriquecimento de CRM e planilhas**: porte, atividade, endereço e regime a partir de uma coluna de CNPJs.
- **Crédito, compliance e fiscal**: Simples/MEI, capital social, idade da empresa.

### Entrada

```json
{
  "cnpjs": ["33.683.111/0002-80", "00000000000191"],
  "cnpjText": "60.701.190/0001-04\n45.997.418/0001-53",
  "activeOnly": false,
  "changesOnly": true
}
```

CNPJs com dígito verificador inválido são descartados antes da consulta e **não são cobrados**; CNPJs inexistentes
também não.

### Saída (exemplo)

```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",
  "openedDate": "1966-08-01",
  "ageYears": 60,
  "legalNature": "Sociedade de Economia Mista",
  "size": "DEMAIS",
  "shareCapital": 120000000000,
  "mainActivityCode": "6422100",
  "mainActivity": "Bancos múltiplos, com carteira comercial",
  "secondaryActivities": [{ "code": "6499999", "description": "…" }],
  "simplesNacional": false,
  "mei": false,
  "isSoleTrader": false,
  "address": { "street": "QUADRA SAUN QUADRA 5 BLOCO B", "city": "BRASILIA", "state": "DF", "postalCode": "70040912", "ibgeCode": "5300108" },
  "phone1": "6134939002",
  "taxRegimes": [{ "year": 2016, "regime": "LUCRO REAL" }],
  "change": "first_seen",
  "source": "Receita Federal (dados abertos) via minhareceita.org"
}
```

### Privacidade (LGPD)

Este Actor **não retorna o quadro societário (QSA)** nem dados de sócios. Para empresários individuais e MEIs, cujos
contatos cadastrais costumam ser pessoais, **e-mail e telefones são omitidos**. Ele apenas consulta os CNPJs que
você informa — não gera listas de pessoas.

### Preço

Pagamento por evento: você paga por empresa retornada. CNPJs inválidos, inexistentes, filtrados ou sem mudança
(modo monitoramento) não são cobrados.

### Fonte e uso justo

Dados abertos da Receita Federal, consultados pela API aberta e gratuita do projeto
[Minha Receita](https://minhareceita.org) (a ~1 consulta por segundo). Se este Actor for útil para você, considere
apoiar o projeto Minha Receita. Não é afiliado à Receita Federal nem ao Minha Receita.

***

### English

Bulk-look up Brazilian companies by CNPJ (tax ID) using Receita Federal open data: legal and trade name,
registration status, opening date, legal nature, size, share capital, main and secondary CNAE activities, Simples
Nacional/MEI, tax regime and full address. Turn on **change monitoring** and schedule it to receive only companies
whose registration changed since the last run. No partner (QSA) data is returned. Pay per company returned; invalid,
missing or unchanged CNPJs are never charged.

# Actor input Schema

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

Lista de CNPJs, com ou sem pontuação (ex.: 33.683.111/0002-80). CNPJs inválidos são ignorados e não cobrados. List of Brazilian company tax IDs.

## `cnpjText` (type: `string`):

Alternativa para colar uma lista grande de uma planilha. Paste a list from a spreadsheet.

## `activeOnly` (type: `boolean`):

Omite empresas baixadas, suspensas, inaptas ou nulas.

## `changesOnly` (type: `boolean`):

Guarda o estado de cada CNPJ entre execuções e retorna apenas os que mudaram (situação cadastral, razão social, endereço, Simples/MEI, CNAE, capital) ou que aparecem pela primeira vez. Ideal para monitoramento agendado de fornecedores e clientes.

## Actor input object example

```json
{
  "cnpjs": [
    "33.683.111/0002-80",
    "00.000.000/0001-91"
  ],
  "activeOnly": false,
  "changesOnly": false
}
```

# Actor output Schema

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

Dataset with one normalised company record per CNPJ (status, activities, size, Simples/MEI, address).

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

RUN_SUMMARY record: counts, invalid and not-found CNPJs.

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

// Run the Actor and wait for it to finish
const run = await client.actor("boliveira/cnpj-empresas").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": [
        "33.683.111/0002-80",
        "00.000.000/0001-91",
    ] }

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

```

## MCP server setup

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

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/ePkd0G2trBJiJMs2P/builds/gcF9ke0nz5ewodkKN/openapi.json
