# Brazil CNPJ Lookup: Company Data, Partners & CNAE (`transparent_meteorite/brazil-cnpj-company-lookup`) Actor

Look up Brazilian companies by CNPJ list: legal name, status, CNAE activities, partners (QSA), address, phone, capital and tax regime from Receita Federal open data. No login.

- **URL**: https://apify.com/transparent_meteorite/brazil-cnpj-company-lookup.md
- **Developed by:** [Detroit Web Agent - Open Data](https://apify.com/transparent_meteorite) (community)
- **Categories:** Business, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.84 / 1,000 company record returneds

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: Company Data, Partners & CNAE

Use this to look up Brazilian companies in bulk by CNPJ and get the full public registry record: legal and trade name, registration status, CNAE activities, partners and administrators (QSA), address, phones, share capital, company size and Simples Nacional / MEI flags. The data is Receita Federal open data, delivered through a keyless public API. No login, no cookies, no API key.

Every company row carries 56 fields, including the complete partner list and the full secondary-activity list as structured arrays. For comparison, the cheapest CNPJ lookup tool on the Store returns 6 fields per company, and the most feature-rich ones return around 40 to 46 fields while charging start fees of 10 to 30 cents per run plus 0.2 to 7 cents per record. This Actor returns more fields than all of them with a start fee of a twentieth of a cent.

### Run in 30 seconds

1. Open the **Input** tab. The prefilled list of 12 well-known Brazilian companies is a ready-to-run test.
2. Click **Start**. A first dataset is normally ready in about 15 seconds.
3. Open the **Companies** table in the Output tab, or download the dataset as JSON, CSV, Excel or HTML.
4. Replace the prefilled list with your own CNPJs, one per line, in any format (`33.000.167/0001-01` or `33000167000101`).

### What it does

You paste a list of CNPJ numbers. For each one the Actor validates the two check digits locally, fetches the registry record, and returns one clean row. It is built for the jobs people actually do with this data:

- **Verify suppliers, customers and counterparties.** Is the company active, suspended, inapt or closed, since when, and why?
- **Enrich a CRM or a spreadsheet.** Add legal name, trade name, city, state, phone, email, size and main activity to a column of CNPJs.
- **Due diligence and KYC.** See partners and administrators with their role, entry date and age range, plus capital and legal nature.
- **Map a company's branches.** Give one CNPJ and let the Actor check branch numbers 0001 to N for the same company root, keeping only the ones that exist, optionally only active ones in selected states.
- **Segment by activity.** The main CNAE code and the full secondary CNAE list make it easy to filter by industry.

### What it does not do

Be clear about the limits before you plan around them. The public registry source is a lookup by CNPJ number. It has no search by company name, by partner name or by CNAE. If you only have a name, find the CNPJ first (the company's invoices, its website footer and the registry portal all show it) and then feed the number here. Branch expansion covers the branches of a company root you already know. Partner personal tax IDs (CPF) are masked by the Receita Federal itself, so this Actor can show the masked form only.

### Input

- **CNPJ numbers**: one per line or pasted from a spreadsheet column. Any mix of formatted and plain numbers works, duplicates are removed, and numbers with wrong check digits are flagged without a lookup.
- **Max companies**: stops after this many company records. Default 100.
- **Also check branch numbers up to**: 0 turns it off. Set 50 to try branches 0001 to 0050 of each company root. Branch numbers that do not exist are skipped silently and cost nothing.
- **Only active companies**: keeps only registration status ATIVA.
- **Only these states (UF)**: keeps only companies in the listed states, for example SP and RJ.
- **Include partners (QSA)** and **Include secondary CNAE activities**: switch off to get a leaner row.
- **Add a free row for CNPJs that could not be resolved**: gives you a `not_found`, `invalid` or `error` row so you can reconcile your list. These rows are never charged.

### Example input

```json
{
  "cnpjs": ["33.000.167/0001-01", "60.701.190/0001-04", "47960950000121"],
  "maxItems": 100,
  "includePartners": true,
  "includeSecondaryActivities": true,
  "reportUnresolved": true
}
```

Branch scan for one company, active branches in Sao Paulo only:

```json
{
  "cnpjs": ["47.960.950/0001-21"],
  "checkBranchesUpTo": 60,
  "onlyActive": true,
  "states": ["SP"],
  "maxItems": 100
}
```

### Output sample

One abridged company row:

```json
{
  "recordType": "company",
  "lookupStatus": "found",
  "cnpj": "33000167000101",
  "cnpjFormatted": "33.000.167/0001-01",
  "branchType": "MATRIZ",
  "legalName": "PETROLEO BRASILEIRO S A PETROBRAS",
  "registrationStatus": "ATIVA",
  "registrationStatusCode": 2,
  "openingDate": "1966-09-28",
  "companyAgeYears": 60,
  "legalNature": "Sociedade de Economia Mista",
  "shareCapitalBrl": 205431960000,
  "mainCnaeCode": 600001,
  "secondaryCnaes": [{ "code": 1921700, "description": "..." }],
  "partners": [{ "name": "...", "qualification": "Diretor", "entryDate": "2025-07-29", "ageRange": "Entre 71 a 80 anos", "documentMasked": "***912137**" }],
  "partnerCount": 8,
  "city": "RIO DE JANEIRO",
  "state": "RJ",
  "zipCode": "20031170",
  "phone1": "2121660000",
  "latestTaxRegime": "LUCRO REAL",
  "source": "brasilapi",
  "scrapedAt": "2026-10-29T23:50:36.031Z"
}
```

### Field reference

- **Identity**: `cnpj`, `cnpjFormatted`, `cnpjRoot`, `branchType`, `legalName`, `tradeName`.
- **Status**: `registrationStatus`, `registrationStatusCode`, `registrationStatusDate`, `registrationStatusReason`, `specialStatus`, `specialStatusDate`.
- **Company profile**: `openingDate`, `companyAgeYears`, `legalNatureCode`, `legalNature`, `sizeCode`, `size`, `shareCapitalBrl`.
- **Activities**: `mainCnaeCode`, `mainCnaeDescription`, `secondaryCnaes[]`, `secondaryCnaeCount`.
- **People**: `partners[]` with name, qualification, entry date, age range, masked document, partner type, country and legal representative; `partnerCount`.
- **Address and contact**: street type, street, number, complement, district, city, IBGE city code, state, ZIP, `fullAddress`, `phone1`, `phone2`, `fax`, `email`.
- **Tax regime**: `simplesNacional`, `mei` and their opt-in and exclusion dates, `latestTaxRegime`, `taxRegimeHistory[]`.
- **Provenance**: `source`, `sourceUrl`, `scrapedAt`, `message`.

Fields the registry does not publish for a company come back as `null`, never as an invented value, so your downstream schema stays stable.

### Use cases

1. **Accounts payable and procurement.** Before paying a new supplier, check that the company is active and that its legal name matches the invoice.
2. **Sales and lead enrichment.** Turn a list of CNPJs from a tender, an export or a scrape into rows with city, size, activity and phone.
3. **Compliance and onboarding.** Capture a dated snapshot of status, capital, partners and administrators for the customer file.
4. **Market mapping.** Combine branch scans with the state filter to see how a retailer or bank is spread across the country.
5. **Data cleaning.** Validate thousands of CNPJs in a database for typos in minutes, using the free `invalid` rows.
6. **Monitoring.** Schedule a run weekly on your counterparty list and compare `registrationStatus` between runs.

### Tips for good results

- Paste raw cells. The extractor finds CNPJs inside messy text such as "Empresa X - CNPJ 33.000.167/0001-01".
- Keep **Include partners** on for compliance work and off for plain enrichment, where a smaller row is easier to read.
- Use **Max companies** as a safety cap when you turn on branch scanning for many roots.
- Run a small sample first. The prefilled list is a good smoke test.
- Re-run rows reported as `error`. They mean the source was temporarily unavailable and were not charged.

### Pricing and cost control

Pay per result: **$0.00084 per company record delivered (about $0.84 per 1,000)**, plus a $0.00005 start fee per run that Apify charges for starting the Actor. Rows for invalid, unknown or filtered-out CNPJs are never charged. Set a maximum charge on the run and the Actor stops cleanly when it is reached. The Actor uses 256 MB of memory and looks up four companies at a time, so a batch of a thousand normally finishes in a few minutes.

**How this beats the other CNPJ tools (live Store prices read through the Apify API, 2026-10-29, free-plan rate, 1,000-company run including start fees):**

| Actor | Users | Per company | Start fee | Fields | Cost for 1,000 |
|---|---|---|---|---|---|
| This Actor | new | $0.00084 | $0.00005 | 56 | $0.84 |
| epicscrapers/brazil-cnpj-scraper | 189 | $0.0009 | $0.00005 | 6 | $0.90 |
| jungle_synthesizer/brazil-cnpj-receita-federal-crawler | 334 | $0.002 | $0.10 | 46 | $2.10 |
| brasildados/cnpj-lead-scraper-search | 192 | $0.07 | $0.30 | n/a | $70.30 |

We are cheaper than every one of them and return nine times the fields of the cheapest.

### Integrations and scheduling

Use the Apify API, the official clients for JavaScript and Python, webhooks, or connectors for Google Sheets, Make, Zapier and n8n. Save your input as a Task and put it on a schedule to re-check your counterparty list automatically. The dataset is available as JSON, CSV, Excel, XML and HTML.

### Data source, terms and fair use

The records come from Receita Federal open company data, served by the open-source BrasilAPI project (MIT licence), with an open mirror of the same data as an automatic fallback if the primary is unavailable. The Receita publishes this registry as open data, and partner personal tax IDs are already masked at the source. The Actor reads one record at a time at a gentle pace and sends an identifying user agent. You are responsible for using the data in line with Brazilian law, including the LGPD for any personal data of partners, and with your own compliance rules. This Actor is not affiliated with the Receita Federal or with BrasilAPI.

### FAQ

**Can I search by company name?** No. The public source only supports lookup by CNPJ. Use the company's CNPJ from an invoice, a website footer or another source.

**Do I need an API key or a Brazilian proxy?** No. It works out of the box.

**How current is the data?** It reflects the registry as published by the source, which is typically updated monthly. Each row carries a `scrapedAt` timestamp and the source URL.

**Does it return the CPF of partners?** Only in the masked form that the Receita publishes, for example `***912137**`.

**What happens with a wrong number?** The check digits are validated first. A wrong number is reported as `invalid` for free and no request is sent.

**What is a branch number?** The 9th to 12th digits of a CNPJ. `0001` is the headquarters. Other values are branches (filiais) of the same company root, and the last two digits are check digits that the Actor computes for you.

**Why is a field null?** Because the registry does not publish it, for example the e-mail of many companies or the Simples dates for large companies.

**Can I get thousands of rows?** Yes. Set **Max companies** high enough, and set a maximum charge as a safety limit.

**Is it legal?** The data is public open data. You remain responsible for your use of any personal data under the LGPD.

### Alternatives to other CNPJ tools

Other Store Actors for Brazilian company data exist, from minimal lookups with six fields to larger lead-generation tools with 40 to 46 fields and start fees from 10 cents up to 30 cents per run. This Actor is designed to beat them on the three things that matter in practice: more usable fields per row (56 with real arrays for partners and activities), a lower cost per thousand companies with a negligible start fee, and a clean way to reconcile your list through free unresolved rows. If you already built a workflow around another tool, the common fields (`cnpj`, `legalName`, `tradeName`, `registrationStatus`, `openingDate`, `city`, `state`, `email`) map directly, so switching is a column rename at most.

### How a typical workflow looks

A finance team keeps a sheet of 800 supplier CNPJs. They paste the column into the input, leave partners on, and start the run. Four lookups run in parallel at a polite rate, rows arrive in the same order as the input, and the dataset shows each supplier with status, legal name, city and main activity. They filter the table for anything that is not ATIVA, send those to procurement, and save the input as a Task that runs every Monday. Because unresolved CNPJs come back as free rows, the sheet and the dataset always reconcile one to one.

A market analyst starts from the single CNPJ of a national retailer. She sets the branch scan to 300 rows for the headquarters, restricts the result to active branches in three states, and gets a list of store registrations with address, phone and opening date. She joins it with her own foot-traffic data using the ZIP code and the city IBGE code, both included in every row.

A compliance analyst needs a dated snapshot of who runs a counterparty. He keeps partners and secondary activities on, exports to JSON, and stores the file with the customer record. The `scrapedAt` and `sourceUrl` fields show exactly when and where each fact came from.

### Reading the status fields

`registrationStatus` is the text label from the registry (ATIVA, SUSPENSA, INAPTA, BAIXADA, NULA). `registrationStatusCode` is the numeric code behind it, where 2 means active, which is handy for filters in a spreadsheet or database. `registrationStatusDate` tells you since when the company has been in that state and `registrationStatusReason` gives the registry's stated reason. `specialStatus` is filled only for companies in a special situation such as judicial recovery. `companyAgeYears` is calculated at run time from the opening date so you do not need to compute it yourself, and `cnpjRoot` (the first eight digits) lets you group headquarters and branches of one company together in a pivot table.

### Reliability and error handling

The Actor never crashes a run because one lookup failed. If the main source is busy it retries with a growing pause, then falls back to an open mirror of the same registry. A company that truly does not exist is reported as `not_found`, a number with wrong check digits as `invalid`, and a source outage as `error`, each as a free row with a plain-language message. The run ends successfully in every case and writes a summary to the key-value store under `OUTPUT` with counts of delivered, charged, not found, invalid, filtered out and mirror-sourced records, so you can monitor quality from code.

### Related actors

- [UK Land Registry Sold Prices](https://apify.com/transparent_meteorite/uk-land-registry-sold-prices) for UK property transactions.
- [Bluesky Scraper](https://apify.com/transparent_meteorite/bluesky-posts-profiles-scraper) for posts, profiles and followers.
- [YouTube Channel Scraper](https://apify.com/transparent_meteorite/youtube-channel-scraper) for channels and subscriber counts.

New to Apify? [Create a free account](https://console.apify.com/sign-up?fpr=rnmakg) and run this Actor in under a minute. Some links are affiliate links.

### Support

Found a bug or need a field? Open an issue on the Issues tab with the run URL and you will get a reply there. Feature requests are welcome.

### Changelog

- **0.2**: Branch scanning with state and active filters, local check-digit validation, free unresolved rows, mirror fallback, charge-limit and soft-timeout handling.
- **0.1**: First private build.

# Actor input Schema

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

Brazilian company IDs (CNPJ), one per line, with or without dots, slash and dash (33.000.167/0001-01 or 33000167000101). You can paste a whole column from a spreadsheet. Check digits are validated before any lookup.

## `maxItems` (type: `integer`):

Stop after this many company records. You are charged per company record returned.

## `checkBranchesUpTo` (type: `integer`):

For each CNPJ, also look up its branches (filiais) numbered 0001 to this number, using the company root. 0 = off. Branches that do not exist are skipped silently and never charged.

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

Return only companies whose registration status is ATIVA. Others are skipped and not charged.

## `states` (type: `array`):

Two-letter state codes such as SP, RJ, MG. Companies elsewhere are skipped and not charged. Useful together with branch checks.

## `includePartners` (type: `boolean`):

Include the partner and administrator list with role, entry date and age range. Personal tax IDs are masked by the Receita Federal.

## `includeSecondaryActivities` (type: `boolean`):

Include the full list of secondary economic activities.

## `reportUnresolved` (type: `boolean`):

Adds a row with lookupStatus not_found, invalid or error so you can reconcile your list. These rows are never charged.

## Actor input object example

```json
{
  "cnpjs": [
    "33.000.167/0001-01",
    "00.000.000/0001-91",
    "60.701.190/0001-04",
    "33.592.510/0001-54",
    "07.526.557/0001-00",
    "47.960.950/0001-21",
    "71.673.990/0001-77",
    "60.746.948/0001-12",
    "07.689.002/0001-89",
    "18.236.120/0001-58",
    "00.360.305/0001-04",
    "02.558.157/0001-62"
  ],
  "maxItems": 12,
  "checkBranchesUpTo": 0,
  "onlyActive": false,
  "includePartners": true,
  "includeSecondaryActivities": true,
  "reportUnresolved": true
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `contacts` (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": [
        "33.000.167/0001-01",
        "00.000.000/0001-91",
        "60.701.190/0001-04",
        "33.592.510/0001-54",
        "07.526.557/0001-00",
        "47.960.950/0001-21",
        "71.673.990/0001-77",
        "60.746.948/0001-12",
        "07.689.002/0001-89",
        "18.236.120/0001-58",
        "00.360.305/0001-04",
        "02.558.157/0001-62"
    ],
    "maxItems": 12
};

// Run the Actor and wait for it to finish
const run = await client.actor("transparent_meteorite/brazil-cnpj-company-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": [
        "33.000.167/0001-01",
        "00.000.000/0001-91",
        "60.701.190/0001-04",
        "33.592.510/0001-54",
        "07.526.557/0001-00",
        "47.960.950/0001-21",
        "71.673.990/0001-77",
        "60.746.948/0001-12",
        "07.689.002/0001-89",
        "18.236.120/0001-58",
        "00.360.305/0001-04",
        "02.558.157/0001-62",
    ],
    "maxItems": 12,
}

# Run the Actor and wait for it to finish
run = client.actor("transparent_meteorite/brazil-cnpj-company-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": [
    "33.000.167/0001-01",
    "00.000.000/0001-91",
    "60.701.190/0001-04",
    "33.592.510/0001-54",
    "07.526.557/0001-00",
    "47.960.950/0001-21",
    "71.673.990/0001-77",
    "60.746.948/0001-12",
    "07.689.002/0001-89",
    "18.236.120/0001-58",
    "00.360.305/0001-04",
    "02.558.157/0001-62"
  ],
  "maxItems": 12
}' |
apify call transparent_meteorite/brazil-cnpj-company-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,transparent_meteorite/brazil-cnpj-company-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/4BabYTxhuq1lhanKz/builds/dUfVLksvdh5to1r8C/openapi.json
