# Consulta CNPJ em Lote | Brazil Company Data (Receita Federal) (`joaocamargo/consulta-cnpj-lote`) Actor

Consulte milhares de CNPJs de uma vez: razão social, situação, CNAE, endereço, porte, Simples/MEI e capital social, dos dados abertos da Receita Federal. Sem dados pessoais (LGPD).

- **URL**: https://apify.com/joaocamargo/consulta-cnpj-lote.md
- **Developed by:** [Joao Pedro Camargo](https://apify.com/joaocamargo) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 companies

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)

Consulte **milhares de CNPJs de uma vez** e receba os dados cadastrais oficiais de cada empresa em JSON, CSV ou Excel: razão social, nome fantasia, situação cadastral, CNAE principal e secundários, endereço, porte, capital social, opção pelo Simples/MEI, regime tributário e sócios pessoa jurídica.

Ideal para **validar cadastro de clientes e fornecedores (KYB), enriquecer listas de CRM, checar situação antes de faturar e analisar carteiras**.

### Como usar

1. Cole os CNPJs no campo **CNPJs**, um por linha, com ou sem pontuação.
2. (Opcional) Marque **Entregar só empresas ativas**.
3. Rode e baixe o resultado em Excel/CSV ou consuma pela API.

CNPJs com dígito verificador errado ou que não existem na base **não são cobrados** e aparecem no registro **PROBLEMS**, para você corrigir a sua lista.

### Campos principais

| Campo | Exemplo |
|---|---|
| `cnpjFormatado` | 33.000.167/0001-01 |
| `razaoSocial` / `nomeFantasia` | PETROLEO BRASILEIRO S A PETROBRAS / PETROBRAS - EDISE |
| `situacaoCadastral`, `dataSituacaoCadastral` | ATIVA, 2005-11-03 |
| `cnaePrincipal`, `cnaePrincipalDescricao` | 0600001, Extração de petróleo e gás natural |
| `cnaesSecundarios` | lista de código e descrição |
| `naturezaJuridica`, `porte`, `capitalSocial` | Sociedade de Economia Mista, DEMAIS, 205431960000 |
| `opcaoSimples`, `opcaoMei` | true/false/null |
| endereço | `logradouro`, `numero`, `bairro`, `municipio`, `uf`, `cep`, `codigoIbge` |
| `telefone`, `email` | telefone da empresa; e-mail só se for corporativo |
| `sociosPessoaJuridica` | empresas sócias (nome, CNPJ, qualificação) |
| `quantidadeSocios` | total de sócios |
| `regimeTributario` | últimos anos (Lucro Real, Presumido…) |

### Privacidade (LGPD)

Este Actor **não entrega dados pessoais**:

- Sócios pessoa física não são listados (só a contagem em `quantidadeSocios`).
- Para **empresário individual e MEI**, cuja razão social é o nome da pessoa, a razão social, o endereço completo, o telefone e o e-mail são omitidos (`empresarioIndividual: true`). O nome fantasia, a atividade, a situação e o município continuam disponíveis.
- E-mails de provedores pessoais (Gmail, Hotmail, Yahoo, UOL…) são descartados.

### Preço

Pagamento por resultado: um valor fixo pequeno por empresa entregue, mais a taxa padrão de início. CNPJs inválidos ou não encontrados não são cobrados. Use *Maximum cost per run* para limitar o gasto.

### Fonte dos dados

Dados abertos do CNPJ publicados pela Receita Federal, consultados pelos serviços públicos e de código aberto [Minha Receita](https://minhareceita.org) e, como reserva, [BrasilAPI](https://brasilapi.com.br). A base da Receita é atualizada mensalmente, então mudanças muito recentes podem levar algumas semanas para aparecer.

***

### English summary

Bulk lookup of Brazilian company registrations (CNPJ) from the Federal Revenue open data: legal name, status, main and secondary activity codes (CNAE), address, size, share capital, Simples/MEI tax options and corporate shareholders. No personal data: individual shareholders and sole proprietors' names are omitted (LGPD). Invalid or unknown CNPJs are free and listed in the `PROBLEMS` record.

# Actor input Schema

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

Um CNPJ por linha, com ou sem pontuação (ex.: 33.000.167/0001-01 ou 33000167000101). Até 10.000 por execução. CNPJs inválidos ou inexistentes não são cobrados e aparecem no registro PROBLEMS.

## `onlyActive` (type: `boolean`):

Pula empresas baixadas, suspensas, inaptas ou nulas (sem cobrança).

## Actor input object example

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

# Actor output Schema

## `empresas` (type: `string`):

Uma linha por CNPJ encontrado.

## `todosOsCampos` (type: `string`):

Inclui CNAEs secundários, sócios pessoa jurídica e regime tributário.

## `problemas` (type: `string`):

Lista sem cobrança dos CNPJs que não puderam ser consultados.

## `estatisticas` (type: `string`):

Quantos CNPJs foram pedidos, entregues, inválidos e não encontrados.

# 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",
        "47.960.950/0001-21"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("joaocamargo/consulta-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",
        "47.960.950/0001-21",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("joaocamargo/consulta-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",
    "47.960.950/0001-21"
  ]
}' |
apify call joaocamargo/consulta-cnpj-lote --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,joaocamargo/consulta-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/SCRpey7TpKD61zcEg/builds/pGk7KDFJ04zjImsWT/openapi.json
