# Brazil CNPJ Bulk Lookup - Receita Federal (CNPJ em Lote) (`kman-br/cnpj-lote`) Actor

Consulta uma lista de CNPJs nos dados abertos da Receita Federal (via minhareceita.org) e devolve só pessoa jurídica: situação, natureza jurídica, porte, CNAE, Simples e município. Sem sócios, endereço, e-mail ou telefone; MEI, EI e pessoa física são descartados.

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

## Pricing

Pay per event

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 Batch Lookup — companies only, no partners (CNPJ em lote)

Look up a list of Brazilian CNPJs in the Federal Revenue open data and get **only legal-entity (PJ) data**: registration status, legal nature, size, main and secondary CNAE, Simples option, city and IBGE code. No partners (QSA), no street address, no e-mail, no phone. Sole proprietors (MEI/EI) and natural persons are discarded.

> Independent tool. Not affiliated with, endorsed or sponsored by the Receita Federal or the minhareceita.org project.
>
> Data source: **Receita Federal, dados abertos CNPJ, via minhareceita.org** (Creative Commons Attribution license; monthly update; no SLA).

### How it works

- One `GET https://minhareceita.org/<cnpj>` per valid CNPJ, at most 2 connections, at least 300 ms between requests on each connection, and capped backoff on 429/5xx.
- CNPJs are de-duplicated, accepted with or without mask (including the new alphanumeric format), and checked by their verification digits. Up to 500 per run (enforced in code).
- Output is built from a fixed **allow-list** of fields; anything new in the source is ignored.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `cnpjs` | string\[] | — | Required. Max 500 unique CNPJs per run. |
| `incluirCnaesSecundarios` | boolean | `false` | Adds secondary CNAEs. |

### Output

Status `ok`: `cnpj`, `razao_social`, `nome_fantasia`, `situacao_cadastral`, `data_situacao_cadastral`, `motivo_situacao`, `data_inicio_atividade`, `natureza_juridica {codigo, descricao}`, `porte`, `capital_social`, `cnae_principal {codigo, descricao}`, `cnaes_secundarios`, `opcao_pelo_simples`, `matriz_filial`, `municipio`, `codigo_ibge`, `uf`, `fonte`, `source_url`, `retrieved_at`, `warnings`, `status`.

Other statuses (never charged): `invalido` (wrong check digits), `excluido` (only `{cnpj, status, motivo}`), `nao_encontrado`, `erro` (source unavailable). `RUN_SUMMARY` has counts per status, stop reason and charged events.

### Pricing (pay per event)

| Event | When | Price |
|---|---|---|
| `inicio-run` | Once per run, after the input is validated | US$0.01 |
| `cnpj-consultado` | Each item with status `ok` (a legal entity) | US$0.0015 |

Invalid input, invalid, excluded, not-found and error items are never charged. Your maximum charge per run is respected.

### Privacy (LGPD)

A CNPJ is discarded, and returns only `{cnpj, status: "excluido", motivo}`, when **any** of these is true:

