# Brazil CNPJ Lookup - Receita Federal Company Data (`1rrock/brazil-cnpj-lookup`) Actor

Bulk CNPJ lookup (consulta CNPJ em lote) for Brazilian companies from Receita Federal open data: razão social, nome fantasia, situação cadastral, CNAE, address, phone, capital and partners (QSA). No proxy, no API key. Export to JSON, CSV or Excel, or call via API. $1.50 per 1,000 results.

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

## Pricing

from $1.50 / 1,000 results

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

### What is Brazil CNPJ Lookup?

**Brazil CNPJ Lookup** is a bulk **CNPJ lookup (consulta CNPJ em lote)** tool that turns a list of Brazilian CNPJ numbers into clean company records from the **Receita Federal open data** (Cadastro Nacional da Pessoa Jurídica). Paste one or thousands of CNPJs and get the **razão social**, **nome fantasia**, **situação cadastral**, main **CNAE** activity, address, phone, share capital and partners (**QSA**) for each company, ready to export as JSON, CSV or Excel or to pull through the Apify API.

It does **not** search companies by name, sector or city. It looks up CNPJs you already have, which is what you need for KYC, supplier checks and CRM enrichment.

- ✅ **Official open data**: Receita Federal CNPJ data, served by the open-source [BrasilAPI](https://brasilapi.com.br) / [Minha Receita](https://minhareceita.org) APIs.
- ✅ **No proxy, no API key, no login**: runs in seconds with the default input.
- ✅ **Any CNPJ format**: `00.000.000/0001-91`, `00000000000191` or mixed. Punctuation is ignored.
- ✅ **One row per CNPJ**: invalid or unknown numbers come back as an error row, so you can reconcile every input.
- ✅ **Cheap and predictable**: **$1.50 per 1,000 results**, platform usage included.

### What data can you get for a CNPJ?

| Field | Example | Meaning |
|---|---|---|
| `cnpj`, `cnpj_formatted` | `00.000.000/0001-91` | CNPJ (digits / formatted) |
| `razao_social` | BANCO DO BRASIL SA | Legal name (razão social) |
| `nome_fantasia` | DIRECAO GERAL | Trade name |
| `situacao_cadastral`, `data_situacao_cadastral` | ATIVA, 2005-11-03 | Registration status (ativa, baixada, inapta, suspensa…) and its date |
| `data_inicio_atividade` | 1966-08-01 | Opening date |
| `natureza_juridica`, `porte` | Sociedade de Economia Mista, DEMAIS | Legal nature and company size |
| `capital_social` | 120000000000 | Share capital (BRL) |
| `cnae_fiscal`, `cnae_fiscal_descricao` | 6422100, Bancos múltiplos… | Main CNAE activity code and description |
| `uf`, `municipio`, `bairro`, `logradouro`, `numero`, `complemento`, `cep` | DF, BRASILIA… | Address |
| `ddd_telefone_1`, `email` | 6134939002 | Contact data, when published |
| `opcao_pelo_simples`, `opcao_pelo_mei` | false | Simples Nacional / MEI flags |
| `identificador_matriz_filial` | MATRIZ | Head office or branch |
| `qsa_count`, `cnaes_secundarios_count` | 41, 1 | Number of partners and secondary CNAEs |
| `raw` | `{ … }` | Full source record, including the **QSA partner list** and all secondary CNAEs |
| `source`, `fetched_at` | brasilapi | Which API answered and when |

### Use cases for bulk CNPJ lookup

- 🔎 **KYC / KYB and onboarding**: confirm a Brazilian customer or merchant exists and is `ATIVA` before you approve them.
- 🏭 **Supplier and vendor verification**: check status, legal nature and partners before you pay invoices or sign contracts.
- 📈 **B2B lead enrichment**: add CNAE, size, capital, city and phone to a lead list that only has CNPJs.
- 🗂️ **CRM and ERP data cleaning**: refresh legal names and addresses and flag companies that are `BAIXADA` or `INAPTA`.
- 🧾 **Tax and invoice compliance**: validate the CNPJs printed on invoices (NF-e) and contracts.

### How to look up CNPJs in bulk

1. Click **Try for free** (or **Start**) on this page. The free Apify plan is enough to test.
2. Paste your CNPJ numbers into **CNPJ numbers**, one per line. Any format works.
3. Click **Start**. With the default delay the Actor processes about one CNPJ per second.
4. Open the **Output** tab to see the table, or export the dataset as **JSON, CSV, Excel, XML or HTML**.
5. To automate it, schedule the Actor or call it from the API (see below).

#### Input example

```json
{
  "cnpjs": ["00.000.000/0001-91", "19.131.243/0001-97"],
  "delaySeconds": 0.8,
  "preferSource": "brasilapi"
}
```

| Field | Description |
|---|---|
| `cnpjs` | **Required.** List of CNPJs (14 digits, with or without punctuation). |
| `delaySeconds` | Pause between requests (default 0.8 s). Keep it ≥ 0.5 s to stay within the fair-use limits of the free public APIs. |
| `preferSource` | `brasilapi` (default) or `minhareceita`. The other one is used automatically as a fallback. |

#### Output example

One item per CNPJ (the `raw` object is shortened here):

```json
{
  "cnpj": "00000000000191",
  "cnpj_formatted": "00.000.000/0001-91",
  "razao_social": "BANCO DO BRASIL SA",
  "nome_fantasia": "DIRECAO GERAL",
  "situacao_cadastral": "ATIVA",
  "data_situacao_cadastral": "2005-11-03",
  "data_inicio_atividade": "1966-08-01",
  "porte": "DEMAIS",
  "natureza_juridica": "Sociedade de Economia Mista",
  "capital_social": 120000000000,
  "cnae_fiscal": 6422100,
  "cnae_fiscal_descricao": "Bancos múltiplos, com carteira comercial",
  "cnaes_secundarios_count": 1,
  "qsa_count": 41,
  "uf": "DF",
  "municipio": "BRASILIA",
  "bairro": "ASA NORTE",
  "logradouro": "SAUN QUADRA 5 BLOCO B TORRE I, II, III",
  "numero": "SN",
  "cep": "70040912",
  "ddd_telefone_1": "6134939002",
  "email": null,
  "opcao_pelo_simples": false,
  "opcao_pelo_mei": false,
  "identificador_matriz_filial": "MATRIZ",
  "source": "brasilapi",
  "fetched_at": "2026-10-07T01:27:31.895584+00:00",
  "raw": { "qsa": [{ "nome_socio": "…", "qualificacao_socio": "Diretor", "data_entrada_sociedade": "2023-05-17" }], "cnaes_secundarios": [] }
}
```

A CNPJ that cannot be resolved returns an error row instead, for example
`{"cnpj": "11111111111111", "error": "http_400", "message": "{\"message\":\"CNPJ 11.111.111/1111-11 inválido.\", …}", "source": "brasilapi", "ok": false}`
(other codes: `not_found`, `invalid_cnpj_length`). Lookups that fail because both public APIs are temporarily unreachable (timeouts, HTTP 429/5xx) are not written to the dataset; see the pricing section below.

### How much does a CNPJ lookup cost?

This Actor uses **pay-per-result** pricing: **$1.50 per 1,000 results** ($0.0015 per CNPJ), with Apify platform usage already included. Apify also charges a tiny Actor start fee of $0.00005 per run per GB of memory.

- **What counts as a result?** Every item written to the dataset: one per input CNPJ that was found, plus one error row per **invalid or not-found** CNPJ (those are charged too, so remove obvious duplicates and malformed numbers first).
- **Temporary failures are not charged.** If a lookup fails because of a temporary problem at the data source or on our side (network errors, timeouts, HTTP 429/5xx from both public APIs), no dataset item is written and nothing is charged. These inputs are listed under `failedLookups` in the run summary (key-value store record `OUTPUT`, linked as *Run summary* in the run's Output tab) so you can run them again later. If every lookup in a run fails this way, the run is marked as failed.
- **How many CNPJs fit in one run?** There is no `maxItems` cap: every CNPJ you paste is looked up, one at a time. With the default 0.8 s delay a lookup takes about 1–2 s, so one run with the default 30-minute timeout handles roughly **1,000–1,500 CNPJs**.
- **Examples:** 100 CNPJs ≈ $0.15 (one run, a few minutes). 10,000 CNPJs ≈ $15, but that takes about 3–5 hours: either raise the run timeout (e.g. to 6 hours in the run options) or split the list into about 8–10 runs of ~1,000–1,200 CNPJs.
- **Free plan:** Apify's free plan includes $5 of monthly usage, which covers about 3,000 CNPJ lookups.

### Use the CNPJ lookup API from Python, JavaScript or no-code tools

Everything you can do in the UI also works through the [Apify API](https://docs.apify.com/api/v2).

**Python** ([apify-client](https://docs.apify.com/api/client/python)):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("1rrock/brazil-cnpj-lookup").call(
    run_input={"cnpjs": ["00.000.000/0001-91", "19.131.243/0001-97"]}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("cnpj_formatted"), item.get("razao_social"), item.get("situacao_cadastral"))
```

**JavaScript / Node.js** ([apify-client](https://docs.apify.com/api/client/js)):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('1rrock/brazil-cnpj-lookup').call({
    cnpjs: ['00.000.000/0001-91', '19.131.243/0001-97'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**HTTP (one call, returns the results):**

```bash
curl -X POST "https://api.apify.com/v2/acts/1rrock~brazil-cnpj-lookup/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"cnpjs": ["00000000000191"]}'
```

**No-code:** connect the Actor to [Zapier](https://docs.apify.com/platform/integrations/zapier), [Make](https://docs.apify.com/platform/integrations/make), Google Sheets (with [Google Sheets Import & Export](https://apify.com/lukaskrivka/google-sheets)), webhooks, Slack and [other integrations](https://docs.apify.com/platform/integrations). You can also run it on a [schedule](https://docs.apify.com/platform/schedules) or let AI agents call it through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

### FAQ

#### Is it legal to use CNPJ data?

Yes. CNPJ registry data is published by the Receita Federal as Brazilian government **open data (dados abertos)** for reuse. See [dados.gov.br](https://dados.gov.br/dados/conjuntos-dados/cadastro-nacional-da-pessoa-juridica---cnpj). Partner (QSA) records contain names of people, so handle them in line with the LGPD and your own compliance rules.

#### Where does the data come from?

From the Receita Federal open CNPJ data, served by [BrasilAPI](https://brasilapi.com.br) (primary; its CNPJ endpoint uses Minha Receita) with [Minha Receita](https://minhareceita.org) as a fallback. This Actor is not an official Receita Federal service.

#### How fresh is the data?

The data is as fresh as the last Receita Federal open data release imported by Minha Receita (releases are monthly). It is **not** a real-time query of the Receita Federal website, so status changes from the last few weeks may not show yet.

#### Can I search companies by name, CNAE or city?

Not with this Actor. It is a CNPJ-to-record lookup. To find companies by segment you need a full-database search tool.

#### Are there limits?

There is no cap on input size, but the run timeout is: at the defaults (30 minutes, 0.8 s delay) one run handles roughly 1,000–1,500 CNPJs. For bigger lists, raise the run timeout or split the list into several runs. The free public APIs ask for fair use, so keep the default delay (≥ 0.5 s) rather than lowering it to go faster. The Actor currently accepts **numeric** 14-digit CNPJs.

#### Something went wrong. What should I do?

Check the error rows (`error` field) and the run summary (`OUTPUT` record, which lists lookups that failed temporarily and were not charged) first. For bugs or feature requests, open an issue in the **Issues** tab and I'll take a look.

### Data source and license

**License / terms (brief):**

- Underlying registry data: Brazilian government **dados abertos** (Receita Federal CNPJ) — public open data for reuse; cataloged on [dados.gov.br](https://dados.gov.br/dados/conjuntos-dados/cadastro-nacional-da-pessoa-juridica---cnpj).
- BrasilAPI project: **MIT** (per brasilapi.com.br docs). Terms ask for organic/person-like use — **no bulk crawling** of the whole space; cache responses.
- Do not hammer community endpoints; for high volume, host Minha Receita yourself or ingest official dumps.

### Other actors by 1rrock

Official open-data company lookups, all at $1.50 per 1,000 results:

- 🇲🇽 [Mexico Business Directory - INEGI DENUE Lookup](https://apify.com/1rrock/mexico-denue-lookup): search 6M+ Mexican establishments by name, keyword, state or GPS radius.
- 🇯🇵 [Japan Invoice Number Checker - T-Number Lookup](https://apify.com/1rrock/japan-invoice-lookup): bulk-verify Japanese qualified invoice registration numbers (インボイス登録番号).
- 🇯🇵 [Japan Company Data API - gBizINFO Corporate Lookup](https://apify.com/1rrock/japan-gbizinfo-lookup): Japanese company profiles by corporate number (法人番号) or name.
- 🇨🇴 [Colombia NIT Lookup - RUES Company Registry Search](https://apify.com/1rrock/colombia-nit-lookup): consulta NIT in bulk and new-company lead lists from Colombia's official RUES registry.
- 🇹🇼 [Taiwan Company Lookup - 統一編號 GCIS Registry Search](https://apify.com/1rrock/taiwan-company-lookup): Taiwanese companies by 統一編號 or name with capital, directors and new-company lists.

# Actor input Schema

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

Enter Brazilian CNPJs, one per line: 14 digits with or without punctuation, e.g. 00.000.000/0001-91 or 00000000000191. Each CNPJ produces one result.

## `delaySeconds` (type: `number`):

Pause between API calls. Keep it at 0.5–1.0 s to respect the fair-use limits of the free public CNPJ APIs (BrasilAPI / Minha Receita).

## `preferSource` (type: `string`):

Which open-data API to ask first. The other one is used automatically as a fallback.

## Actor input object example

```json
{
  "cnpjs": [
    "00.000.000/0001-91",
    "19.131.243/0001-97"
  ],
  "delaySeconds": 0.8,
  "preferSource": "brasilapi"
}
```

# Actor output Schema

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

No description

## `runSummary` (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": [
        "00.000.000/0001-91",
        "19.131.243/0001-97"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("1rrock/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": [
        "00.000.000/0001-91",
        "19.131.243/0001-97",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("1rrock/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": [
    "00.000.000/0001-91",
    "19.131.243/0001-97"
  ]
}' |
apify call 1rrock/brazil-cnpj-lookup --silent --output-dataset

```

## MCP server setup

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