# Brazil CNPJ Lookup (`deriverge/brazil-cnpj-lookup`) Actor

Looks up Brazilian companies by CNPJ in Receita Federal's open data and returns the legal name, registration status and CNAE activities with plain-English risk flags. Partner names are never returned, and invalid or unknown CNPJs cost nothing.

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

## Pricing

from $0.40 / 1,000 company records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Lookup

Each row is one Brazilian company or branch, looked up by its CNPJ in Receita Federal's open company data: legal and trade name, registration status with date and reason, legal nature, size, share capital, start date, CNAE activities, address, Simples Nacional and MEI status, tax regime by year and plain-English risk flags. Paste CNPJs with or without punctuation and click **Start**; the form comes filled in with Petrobras and Bradesco. Partner names are never returned, and the CNPJs of individuals come back without name or contact details. It costs $0.80 per 1,000 company records on the Free plan ($0.40 on Business), and the $5 of monthly credit in Apify's Free plan covers about 6,200 company records.

### What each row contains

| Field | Description |
|---|---|
| `input`, `reference` | The CNPJ as you entered it and your own ID for the row, both returned unchanged. |
| `matched` | `true` when Receita Federal knows the CNPJ. |
| `cnpj`, `cnpjFormatted` | The CNPJ as 14 characters and in the usual form, `76.535.764/0001-43`. |
| `entityType` | `legal_entity`, `individual_entrepreneur` for an empresário individual or MEI, or `natural_person` for another CNPJ held by a person, such as an election candidate. |
| `name`, `tradeName` | Razão social and nome fantasia, e.g. `OI S.A. - EM RECUPERACAO JUDICIAL` and `OI`. Empty for individuals, as explained under Personal data. |
| `status`, `active`, `statusDate`, `statusReason` | Situação cadastral (`ATIVA`, `BAIXADA`, `INAPTA`, `SUSPENSA` or `NULA`), `true` for `ATIVA`, the date it took effect and the reason, e.g. `INCORPORACAO` when the company was merged into another. |
| `specialSituation`, `specialSituationDate` | Situação especial such as `RECUPERACAO JUDICIAL`, with the date it was recorded. |
| `legalNature`, `legalNatureCode` | Natureza jurídica, e.g. `Sociedade Anônima Aberta` with code `2046`. |
| `size` | Porte: `MICRO EMPRESA`, `EMPRESA DE PEQUENO PORTE` or `DEMAIS`. |
| `shareCapital` | Capital social in reais, e.g. `32538937000`. |
| `startedOn`, `branchType` | Date the activity started, and `MATRIZ` (head office) or `FILIAL` (branch). |
| `mainActivity`, `secondaryActivities` | CNAE codes with their descriptions, e.g. `6110801` for fixed telephone services. |
| `address`, `district`, `city`, `state`, `postcode`, `cityIbgeCode` | Street, bairro, municipality, UF, CEP and the IBGE municipality code. |
| `phone`, `email` | Main phone in the form `+55 31 3131-3131` and the email registered with Receita Federal, which large companies seldom publish. |
| `simplesNacional`, `simplesSince`, `simplesExcludedOn`, `mei` | Whether the company is in the Simples Nacional regime, since when and until when, and `true` for a microempreendedor individual. Empty when Receita Federal has no Simples Nacional record for the company, as for Oi. |
| `taxRegime` | Declared regime per year, e.g. `LUCRO REAL` for every year from 2016 to 2024. |
| `partnersCount` | How many partners and administrators the partner list (QSA) has. |
| `riskFlags` | Warnings in plain English, most serious first: special situation, a status other than `ATIVA`, activity started less than a year ago, withheld personal data. |
| `source`, `checkedAt` | Which copy of the register answered (`BrasilAPI` or `Minha Receita`) and when, in UTC. |

### How to look up CNPJs in bulk

1. In **Companies to check**, enter a JSON list of CNPJs, with punctuation (`33.000.167/0001-01`) or without (`33000167000101`). Numbers of 8 to 13 digits, as spreadsheets leave them after dropping leading zeros, are padded back to 14.
2. To label a row, write the entry as `{"cnpj": "60746948000112", "reference": "supplier-42"}`. The reference comes back on the row.
3. Click **Start**. Each entry becomes one row in the **Output** tab, in the order you gave them; export the table as CSV, Excel or JSON, or call the actor from the API with an input like this:

