# Brazil CNPJ Bulk Lookup - Consulta CNPJ em Massa (`frankely84/brazil-cnpj-bulk-lookup`) Actor

Bulk CNPJ lookup for Brazilian companies from Receita Federal open data: razão social, status, CNAE, address, porte, capital social, Simples/MEI. Fast, 3 sources with fallback, LGPD-safe (no QSA). $0.80 per 1,000 found.

- **URL**: https://apify.com/frankely84/brazil-cnpj-bulk-lookup.md
- **Developed by:** [Frankelys Hernandez](https://apify.com/frankely84) (community)
- **Categories:** Lead generation, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.80 / 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

## Brazil CNPJ Bulk Lookup – Consulta CNPJ em Massa (Receita Federal)

**Bulk CNPJ lookup API** for Brazilian companies. Paste thousands of CNPJs and get clean, structured **company data from Receita Federal open data**: legal name (razão social), trade name (nome fantasia), registration status (situação cadastral), CNAE activities, legal nature, company size (porte), share capital (capital social), Simples Nacional / MEI flags and full address. You **pay only for companies found**: invalid or non-existent CNPJs are free.

🇬🇧 [English](#english) · 🇪🇸 [Español](#español) · 🇧🇷 [Português](#português)

***

### English

#### What does Brazil CNPJ Bulk Lookup do?

It validates, de-duplicates and enriches a list of Brazilian CNPJs (company tax IDs) with official registry data published by **Receita Federal do Brasil** as open data (Cadastro Nacional da Pessoa Jurídica). It is ideal for **lead enrichment**, **KYB / supplier onboarding**, **CRM cleaning**, B2B prospecting by **CNAE**, and market research.

#### Why use it?

- ⚡ **Fast**: hundreds of CNPJs per minute, parallel lookups with automatic retries.
- 🔁 **Reliable**: three independent open-data sources with automatic fallback (OpenCNPJ → Minha Receita → BrasilAPI).
- ✅ **Built-in CNPJ validation** (check digits), including the new **alphanumeric CNPJ** format.
- 💸 **Cheap**: $0.80 per 1,000 companies found, no start fee, invalid/not-found CNPJs are not charged.
- 🔒 **Privacy-first (LGPD)**: no partner/shareholder (QSA) data is ever returned; for sole proprietors / MEI the CPF embedded in the name and the personal contacts are removed.

#### Input

| Field | Description |
|---|---|
| `cnpjs` | List of CNPJs, with or without punctuation |
| `cnpjText` | Or paste a column from Excel/CSV (new lines, commas, spaces) |
| `onlyActive` | Return only `ATIVA` companies (others are skipped, not charged) |
| `skipSoleProprietors` | Skip individual entrepreneurs and MEI |
| `includeContacts` | Include business email and phones (default true) |
| `concurrency` | Parallel lookups, 1–20 (default 8) |

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

#### Output (one item per CNPJ)

```json
{
  "cnpjFormatted": "00.000.000/0001-91", "found": true,
  "legalName": "BANCO DO BRASIL SA", "tradeName": "DIRECAO GERAL",
  "registrationStatus": "ATIVA", "headOffice": true, "foundedAt": "1966-08-01",
  "legalNature": "Sociedade de Economia Mista", "companySize": "DEMAIS",
  "shareCapitalBRL": 120000000000.0,
  "mainActivity": {"code": "6422100", "description": "Bancos múltiplos, com carteira comercial"},
  "secondaryActivities": [{"code": "6499999", "description": "..."}],
  "address": {"street": "SAUN QUADRA 5 BLOCO B", "city": "BRASILIA", "state": "DF", "zipCode": "70040912"},
  "email": null, "phones": ["+556134939002"],
  "simplesNacional": false, "mei": false, "isSoleProprietor": false,
  "source": "OpenCNPJ (Receita Federal open data)"
}
```

Not found or invalid CNPJs return `found: false` and `error: NOT_FOUND | INVALID_CNPJ` (free). Download as JSON, CSV, Excel or via API.

#### Pricing

Pay-per-event: **$0.0008 per company found** ($0.80 / 1,000). No start fee. Platform usage is minimal (256 MB).

#### Data sources & freshness

Data comes from the official **Receita Federal CNPJ open data** (dados abertos), updated monthly by Receita Federal, served via open-source projects [OpenCNPJ](https://opencnpj.org) (MIT), [Minha Receita](https://minhareceita.org) and [BrasilAPI](https://brasilapi.com.br). This Actor is not affiliated with Receita Federal.

#### FAQ

**Is it legal?** Yes. CNPJ registry data is public open data published by the Brazilian government. Partner (QSA) and personal data are deliberately excluded.
**Can I run it via API / integrate with Make, Zapier, n8n?** Yes, as any Apify Actor.

***

### Español

#### ¿Qué hace?

**Consulta masiva de CNPJ** de empresas brasileñas con datos abiertos oficiales de la **Receita Federal**: razón social, nombre fantasía, situación catastral, actividad **CNAE**, naturaleza jurídica, tamaño, capital social, Simples Nacional/MEI y dirección. Ideal para **enriquecimiento de leads**, KYB/alta de proveedores, limpieza de CRM y prospección B2B en Brasil.

- Rápido y fiable (3 fuentes con respaldo automático, reintentos).
- Valida dígitos verificadores, elimina duplicados, soporta CNPJ alfanumérico.
- **$0,0008 por empresa encontrada**, sin costo de inicio; CNPJ inválidos o inexistentes no se cobran.
- Sin datos de socios (QSA) ni datos personales (LGPD).

Entrada: lista `cnpjs` o texto `cnpjText`. Salida: un registro por CNPJ en JSON/CSV/Excel.

***

### Português

#### O que faz?

**Consulta CNPJ em massa** com dados abertos oficiais da **Receita Federal**: razão social, nome fantasia, situação cadastral, **CNAE** principal e secundários, natureza jurídica, porte, capital social, opção pelo Simples Nacional e MEI, endereço completo, e-mail e telefone da empresa. Perfeito para **enriquecimento de leads**, prospecção B2B, KYC/KYB, homologação de fornecedores e higienização de base/CRM.

- ⚡ Rápido: centenas de CNPJs por minuto, consultas em paralelo.
- 🔁 Confiável: 3 fontes de dados abertos com fallback automático (OpenCNPJ, Minha Receita, BrasilAPI).
- ✅ Validação de CNPJ (dígitos verificadores), remoção de duplicados e suporte ao **CNPJ alfanumérico**.
- 💸 **US$ 0,0008 por empresa encontrada** (US$ 0,80 por mil), sem taxa de início; CNPJ inválido ou inexistente não é cobrado.
- 🔒 LGPD: não retorna quadro societário (QSA); para empresário individual/MEI remove o CPF do nome e os contatos pessoais.

Entrada: lista `cnpjs` ou cole uma coluna do Excel em `cnpjText`. Filtros: somente ativas, excluir MEI. Saída em JSON, CSV, Excel ou API.

Fonte: dados abertos do CNPJ da Receita Federal (atualização mensal). Sem vínculo com a Receita Federal.

# Actor input Schema

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

List of CNPJs, with or without punctuation (e.g. 00.000.000/0001-91 or 00000000000191). Alphanumeric CNPJs are supported.

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

Optional: paste CNPJs separated by new lines, commas or spaces (e.g. a column copied from Excel).

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

Skip companies whose registration status is not ATIVA (not charged).

## `skipSoleProprietors` (type: `boolean`):

Skip individual entrepreneurs and MEI (not charged).

## `includeContacts` (type: `boolean`):

Include the business email and phones registered at Receita Federal. Always omitted for sole proprietors/MEI.

## `concurrency` (type: `integer`):

Parallel lookups (1-20).

## Actor input object example

```json
{
  "cnpjs": [
    "00.000.000/0001-91",
    "33.683.111/0002-80",
    "60.701.190/0001-04"
  ],
  "onlyActive": false,
  "skipSoleProprietors": false,
  "includeContacts": true,
  "concurrency": 8
}
```

# Actor output Schema

## `companies` (type: `string`):

Normalized company records (overview).

## `companiesDetailed` (type: `string`):

All fields including address, activities and tax regime.

# 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.683.111/0002-80",
        "60.701.190/0001-04"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("frankely84/brazil-cnpj-bulk-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.683.111/0002-80",
        "60.701.190/0001-04",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("frankely84/brazil-cnpj-bulk-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.683.111/0002-80",
    "60.701.190/0001-04"
  ]
}' |
apify call frankely84/brazil-cnpj-bulk-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,frankely84/brazil-cnpj-bulk-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/w5mEcNTUA1IA03tqI/builds/sdlc31Iji1Hu4aODE/openapi.json
