# Brazil CNPJ Lookup: Company Data by CNPJ (`nanodata/brazil-cnpj-lookup-scraper`) Actor

Look up Brazilian companies by CNPJ number in the open Receita Federal data: legal and trade name, registration status, activities, legal nature, size, capital, address and contacts. Pay per company.

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

## Pricing

from $1.50 / 1,000 company delivereds

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 Lookup

Look up Brazilian companies by their CNPJ number. Each row is one company with its legal name, trade name, registration status and date, main and secondary activities (CNAE), legal nature, size class, share capital, full address, opening date, Simples and MEI flags, and the phone and email the company has published. You pay per company delivered.

The data is the open company register of the Brazilian Federal Revenue (Receita Federal), read through the public lookup service [minhareceita.org](https://minhareceita.org/). No account and no API key are needed.

### What you get

For each CNPJ the actor returns one row with:

- `cnpj`, `cnpjFormatted`, `url`: the number as 14 digits, with dots, slash and dash, and the registry record
- `legalName`, `tradeName`: razao social and nome fantasia
- `branchType`, `branchTypeCode`: head office (`MATRIZ`) or branch (`FILIAL`)
- `status`, `statusCode`, `statusDate`, `statusReason`, `statusReasonCode`, `specialStatus`, `specialStatusDate`: registration status such as `ATIVA` or `BAIXADA`, since when, and why
- `openingDate`: start of activity
- `mainCnae`, `mainCnaeDescription`, `secondaryCnaes`: the main activity code and text, and the list of secondary activities (code and description)
- `legalNature`, `legalNatureCode`, `size`, `sizeCode`: legal nature and size class (for example `MICRO EMPRESA`, `DEMAIS`)
- `shareCapital`, `currency`: share capital in BRL
- `streetType`, `street`, `number`, `complement`, `district`, `postalCode`, `city`, `state`, `cityCode`, `cityCodeIbge`: the registered address, with the registry and IBGE city codes
- `country`, `countryCode`, `foreignCity`: for companies with an address abroad
- `phone1`, `phone2`, `fax`, `email`: the company phone numbers (area code first) and email as published in the register
- `simples`, `simplesOptInDate`, `simplesExitDate`, `mei`, `meiOptInDate`, `meiExitDate`: Simples Nacional and MEI flags with their dates
- `taxRegimes`: the published tax regime per year (year, regime, number of filings, partnership CNPJ)
- `responsibleQualificationCode`, `federalEntityResponsible`: the qualification code of the responsible person and, for public bodies, the responsible federal entity
- `scrapedAt`: time of the lookup in UTC

A value the register does not hold is null. Lists with nothing in them are empty.

The partner list of a company (names and masked tax numbers of individual partners) is not collected. No partner data appears in any row.

### Typical uses

- Check whether a supplier or customer is active, and since when
- Enrich a list of CNPJ numbers with name, activity, size and address
- Find the main business activity and legal form of a company
- Keep a company list in a spreadsheet or CRM up to date

### Pricing

You pay per company delivered, plus a small fee for each run.

| Event | Name | Price |
|---|---|---|
| Run start (charged once, together with the first delivered row) | `actor-start` | $0.001 per run |
| One company row | `company-result` | $0.0015 per company ($1.50 per 1,000) |

A number that is invalid or not in the register gives no row and is not charged. A run that finds nothing is not charged. If you set a maximum cost for the run, the actor stops cleanly once the next row would go over it.

**New to Apify?** Every account gets a $5 free monthly platform credit, enough for a first test run before you pay anything.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `cnpjs` | list | sample of 5 large companies | CNPJ numbers, one per entry. Formatted (`33.000.167/0001-01`) or plain digits (`33000167000101`) |
| `maxResults` | number | 100 | Maximum companies to return, up to 10,000 |

How it works:

- Every number is checked before anything is requested. Numbers with the wrong length or wrong check digits are skipped, never requested, and listed in the run status.
- Repeated numbers are removed, also when they are written in different formats.
- The actor looks up one number at a time and waits between requests.
- A number that is valid but not in the register gives no row. The run status says how many were not found.
- A list can also be given as one text with numbers separated by commas or line breaks. `maxResults` also accepts a number written as text, for example `"50"`.
- Started with no input, the actor looks up five large Brazilian companies as a sample.
- Keep the numbers as text. Numbers that start with zeros lose them when written as plain numbers.

#### Example: three companies

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

#### Example: a longer list with a limit

```json
{
  "cnpjs": ["60701190000104", "60746948000112", "07526557000100", "47960950000121"],
  "maxResults": 3
}
```

### Output sample

```json
{
  "cnpj": "33592510000154",
  "cnpjFormatted": "33.592.510/0001-54",
  "url": "https://minhareceita.org/33592510000154",
  "legalName": "VALE S.A.",
  "tradeName": null,
  "branchType": "MATRIZ",
  "branchTypeCode": 1,
  "status": "ATIVA",
  "statusCode": 2,
  "statusDate": "2005-11-03",
  "statusReason": "SEM MOTIVO",
  "statusReasonCode": 0,
  "specialStatus": null,
  "specialStatusDate": null,
  "openingDate": "1969-02-11",
  "mainCnae": 710301,
  "mainCnaeDescription": "Extração de minério de ferro",
  "secondaryCnaes": [
    {
      "code": 990401,
      "description": "Atividades de apoio à extração de minério de ferro"
    },
    {
      "code": 8211300,
      "description": "Serviços combinados de escritório e apoio administrativo"
    }
  ],
  "legalNature": "Sociedade Anônima Aberta",
  "legalNatureCode": 2046,
  "size": "DEMAIS",
  "sizeCode": 5,
  "shareCapital": 77800000000,
  "currency": "BRL",
  "responsibleQualificationCode": 10,
  "federalEntityResponsible": null,
  "streetType": "PRAIA",
  "street": "BOTAFOGO",
  "number": "00186",
  "complement": "SAL 901 1101 1601 PARTE 1701 1801",
  "district": "BOTAFOGO",
  "postalCode": "22250145",
  "city": "RIO DE JANEIRO",
  "state": "RJ",
  "cityCode": 6001,
  "cityCodeIbge": 3304557,
  "country": null,
  "countryCode": null,
  "foreignCity": null,
  "phone1": "2134855000",
  "phone2": "2134856600",
  "fax": "021272 4064",
  "email": null,
  "simples": null,
  "simplesOptInDate": null,
  "simplesExitDate": null,
  "mei": null,
  "meiOptInDate": null,
  "meiExitDate": null,
  "taxRegimes": [
    {
      "year": 2016,
      "regime": "LUCRO REAL",
      "filings": 1,
      "partnershipCnpj": null
    },
    {
      "year": 2017,
      "regime": "LUCRO REAL",
      "filings": 1,
      "partnershipCnpj": null
    }
  ],
  "scrapedAt": "2026-11-09T12:26:16Z"
}
```

### Limitations

- The actor reads only what the register shows. Company emails are often missing, and phone numbers are given as the register holds them (area code first, no formatting).
- Companies and branches both have their own CNPJ. Give the full 14 digit number of the branch you want.
- The register is updated by the Federal Revenue on its own schedule, so very recent changes may not be there yet.
- The lookup service may slow down or refuse requests at busy times. The actor then stops early and the run status says so. Rows already delivered are kept and charged.
- The list of partners is not collected.

### FAQ

**Where does the data come from?**
From the open company register of the Brazilian Federal Revenue, served by the public lookup service minhareceita.org.

**What happens with a wrong number?**
It is skipped without any request. The run status lists the first skipped values.

**Am I charged for a number that is not found?**
No. Only delivered company rows are charged, plus the single start fee when at least one row is delivered.

**Can I search by name?**
No. This actor looks up companies by CNPJ number.

**Why are some fields empty?**
The register does not hold every field for every company. For example, `simples` and `mei` are null when the register has no option on record, and `tradeName` is empty for many companies.

**Is partner data included?**
No. Partner names and tax numbers are never collected.

### Use with AI agents (MCP)

Connect this actor to any MCP-compatible AI client, such as Claude Desktop, Cursor, VS Code, LangChain or LlamaIndex.

**MCP server URL:**

```
https://mcp.apify.com?tools=nanodata/brazil-cnpj-lookup-scraper
```

**Example prompt once connected:**

> "Use `brazil-cnpj-lookup-scraper` to look up the company with CNPJ 00000000000191 and show its legal name, status and main activity. Return results as a table."

### Related Actors

- [France Company Registry Scraper](https://apify.com/nanodata/france-company-registry-scraper): Search the French business register by keyword, activity code, department, postal code and more.
- [UK Companies House Scraper](https://apify.com/santamaria-automations/uk-companies-house-scraper): Search UK Companies House for company records.
- [Website Contact Extractor: AI Contacts, Emails, Phones](https://apify.com/santamaria-automations/website-contact-extractor): Extract structured contacts (name, position, email, phone, LinkedIn) plus emails, phones, socials and address from any company website.

### Support

Found a problem or need a field added? Open an issue on the [Issues tab](https://apify.com/nanodata/brazil-cnpj-lookup-scraper/issues). We usually reply within one business day. You can also email contact@nanoscrape.com.

# Actor input Schema

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

Company numbers to look up, one per line. Formatted (12.345.678/0001-90) or plain digits (12345678000190). Numbers with wrong check digits are skipped and reported in the run status. Leave empty to run a sample of five large companies.

## `maxResults` (type: `integer`):

Maximum number of companies to return. Default 100.

## Actor input object example

```json
{
  "cnpjs": [
    "33000167000101",
    "00000000000191",
    "33592510000154"
  ],
  "maxResults": 100
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

One row per company number

# 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": [
        "33000167000101",
        "00000000000191",
        "33592510000154"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nanodata/brazil-cnpj-lookup-scraper").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": [
        "33000167000101",
        "00000000000191",
        "33592510000154",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nanodata/brazil-cnpj-lookup-scraper"
        }
    }
}
```

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/f4ekQ5HdkaGAenSdD/builds/9bGZki6o1k1Fb9PWV/openapi.json