```json
{
  "companies": [
    "33.000.167/0001-01",
    { "cnpj": "76535764000143", "reference": "carrier-07" },
    "60746948000112"
  ],
  "watchName": "suppliers"
}
```

### Example output

One row from a run on 11 October 2026, for Oi S.A., which Receita Federal lists in judicial recovery. `secondaryActivities` is cut to the first 3 of its 22 entries.

```json
{
  "reference": null,
  "input": "76.535.764/0001-43",
  "matched": true,
  "cnpj": "76535764000143",
  "cnpjFormatted": "76.535.764/0001-43",
  "entityType": "legal_entity",
  "name": "OI S.A. - EM RECUPERACAO JUDICIAL",
  "tradeName": "OI",
  "status": "ATIVA",
  "active": true,
  "statusDate": "2005-11-03",
  "statusReason": null,
  "specialSituation": "RECUPERACAO JUDICIAL",
  "specialSituationDate": "2016-06-29",
  "legalNature": "Sociedade Anônima Aberta",
  "legalNatureCode": "2046",
  "size": "DEMAIS",
  "shareCapital": 32538937000,
  "startedOn": "1966-09-26",
  "branchType": "MATRIZ",
  "mainActivity": {
    "code": "6110801",
    "description": "Serviços de telefonia fixa comutada - STFC"
  },
  "secondaryActivities": [
    {
      "code": "4221904",
      "description": "Construção de estações e redes de telecomunicações"
    },
    {
      "code": "4221905",
      "description": "Manutenção de estações e redes de telecomunicações"
    },
    {
      "code": "4652400",
      "description": "Comércio atacadista de componentes eletrônicos e equipamentos de telefonia e comunicação"
    }
  ],
  "address": "RUA DO LAVRADIO 71 ANDAR 2",
  "district": "CENTRO",
  "city": "RIO DE JANEIRO",
  "state": "RJ",
  "postcode": "20230070",
  "cityIbgeCode": "3304557",
  "phone": "+55 31 3131-3131",
  "email": null,
  "simplesNacional": null,
  "simplesSince": null,
  "simplesExcludedOn": null,
  "mei": null,
  "taxRegime": [
    {
      "year": 2024,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2023,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2022,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2021,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2020,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2019,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2018,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2017,
      "regime": "LUCRO REAL"
    },
    {
      "year": 2016,
      "regime": "LUCRO REAL"
    }
  ],
  "partnersCount": 1,
  "riskFlags": [
    "SPECIAL SITUATION: RECUPERACAO JUDICIAL since 2016-06-29."
  ],
  "source": "BrasilAPI",
  "checkedAt": "2026-10-11T12:43:55.132Z"
}
```

### How much does it cost to look up Brazilian companies?

| | Free plan | Starter | Scale | Business |
|---|---|---|---|---|
| 1,000 company records | $0.80 | $0.64 | $0.52 | $0.40 |

You pay only for the events in the table. There is no start fee, and compute time and proxies are included.

Checking 10,000 CNPJs costs $8.00 on the Free plan and $4.00 on Business. A CNPJ with wrong check digits, one that Receita Federal does not know and one that no copy of the register answered for cost nothing, and each still gets a row that says why.

### Personal data

Receita Federal's open data names every partner in a company's QSA and registers a sole trader under the owner's own name. The actor never returns partner names, only `partnersCount`. When a CNPJ belongs to an empresário individual or an MEI (legal nature `2135`), or to another person who holds a CNPJ (legal nature codes starting with 4, such as `4090` for election candidates), the row leaves out the name, trade name, street, district, postcode, phone and email, and `riskFlags` says so; city, state, activities and status remain. For companies, the phone and email are the ones the company registered. In a one-person business they can be the owner's own contact details, so treat them as personal data.

### Limits