1. MEI option is on (`opcao_pelo_mei` true, or MEI option date without exclusion date);
2. legal nature is 213-5 (Individual Entrepreneur), 230-5 or 231-3 (EIRELI), 232-1 (single-member law firm), or any group-4 code (natural persons) — Concla/IBGE 2021 table;
3. the company name contains an 11-digit sequence that passes the CPF check (older MEI names carried the owner's CPF).

Missing or unknown legal nature is also discarded (`motivo: natureza_desconhecida`). Partners, legal representatives, street address, e-mail and phone are never returned. **Do not use this data for marketing to natural persons.** Removal or correction requests: e-mail **kman90048@gmail.com** (include the CNPJ).

**Legal basis and scope.** Only public company registration data from the Receita Federal open data (CC-BY) is returned. Partners and their CPFs, legal representatives, street address, personal e-mails and phones are never collected into the output, and there is no option to include contact data.

### FAQ

**Is it legal?** CNPJ data is published by the Receita Federal as open data under a Creative Commons Attribution license, and minhareceita.org states its API is open and free with no usage limit. LGPD does not apply to legal entities; the residual risk (a person's name inside an LTDA company name) is a legally required public business name, and every lookup starts from a CNPJ, never from a person. You remain responsible for your own use of the data.

**Why was my CNPJ excluded?** It is an MEI, an individual entrepreneur, a natural-person registration, or its legal nature could not be confirmed.

***

## CNPJ em lote — só PJ, sem sócios (português)

Consulta uma lista de CNPJs nos dados abertos da Receita Federal e devolve **só dados de pessoa jurídica**: situação cadastral, natureza jurídica, porte, CNAE principal e secundários, opção pelo Simples, município e código IBGE. Sem sócios (QSA), sem endereço, sem e-mail e sem telefone. MEI, empresário individual e pessoa física são descartados.

> Ferramenta independente. Sem vínculo, endosso ou patrocínio da Receita Federal ou do projeto minhareceita.org.
>
> Fonte: **Receita Federal, dados abertos CNPJ, via minhareceita.org** (licença Creative Commons Atribuição; atualização mensal; sem SLA).

### Como funciona

- Um `GET https://minhareceita.org/<cnpj>` por CNPJ válido, no máximo 2 conexões, pelo menos 300 ms entre requisições em cada conexão e backoff com teto em 429/5xx.
- Os CNPJs são deduplicados, aceitos com ou sem máscara (inclusive no novo formato alfanumérico) e conferidos pelo dígito verificador. Até 500 por run (limite no código).
- A saída é montada por uma **lista fixa de campos permitidos**; campo novo na fonte é ignorado.

### Entrada

- `cnpjs`: lista obrigatória, até 500 CNPJs únicos por run.
- `incluirCnaesSecundarios`: padrão `false`.

### Saída

Item `ok` com os campos listados na seção em inglês. Outros status, nunca cobrados: `invalido` (DV errado), `excluido` (só `{cnpj, status, motivo}`), `nao_encontrado` e `erro` (fonte fora do ar). O `RUN_SUMMARY` traz a contagem por status, o motivo de parada e os eventos cobrados.

### Custo

Evento `inicio-run` (uma vez por run, depois de validar o input): US$0,01. Evento `cnpj-consultado` (cada item `ok`, uma PJ): US$0,0015. Input inválido e itens inválidos, excluídos, não encontrados ou com erro não são cobrados. O teto de gasto do run é respeitado.

### Privacidade (LGPD)

O CNPJ é descartado, e sai só `{cnpj, status: "excluido", motivo}`, quando **qualquer** uma destas condições vale:

1. opção pelo MEI ativa (`opcao_pelo_mei` verdadeiro, ou data de opção sem data de exclusão);
2. natureza jurídica 213-5 (Empresário Individual), 230-5 ou 231-3 (EIRELI), 232-1 (Sociedade Unipessoal de Advocacia) ou qualquer código do grupo 4 (pessoas físicas), conforme a Tabela de Natureza Jurídica 2021 da Concla/IBGE;
3. a razão social contém 11 dígitos que passam no DV de CPF (até 12/12/2022 o nome do MEI levava o CPF do titular).

Natureza jurídica ausente ou desconhecida também é descartada (`motivo: natureza_desconhecida`). Sócios, representantes, endereço, e-mail e telefone nunca saem. **Não use estes dados para marketing a pessoa física.** Pedidos de remoção ou correção: e-mail para **kman90048@gmail.com** (informe o CNPJ).

**Base e escopo.** Só saem dados cadastrais públicos de pessoa jurídica dos dados abertos da Receita Federal (CC-BY). Sócios e seus CPFs, representantes, endereço, e-mails e telefones pessoais nunca saem, e não existe opção para incluir contato.

### Perguntas frequentes

**É legal?** A Receita Federal publica os dados do CNPJ como dados abertos, sob licença Creative Commons Atribuição, e o minhareceita.org declara que a API é aberta, gratuita e sem limite de uso. A LGPD não se aplica a pessoa jurídica; o resíduo (nome de pessoa dentro da razão social de uma LTDA) é nome empresarial público por obrigação legal, e toda consulta parte de um CNPJ, nunca de uma pessoa. O uso dos dados é responsabilidade de quem usa.

**Por que meu CNPJ foi excluído?** É MEI, empresário individual, inscrição de pessoa física, ou a natureza jurídica não pôde ser confirmada.

### Related Actors

More Actors from the same publisher:

- [Brazil Public Tenders & Procurement (Licitações BR)](https://apify.com/kman-br/licitacoes-br): Brazilian public tenders and procurement from the PNCP portal, with a source link on every record.
- [Brazil Expiring Gov Contracts PNCP (Contratos a Vencer)](https://apify.com/kman-br/contratos-a-vencer): PNCP public contracts ending within a chosen window of days, with the current supplier (company CNPJ) and value.
- [Brazil Bankruptcy Auctions (Leilões de Falência)](https://apify.com/kman-br/leiloes-falencia): Auction notices in company bankruptcy and judicial recovery cases from the CNJ DJEN/Comunica feed.
- [Brazil Import/Export Data by NCM (Importação por NCM)](https://apify.com/kman-br/importacao-ncm): Brazilian import and export statistics by NCM, month and country, state or route from the public Comex Stat API.
- [Brazil Framework Agreements PNCP (Atas para Carona)](https://apify.com/kman-br/atas-carona-pncp): Active PNCP price registration agreements (Atas de Registro de Preço) open to adhesion, with items, prices and validity.

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

# Actor input Schema

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

Lista de CNPJs, com ou sem máscara. Duplicados são removidos e o dígito verificador é conferido. Até 500 por run (limite imposto no código).

## `incluirCnaesSecundarios` (type: `boolean`):

Se marcado, inclui no resultado a lista de CNAEs secundários (atividades econômicas secundárias) de cada empresa, conforme os dados públicos da Receita Federal. Desmarcado, devolve só o CNAE principal.

## Actor input object example

```json
{
  "cnpjs": [
    "33.000.167/0001-01",
    "00.000.000/0001-91"
  ],
  "incluirCnaesSecundarios": false
}
```

# Actor output Schema

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

No description

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

RUN_SUMMARY: status, motivo (teto_cobranca, prazo_interno), contagem por status e eventos cobrados.

# 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.000.167/0001-01",
        "00.000.000/0001-91"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/cnpj-lote").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.000.167/0001-01",
        "00.000.000/0001-91",
    ] }

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

```

## MCP server setup

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

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/Nrznch1vS79jAxZ9a/builds/Gagb9xPp1miDX0X7B/openapi.json
