# Consulta CNPJ em Lote: Brazil CNPJ Lookup (`rowfinch/brazil-cnpj-lookup`) Actor

Consulte uma lista de CNPJs de uma vez: razão social, nome fantasia, CNAE, endereço, telefones, e-mail, porte, Simples e sócios (QSA). Dados oficiais da Receita Federal, atualizados todo mês. Look up Brazilian companies by CNPJ in bulk.

- **URL**: https://apify.com/rowfinch/brazil-cnpj-lookup.md
- **Developed by:** [Rowfinch](https://apify.com/rowfinch) (community)
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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: dados da Receita Federal

Cole uma lista de CNPJs e receba, para cada um, razão social, nome fantasia, CNAE, endereço, telefones, e-mail, porte, Simples Nacional e, se quiser, os sócios (QSA).

Dados oficiais da Receita Federal, atualizados todo mês. **US$ 1,50 por 1.000 empresas**, e CNPJ não encontrado não é cobrado.

### Para que serve

- **Enriquecer uma planilha**: a coluna de CNPJs do seu CRM ou ERP ganha atividade, endereço e contato.
- **Cadastro de clientes e fornecedores**: confira razão social e endereço antes de faturar. Quem não aparece não está ativo na Receita.
- **Grupos econômicos**: a raiz (8 primeiros caracteres) traz a matriz e todas as filiais ativas.
- **Análise de carteira**: porte, Simples Nacional, capital social e data de abertura de cada cliente.

### Como usar

Cole os CNPJs em **CNPJs**, um por linha, com ou sem pontuação. Pode ser a coluna inteira da planilha: linhas repetidas são consultadas uma vez, e os zeros à esquerda que o Excel apaga são recolocados.

| Você digita | Recebe |
|---|---|
| `33.000.167/0001-01` ou `33000167000101` | o estabelecimento |
| `33000167` | a matriz e todas as filiais ativas |
| `12.ABC.345/01DE-35` | CNPJs alfanuméricos, os novos de 2026, funcionam igual |

### Resultado

Uma linha por empresa, na ordem da sua lista. `input` é a linha que ela responde:

```json
{
  "input": "11.222.333/0001-81",
  "cnpj": "11.222.333/0001-81",
  "legalName": "CANTINA DO JOAO LTDA",
  "tradeName": "CANTINA DO JOÃO",
  "isHeadquarters": true,
  "openedOn": "2020-01-15",
  "mainActivity": { "code": "5611-2/01", "description": "Restaurantes e similares" },
  "secondaryActivities": [
    { "code": "4721-1/02", "description": "Padaria e confeitaria com predominância de revenda" }
  ],
  "legalNature": { "code": "206-2", "description": "Sociedade Empresária Limitada" },
  "size": "ME",
  "simplesNacional": true,
  "shareCapital": 10000,
  "address": {
    "street": "RUA AUGUSTA", "number": "100", "complement": "LOJA 2", "district": "CONSOLAÇÃO",
    "zipCode": "01305-000", "city": "SAO PAULO", "state": "SP"
  },
  "phones": ["(11) 3333-4444"],
  "email": "contato@cantina.com.br",
  "partners": [
    { "name": "JOÃO PEREIRA", "role": "Sócio-Administrador", "since": "2020-01-15", "ageRange": "41-50" }
  ],
  "sourceMonth": "2026-10"
}
```

`partners` vem com **Include partners (QSA)** ligado. `sourceMonth` é a edição da Receita de onde o registro saiu.

As linhas sem empresa vêm no fim, com o motivo em `error`, para você corrigir a lista:

```json
{ "input": "11.222.333/0001-80", "error": "Invalid CNPJ: the last 2 digits don't match the rest" }
```

### Preço

- **US$ 1,50 por 1.000 empresas**
- **+ US$ 0,50 por 1.000 empresas com sócios**, quando **Include partners (QSA)** estiver ligado
- CNPJ inválido ou não encontrado: grátis

Uma raiz cobra cada filial que trouxer.

| Lista | Custo |
|---|---|
| 1.000 CNPJs | US$ 1,50 |
| 20.000 CNPJs com sócios | até US$ 40 |

A execução para no custo máximo que você definir para ela no Apify. O crédito do plano gratuito cobre cerca de 3.000 empresas por mês.

### Atualização

A Receita Federal publica uma edição nova todo mês, e ela chega aqui poucos dias depois.

Telefones e e-mails são os que a empresa informou à Receita. Muitos estão vazios ou desatualizados, e o e-mail costuma ser do contador.

### É legal?

O cadastro CNPJ é público pela Lei de Acesso à Informação (Lei 12.527/2011), e a Receita Federal o publica como dado aberto. Os sócios vêm sem CPF.

Nomes de sócios são dados pessoais pela LGPD. O controlador do uso é você: tenha uma base legal para a finalidade, atenda pedidos de exclusão e não use os dados para nada além da relação com a empresa.

### Perguntas frequentes

**Por que um CNPJ não foi encontrado?**
Só entram empresas com situação cadastral ativa. Baixadas, suspensas, inaptas e nulas ficam de fora, assim como as abertas depois da última edição da Receita.

**Quanto tempo leva uma lista grande?**
10.000 CNPJs levam cerca de 5 minutos com a memória padrão e pouco mais de 1 minuto com 1 GB (em Run options). O preço é por empresa e não muda com a memória.

**Dá para buscar por atividade ou cidade, sem ter os CNPJs?**
Sim, com a [Lista de Empresas por CNAE](https://apify.com/rowfinch/brazil-cnpj-leads).

### In English

Bulk lookup of Brazilian companies by CNPJ in the official Receita Federal registry: legal and trade name, CNAE activities, address, phones, email, size, Simples Nacional and partners (QSA). Paste a list with or without punctuation; an 8-character root returns every active branch. Refreshed monthly. **$1.50 per 1,000 companies**, +$0.50 per 1,000 with partners, and CNPJs not found are free.

# Actor input Schema

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

With or without punctuation. The first 8 characters bring every active branch of the company. You can paste a whole spreadsheet column.

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

Adds each company's partners: name, role, entry date and age range. Charged per company that has partners.

## Actor input object example

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

# Actor output Schema

## `companies` (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": [
        "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("rowfinch/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": [
        "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("rowfinch/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": [
    "33.000.167/0001-01",
    "00.000.000/0001-91",
    "47.960.950/0001-21"
  ]
}' |
apify call rowfinch/brazil-cnpj-lookup --silent --output-dataset

```

## MCP server setup

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