# Brazil CNPJ Lookup 🇧🇷 (Consulta CNPJ, Receita Federal, QSA) (`tagadanar/brazil-cnpj-lookup`) Actor

Look up Brazilian companies by CNPJ: legal and trade name, registration status, CNAE codes, address, share capital, opening date and partners (QSA) from the Receita Federal record. Or search companies by CNAE and state. $1 per 1,000 companies + $0.001/run. Invalid and unknown CNPJs free.

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

## Pricing

from $0.70 / 1,000 company founds

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: Receita Federal Company Data & QSA (Consulta CNPJ)

**Paste a list of CNPJs and get back the official Receita Federal record of each Brazilian company: legal name (razão social), trade name (nome fantasia), registration status (situação cadastral), CNAE codes, address, share capital, opening date, Simples Nacional / MEI flags and the partners and directors list (QSA).** $1 per 1,000 companies found, platform usage included. Invalid and unregistered CNPJs cost nothing and are named in the run status.

You can also search companies by economic activity: give a CNAE code, optionally narrowed to states or cities, and get the active companies registered under it.

Built for **KYC / KYB onboarding, supplier and customer due diligence, CRM enrichment, lead lists by CNAE and AI agents** that need to check a Brazilian company in one call.

### Why this actor

- **Check digits validated before anything is queried**, including the new alphanumeric CNPJs issued since July 2026 (12.ABC.345/01DE-35). Typos come back as `invalid_cnpj` with the reason, never as a silent miss, and are free.
- **Accepts what your spreadsheet has**: formatted or raw CNPJs, numbers that lost their leading zeros, `CNPJ: ...` prefixes, an 8-digit root (returns the 0001 head office), comma or line separated lists, or objects from another actor with a `cnpj` field.
- **A named answer for every CNPJ**: `found`, `not_found` (absent from the monthly registry snapshot AND from a live registry read), `not_in_snapshot`, `unavailable` or `not_queried`, each with a plain-language `note`.
- **Fallbacks when a source is down**: the monthly Receita Federal open-data snapshot is read from minhareceita.org, then from the BrasilAPI mirror, and a CNPJ missing from the snapshot (for example a company registered this month) is checked live on open.cnpja.com. Each row says which source answered.
- **Registry data only.** Nothing is added from outside the official record. Partner tax IDs come masked as the Receita Federal publishes them (`***912137**`), and for individual entrepreneurs (empresário individual, MEI) the street address and contacts are left out.
- **Fair pricing**: one flat price per company found, no compute or proxy line, nothing charged for misses.

### Input

Look up a list of CNPJs:

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

Search active software companies (CNAE 6201-5/01) in the Federal District:

```json
{
    "cnaeCodes": ["6201501"],
    "states": ["DF"],
    "onlyActive": true,
    "maxResults": 100
}
```

| Field | What it does |
|---|---|
| `cnpjs` | CNPJs to look up, any common format, up to 10,000 per run. One row per distinct CNPJ. |
| `cnaeCodes` | Optional company search by 7-digit CNAE code (6201501 or 6201-5/01). |
| `states` | Search only: two-letter UF codes (SP, RJ, MG...). Empty means all of Brazil. |
| `cityCodes` | Search only: 7-digit IBGE municipality codes (3550308 is São Paulo). |
| `includeSecondaryCnae` | Search only: also match companies that list the CNAE as a secondary activity. Off by default. |
| `onlyActive` | Search only: skip closed (baixada), suspended, inapta and nula registrations. On by default; skipped companies are free. |
| `maxResults` | Search only: maximum companies returned (default 100, up to 5,000). |

You can combine a CNPJ list and a search in one run. A company is charged once per run even if both return it.

### Output (one row per company)

```json
{
    "input": "33.000.167/0001-01",
    "cnpj": "33000167000101",
    "cnpjFormatted": "33.000.167/0001-01",
    "cnpjRoot": "33000167",
    "lookupStatus": "found",
    "legalName": "PETROLEO BRASILEIRO S A PETROBRAS",
    "tradeName": "PETROBRAS - EDISE",
    "establishmentType": "headquarters",
    "registrationStatus": "ATIVA",
    "isActive": true,
    "registrationStatusDate": "2005-11-03",
    "registrationStatusReason": "SEM MOTIVO",
    "openingDate": "1966-09-28",
    "legalNatureCode": 2038,
    "legalNature": "Sociedade de Economia Mista",
    "companySize": "DEMAIS",
    "shareCapitalBrl": 205431960000,
    "mainCnaeCode": "0600001",
    "mainCnaeDescription": "Extração de petróleo e gás natural",
    "secondaryCnaes": [{ "code": "1921700", "description": "Fabricação de produtos do refino de petróleo" }],
    "street": "AVENIDA REPUBLICA DO CHILE",
    "number": "65",
    "district": "CENTRO",
    "city": "RIO DE JANEIRO",
    "cityIbgeCode": 3304557,
    "state": "RJ",
    "zipCode": "20031170",
    "phone": "2121660000",
    "simplesNacional": null,
    "mei": null,
    "taxRegimes": [{ "year": 2024, "regime": "LUCRO REAL" }],
    "partnerCount": 8,
    "partners": [
        { "name": "MAGDA MARIA DE REGINA CHAMBRIARD", "type": "person", "role": "Presidente", "roleCode": 16, "since": "2024-06-07", "ageRange": "Entre 61 a 70 anos", "document": "***612937**" }
    ],
    "source": "minhareceita.org",
    "dataAsOf": "2026-10"
}
```

