# Brazil CNPJ Lookup — Company Status, CNAE & Address (`northbell/brazil-cnpj-lookup`) Actor

Brazilian companies by CNPJ: legal name, trade name, registration status, size, main and secondary activities (CNAE), address, opening date and share capital from Receita Federal open data. Run it again to see which companies changed status. No partners, emails or phones. No login.

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

## Pricing

from $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.
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 — Company Status, CNAE & Address

Give it a list of Brazilian CNPJ numbers — in any format, including the new alphanumeric ones — and get one clean row per company: **legal name, trade name, registration status, size, main and secondary activities (CNAE), address, opening date and share capital**, from the Receita Federal's open CNPJ data. **$1 per 1,000 companies**, no login, no API key. The default pace is 20 lookups a minute (about 3 seconds per company); raise *Max requests per minute* up to 60 for bigger lists.

Run it again — or put it on a monthly schedule — and every row also tells you **what changed since the last run**: `statusChanged`, the `previousStatus` (for example *Ativa* to *Baixada*) and a `changedFields` list that names what moved (status, size, address, activity…). The register is republished about once a month, so changes show up at that rhythm, not day by day.

### What you get

| Field | What it is |
|---|---|
| `cnpj`, `cnpjFormatted`, `isHeadquarters` | the 14-character number, the usual `19.131.243/0001-97` form, and `true` for a head office (matriz) or `false` for a branch (filial) |
| `legalName`, `tradeName` | razão social and nome fantasia. `tradeName` is `null` when the company has none; both are `null` for sole proprietors (see Notes) |
| `status`, `isActive`, `statusReason`, `statusDate` | situação cadastral as published (for example *Ativa*, *Inapta*, *Baixada*), `true` when it is *Ativa*, the reason and the date of that status |
| `openingDate`, `legalNature`, `size`, `shareCapital` | start of activity, natureza jurídica, porte (for example *Microempresa (ME)*, *Demais*) and share capital in reais |
| `mainActivityCode`, `mainActivityCodeFormatted`, `mainActivityDescription` | the main CNAE: 7 digits (`9430800`), the printed form (`9430-8/00`) and its description |
| `secondaryActivities` | the list of secondary CNAEs, each `{ code, description }` |
| `address`, `street`, `number`, `complement`, `district`, `city`, `state`, `zip` | where the establishment is registered: one printed line, and the parts |
| `simplesNacional`, `simplesSince`, `mei`, `meiSince` | Simples Nacional and MEI options when the register holds a record for the company |
| `soleProprietor` | `true` for one-person registrations (Empresário Individual, MEI, a one-lawyer firm…), which are returned without names, street or ZIP |
| `isNew`, `statusChanged`, `previousStatus`, `previousStatusDate`, `changedFields`, `previousObservedAt` | the change since your previous run (`isNew` is `true` and the others `null` on the first run) |
| `type`, `input`, `observedAt` | `company` (or `error`), the number as you typed it, and when it was read |

Error rows (`type: "error"`) carry `input`, `cnpj` (when the number is valid) and a `message`: a number whose check digits are wrong, or one that is not in the published data.

### Run it again and again

- **On a schedule** — save your input as a task and add a **Schedule**: the same CNPJs every month. Send each run to Google Sheets, Slack or email with an integration on the task.
- **Watch for changes** — Keep the same input on the schedule. Each run is its own dataset with the date it ran, so the series builds up run by run and you can compare one day with the last.
- **In bulk** — Put every number in **CNPJ numbers** in one run.

### Use it for

- **Checking a customer, supplier or lead list** — is the CNPJ still *Ativa*, or has it become *Inapta* or *Baixada*?
- **Enriching B2B lead lists** — add industry (CNAE), size, city and state, opening date and share capital to a list of CNPJs
- **Watching a portfolio** — schedule it monthly and filter on `statusChanged = true` to see which companies moved

### Input

```json
{ "cnpjs": ["19131243000197", "33.000.167/0001-01", "00000000000191"], "maxRequestsPerMinute": 20 }
```

CNPJs can be written with or without dots, slash and dash, one per line. The two check digits are verified first, so a typo costs nothing and comes back as a free error row. Numbers that a spreadsheet shortened by dropping leading zeros (`191` for `00000000000191`) are restored when the check digits then fit.

What the Actor remembered about each CNPJ (status and the other watched values) is kept in a named key-value store, `brazil-cnpj-status`, in your Apify account, so the second run of the same Actor already shows changes. Schedule it (Apify → Schedules) to keep the history going.

### Pricing