- BrasilAPI and Minha Receita serve copies of Receita Federal's open data. On 11 October 2026 Minha Receita reported its data as the September 2026 release, so a change registered since then can be missing.
- Branches (`FILIAL`) carry less than their head office. On 11 October 2026 none of 50 Petrobras branches had a `taxRegime`, and the branches of Oi S.A. and Americanas S.A. had an empty `specialSituation`, while both head offices showed `RECUPERACAO JUDICIAL`. A branch of a company in judicial recovery therefore gets no risk flag; its name, such as `AMERICANAS S.A - EM RECUPERACAO JUDICIAL`, may be the only sign. Look up the head office, whose CNPJ often ends in `/0001-`, for these fields.
- Only CNPJs are accepted. The actor does not search by company name and does not list the branches of a company.
- When BrasilAPI gives no usable answer, after up to three tries, Minha Receita is asked. If neither answers, the row says the register could not be reached; this happened to 1 of 2 CNPJs in a run on 9 October 2026. A run in which fewer than 60% of the CNPJs get an answer ends with the status Failed, and the rows it has stay in the dataset.
- Lookups run four at a time. A list of 50 CNPJs took 7 seconds on 11 October 2026.

### Watching suppliers between runs

Fill in **Watch name**, for example `suppliers`, or save the input as a task, and schedule it. Each run compares every row with the previous run of the same name and stores the differences in the `CHANGES` record of the run: a status that left `ATIVA`, a new special situation, an added activity, a new address. The comparison is part of the normal price.

### FAQ

#### Is it legal to look up CNPJ data?

CNPJ registration data is public: Receita Federal publishes it as open data, and BrasilAPI and Minha Receita serve copies of it. The actor reads only these copies, never collects partner names and withholds the personal details of individuals as described above. You remain responsible for how you use the results, including under Brazil's data protection law (LGPD).

#### Does it check a CNPJ before looking it up?

Yes. The two check digits are verified first, also for alphanumeric CNPJs, which Receita Federal introduced in July 2026. A number that fails is reported as invalid without a lookup and without a charge.

### Related scrapers

- [French Company Registry Scraper](https://apify.com/deriverge/french-company-check)
- [Polish Company Registry Scraper](https://apify.com/deriverge/polish-company-check)
- [Czech Company Registry Scraper](https://apify.com/deriverge/czech-company-check)

### Support

This actor is built and maintained by deriverge s.r.o., a software company based in the Czech Republic. If a run fails or a field you need is missing, please open an issue in the **Issues** tab or write to us at info@deriverge.com. We respond in English and Czech. Runs can be scheduled in Apify Console or started from the **API** tab, which has examples for Python, JavaScript and cURL and works with Make, Zapier, n8n and the Apify MCP server. If the actor saves you time, a short review helps other people find it.

# Changelog

This Actor's version history is a separate document: https://apify.com/deriverge/brazil-cnpj-lookup/changelog.md

# Actor input Schema

## `companies` (type: `array`):

One entry per company: a CNPJ with or without punctuation (33.000.167/0001-01 or 33000167000101), including the new alphanumeric CNPJ, or an object with cnpj and an optional reference returned unchanged. Invalid and unknown CNPJs are never charged.

## `watchName` (type: `string`):

Give the run a name such as "suppliers" and schedule it. Every later run with the same name compares its results with the previous one and stores the differences (status changes, special situations, new activities) in the CHANGES record. Runs from a saved task are compared automatically even without a name.

## Actor input object example

```json
{
  "companies": [
    "33.000.167/0001-01",
    {
      "cnpj": "60746948000112",
      "reference": "supplier-42"
    }
  ]
}
```

# Actor output Schema

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

One row per CNPJ with the registration status, activities, address, tax options and risk flags.

## `changes` (type: `string`):

What changed for each company since the previous run with the same watch name or task.

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

Companies found, invalid or not found, flagged and billed.

# 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 = {
    "companies": [
        "33.000.167/0001-01",
        {
            "cnpj": "60746948000112",
            "reference": "supplier-42"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("deriverge/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 = { "companies": [
        "33.000.167/0001-01",
        {
            "cnpj": "60746948000112",
            "reference": "supplier-42",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("deriverge/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 '{
  "companies": [
    "33.000.167/0001-01",
    {
      "cnpj": "60746948000112",
      "reference": "supplier-42"
    }
  ]
}' |
apify call deriverge/brazil-cnpj-lookup --silent --output-dataset

```

## MCP server setup

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