Rows for CNPJs that were not found carry the same `input`, `cnpj` and `lookupStatus` plus a `note`, and are not charged:

```json
{ "input": "99999999000191", "cnpj": "99999999000191", "lookupStatus": "not_found", "note": "Not registered: absent from the 2026-10 snapshot (minhareceita.org) and from the live registry read (open.cnpja.com)." }
```

The dataset view "Companies" shows the main columns; the full row keeps every field.

### Pricing

Pay per event, no subscription. Apify platform usage is included in the price: no compute line, no proxy line, no API key to buy.

| Event | When | Price |
|---|---|---|
| Actor start | Once per run | $0.001 |
| Company | Per company found and delivered | $0.001 ($1 per 1,000) |

Bronze, Silver and Gold plans get 10%, 20% and 30% off the per-company price ($0.70 per 1,000 on Gold). Invalid CNPJs, unregistered CNPJs and companies skipped by your filters are free.

Example: checking 5,000 supplier CNPJs, of which 4,800 exist, costs $4.80 plus $0.001.

### FAQ

**Where does the data come from?** From the Receita Federal's open CNPJ data (Dados Abertos do CNPJ), published monthly and served by minhareceita.org, with brasilapi.com.br as a mirror. CNPJs missing from that snapshot are checked against a live registry read on open.cnpja.com. `source` and `dataAsOf` say which one answered and how fresh it is.

**How fresh is it?** The snapshot is the latest monthly Receita Federal release (`dataAsOf`, for example `2026-10`). A company opened or changed after that release can differ; for a CNPJ the snapshot does not have, the actor asks the live source, up to 4 per run because that source allows about 5 requests a minute. Beyond that the row says `not_in_snapshot` (free), so you can re-run those CNPJs later.

**Is the CNAE search complete?** It pages through the source's own search until its last page or your `maxResults`. The source sometimes asks to slow down on heavy searches ("busca muito custosa"); the actor waits and retries, and if the source still refuses, the run says so instead of returning a short list as if it were complete.

**Does it validate CNPJs?** Yes. The two check digits are verified before any request, using the Receita Federal rule that also covers the alphanumeric CNPJ format. Invalid entries are listed with the reason (wrong length, wrong check digits, repeated digits) and cost nothing.

**Can I search by company name?** No. None of the open sources offers a name search, so the actor does not pretend to. You can search by CNAE code, state and city, or look up known CNPJs.

**Can I get all branches (filiais) of a company?** Give each branch CNPJ, or the 8-digit root for the head office. A branch listing by root is not available from the open sources.

**Is the share capital exact?** For very large companies the snapshot mirror rounds `shareCapitalBrl` to about 8 significant digits (Ambev's R$ 58,308,213,544.96 comes back as 58,308,215,000). Small and mid-size capitals are exact.

**Is this LGPD-friendly?** The actor returns only what the Receita Federal publishes for reuse. Partner CPFs stay masked as published, there is no search by person, and no emails or phones are added from outside the registry. For individual entrepreneurs (MEI, empresário individual) the street address and contacts are not returned. How you use the data downstream is your responsibility as controller.

**Does it work with AI agents?** Yes. Like every Apify actor it can be called through the API and MCP, so Claude, Cursor and similar tools can use it as a "check this CNPJ" tool.

### More company KYC actors

- [French Company KYC](https://apify.com/tagadanar/french-company-kyc): SIREN / SIRET, officers, finances and BODACC.
- [German Company KYC](https://apify.com/tagadanar/german-company-kyc): Handelsregister records.

Missing a field or a source? Open an issue on this actor and describe it.

*Keywords: consulta CNPJ, CNPJ lookup, Brazil company data, Receita Federal API, QSA sócios, razão social, nome fantasia, situação cadastral, CNAE, empresas por CNAE, KYC Brazil, KYB, due diligence Brasil, CNPJ alfanumérico, validar CNPJ, BrasilAPI alternative, ReceitaWS alternative.*

# Changelog

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

# Actor input Schema

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

Brazilian company tax IDs, formatted (33.000.167/0001-01) or raw (33000167000101), including the new alphanumeric CNPJs. An 8-digit root returns the head office (0001). Check digits are validated first: invalid ones are listed in the status and never charged. One row per CNPJ.

## `cnaeCodes` (type: `array`):

Find companies by economic activity instead of (or as well as) a CNPJ list. 7-digit CNAE codes such as 6201501 or 6201-5/01. Matches the main activity unless you tick the box below.

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

Two-letter state codes such as SP, RJ, MG. Leave empty for all of Brazil. Used only with CNAE codes.

## `cityCodes` (type: `array`):

7-digit IBGE municipality codes, for example 3550308 for São Paulo. Used only with CNAE codes.

## `includeSecondaryCnae` (type: `boolean`):

Off: only companies whose MAIN activity is the CNAE code. On: also companies that list it as a secondary activity.

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

Skip companies whose registration is closed (baixada), suspended, unfit (inapta) or null. Skipped companies are never charged.

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

Cap on companies returned by the CNAE search. Does not limit the CNPJ list.

## Actor input object example

```json
{
  "cnpjs": [
    "33.000.167/0001-01",
    "00000000000191",
    "07526557000100"
  ],
  "includeSecondaryCnae": false,
  "onlyActive": true,
  "maxResults": 100
}
```

# Actor output Schema

## `dataset` (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",
        "00000000000191",
        "07526557000100"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tagadanar/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": [
        "33.000.167/0001-01",
        "00000000000191",
        "07526557000100",
    ] }

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

```

## MCP server setup

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