**$1.00 per 1,000 companies**, plus $0.01 per run. Error rows (invalid or unknown CNPJs) are free. The $0.01 run-start fee is the one charge every run pays, even one that returns nothing.

### Notes

- **Source:** the Receita Federal's public CNPJ base, read through the free OpenCNPJ API (api.opencnpj.org). Its documentation says it is free for commercial use and that it republishes the base about once a month. The data can be out of date or incomplete in the ways the Receita's own file is.
- **Companies only.** Partners (quadro societário) are never read, and no email addresses or phone numbers are returned: the email in the register can be the company's accountant rather than the company, so contacts are dropped rather than guessed.
- **Sole proprietors** (Empresário Individual, MEI, rural producers, election candidates, one-lawyer firms and other one-person registrations) are registered under the person's own name. For these rows `legalName`, `tradeName`, `street`, `number`, `complement` and `zip` are `null` and `soleProprietor` is `true`. Status, dates, activities, size, district, city and state are still returned. A list of small businesses will contain many of them.
- **Other company names are published as the register has them.** A company's legal name can contain its owner's name (for example a one-partner Ltda named after the partner); only the one-person registration types above are withheld.
- **Text is in Portuguese** as the Receita publishes it (`status`, `statusReason`, `legalNature`, `size`, activity descriptions). `status` values include *Ativa*, *Suspensa*, *Inapta*, *Baixada* and *Nula*.
- **Some fields are `null` by condition:** `tradeName` when the company has no trade name; `statusDate` when the register gives no date; `simplesNacional`, `simplesSince`, `mei` and `meiSince` when the register holds no Simples/MEI record for the company (`null` means no record, not "no"); `mainActivityCode`, `mainActivityCodeFormatted` and `mainActivityDescription` when the register only holds its "activity not informed" placeholder (seen on closed one-person registrations), which is dropped rather than shown as a real CNAE; `secondaryActivities` is an empty list when there are none. `isNew` is `true` and `previousStatus`, `previousStatusDate`, `statusChanged`, `changedFields` and `previousObservedAt` are `null` the first time a CNPJ is seen.
- **`changedFields`** can contain `status`, `statusDate`, `statusReason`, `legalName`, `tradeName`, `legalNature`, `size`, `shareCapital`, `mainActivityCode`, `address`, `isHeadquarters`, `simplesNacional` and `mei`. `statusChanged` is `true` when `status` or `statusDate` moved.
- **A very new CNPJ** may not be in the published data yet and comes back as an error row ("Not in the published Receita Federal data").
- **Speed:** the default of 20 requests per minute is about 3 seconds per company; the maximum of 60 is about 1 second per company (measured on 9 Oct 2026: 6 lookups took 15 seconds at 20 per minute, 29 lookups took 34 seconds at 60 per minute). If the source answers "too many requests" the Actor waits and retries twice, and it stops asking after five lookups in a row fail, with the remaining numbers returned as free error rows.
- You are responsible for how you use the data, including data-protection rules such as the LGPD.

Looking for companies outside Brazil? See [Companies House Search](https://apify.com/northbell/companies-house-search), [LEI / GLEIF Lookup](https://apify.com/northbell/lei-gleif-lookup) and [Company Lookup by Domain](https://apify.com/northbell/company-lookup-by-domain).

### For AI agents

`{"cnpjs": ["19131243000197"]}` returns one row for that CNPJ with its status, size, main activity and address. Rows have `type`: `company` or `error`. To monitor a list, run the same input on a schedule and keep rows where `statusChanged` is `true`; `previousStatus` and `status` show the move.

# Actor input Schema

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

One CNPJ per line, in any format: 19131243000197, 19.131.243/0001-97 or the new alphanumeric CNPJ (for example 12ABC34501DE35). The two check digits are verified before anything is looked up; invalid numbers come back as free error rows.

## `maxRequestsPerMinute` (type: `integer`):

How fast to ask the public data source. The default 20 is gentle (about 3 seconds per company). Raise it up to 60 for bigger lists; lower it if you see rate-limit errors.

## Actor input object example

```json
{
  "cnpjs": [
    "19131243000197"
  ],
  "maxRequestsPerMinute": 20
}
```

# Actor output Schema

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

Legal name, trade name, status, size, activities (CNAE), address and what changed since the last run.

# 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": [
        "19131243000197"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("northbell/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": ["19131243000197"] }

# Run the Actor and wait for it to finish
run = client.actor("northbell/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": [
    "19131243000197"
  ]
}' |
apify call northbell/brazil-cnpj-lookup --silent --output-dataset

```

## MCP server setup

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