# Brazil CNPJ Lookup: Company Data, CNAE, Partners (QSA) (`larkmoor/brazil-cnpj-lookup`) Actor

Bulk CNPJ lookup for Brazilian companies from the Receita Federal open data: legal and trade name, status, opening date, CNAE activities, address, phones, email, Simples Nacional/MEI, share capital and partners (QSA). $0.60 per 1,000; invalid CNPJs free.

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

## Pricing

from $0.51 / 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 Data, CNAE, Partners (QSA)

Look up thousands of Brazilian companies by CNPJ in one run and get clean, structured rows: razão social (legal name), nome fantasia (trade name), situação cadastral (registration status) with date and reason, opening date, natureza jurídica (legal nature), porte (size), capital social, main and secondary CNAE activities with descriptions, full address with CEP and IBGE city code, phones, email, Simples Nacional and MEI status, tax regime history and the quadro de sócios e administradores (QSA, partners and administrators).

The data is the Receita Federal's open CNPJ dataset (dados abertos), served by the free, open-source public APIs BrasilAPI and Minha Receita — the actor switches to the second one automatically if the first is busy. No login, no captcha, no browser, no API key.

### What you can use it for

- **Enrich a CRM or spreadsheet**: turn a column of CNPJs into names, addresses, phones, emails, CNAE codes and partners
- **Supplier and customer checks (KYC / due diligence)**: is the company ATIVA, BAIXADA, INAPTA or SUSPENSA? Since when? Who are the partners and administrators?
- **Sales segmentation**: filter by CNAE, size (ME, EPP, DEMAIS), state and Simples Nacional status
- **Invoice and tax workflows**: confirm the legal name, address and tax regime before issuing documents
- **Data cleaning**: validate CNPJ check digits and drop invalid or unknown numbers for free

### Why this one

- **$0.60 per 1,000 companies** — cheaper than the other CNPJ actors, with no monthly rental and only $0.001 per run
- **Invalid and unknown CNPJs are free**: they still appear with the reason, so you can clean your list
- **Any format works**: `33.000.167/0001-01`, `33000167000101`, numbers without leading zeros, and the new **alphanumeric CNPJ** introduced in 2026 (check digits validated for both)
- **Two sources, one result**: if BrasilAPI is rate-limited, Minha Receita answers instead (the `source` field says which)
- **Rich output**: secondary CNAEs, partners with role, entry date and age range, Simples/MEI dates, tax regime history
- **Filters that save money**: only active companies, only certain states — filtered rows are not charged

### Input

| Field | What it does |
|---|---|
| CNPJ numbers | Any format, duplicates removed |
| Include partners (QSA) | Partners and administrators list |
| Include tax regime history | Yearly tax regime (Lucro Real, Presumido, Imune …) |
| Only active companies | Skip anything that is not ATIVA (not charged) |
| States (UF) | e.g. `SP`, `RJ` (others not charged) |
| Only found companies | Leave out the free invalid / not-found rows |
| Max CNPJs | Hard cap per run |

Example input:

```json
{
  "cnpjs": ["33.000.167/0001-01", "47960950000121", "19131243000197"],
  "includePartners": true,
  "onlyActive": true
}
```

### Output

One row per CNPJ:

```json
{
  "cnpj": "47960950000121",
  "cnpjFormatted": "47.960.950/0001-21",
  "found": true,
  "legalName": "MAGAZINE LUIZA S/A",
  "tradeName": null,
  "status": "ATIVA",
  "statusDate": "2005-11-03",
  "branchType": "MATRIZ",
  "openingDate": "1966-10-24",
  "legalNature": "Sociedade Anônima Aberta",
  "size": "DEMAIS",
  "shareCapital": 14202162000,
  "mainActivityCode": "4713004",
  "mainActivity": "Lojas de departamentos ou magazines, exceto lojas francas (Duty free)",
  "secondaryActivities": [{"code": "...", "description": "..."}],
  "address": "RUA VOLUNTARIOS DA FRANCA 1465, CENTRO, FRANCA - SP, 14400-490",
  "city": "FRANCA",
  "state": "SP",
  "cep": "14400-490",
  "phone1": "+55 16 3711-2002",
  "email": null,
  "simplesNacional": null,
  "mei": null,
  "partners": [{"name": "ANDRE LUIZ DE SOUZA FATALA", "role": "Diretor", "since": "2019-09-11", "ageRange": "Entre 41 a 50 anos", "type": "person"}],
  "source": "brasilapi"
}
```

Values are shown as published by Receita Federal (some example values above are shortened). Download as JSON, CSV, Excel or XML, or read the dataset through the Apify API.

### How much does it cost?

You pay **$0.0006 per company found** ($0.60 per 1,000) plus $0.001 per run. Invalid and not-found CNPJs are free. Compute is tiny (256 MB, no browser).

Worked examples:

1. **Enrich 1,000 customer CNPJs**: about **$0.60**
2. **Check 20,000 suppliers' status every month**: about **$12 per month**
3. **Clean a list of 5,000 CNPJs where 10% are invalid**: 4,500 × $0.0006 ≈ **$2.70**

### FAQ

**Where does the data come from?** From the Receita Federal's open CNPJ dataset, published monthly as public open data, through BrasilAPI and Minha Receita, two open-source public APIs that serve it. The actor paces its requests to stay polite to these free services, so very large lists take a while (about 3 CNPJs per second).

**Is this legal?** Yes — CNPJ registration data is public by law and published by Receita Federal for reuse. Partner CPFs are masked at the source. If you use partner names for marketing, follow the LGPD (legal basis, transparency, opt-out).

**How fresh is the data?** As fresh as the latest monthly Receita Federal release loaded by the public APIs.

**Can I search companies by CNAE or city instead of CNPJ?** This actor is a lookup by CNPJ. For lists, start from your own CNPJs (customers, suppliers, leads) or a public list.

**Why "not found"?** The number has valid check digits but is not in the dataset (for example a brand-new company not yet in the monthly release, or a typo that happens to pass the check).

### Tips

- Turn off partners for a lighter CSV
- Use "Only active companies" to skip closed businesses at no cost
- Schedule a monthly run on your supplier list to catch status changes

### Integrations

Send results to Google Sheets, HubSpot, Pipedrive, Airtable, a webhook, Zapier or Make with Apify integrations, or call the actor from your own code with the Apify API and client libraries.

### Changelog

- **0.1** (October 2026) — first release: bulk lookup, alphanumeric CNPJ validation, two-source fallback, QSA, Simples/MEI, tax regime history.

# Actor input Schema

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

CNPJ numbers in any format (33.000.167/0001-01, 33000167000101) - including the new alphanumeric CNPJs. Duplicates are removed.

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

Add the partners / administrators list (name, role, entry date, age range) as published by Receita Federal (CPFs are masked at the source).

## `includeTaxRegimeHistory` (type: `boolean`):

Add the yearly tax regime history (Lucro Real, Lucro Presumido, Imune...) when published.

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

Leave out companies whose registration status is not ATIVA (not charged).

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

Keep only companies in these states, e.g. 'SP', 'RJ', 'MG' (others are not charged).

## `onlyFound` (type: `boolean`):

Leave out invalid or unknown CNPJs (those rows are free anyway).

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

Stop after this many CNPJs.

## Actor input object example

```json
{
  "cnpjs": [
    "33.000.167/0001-01",
    "19.131.243/0001-97",
    "00.000.000/0001-91"
  ],
  "includePartners": true,
  "includeTaxRegimeHistory": false,
  "onlyActive": false,
  "onlyFound": false,
  "maxResults": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

All results as JSON items in the run's default dataset (also downloadable as CSV/Excel from the dataset).

# 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",
        "19.131.243/0001-97",
        "00.000.000/0001-91"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("larkmoor/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",
        "19.131.243/0001-97",
        "00.000.000/0001-91",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("larkmoor/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",
    "19.131.243/0001-97",
    "00.000.000/0001-91"
  ]
}' |
apify call larkmoor/brazil-cnpj-lookup --silent --output-dataset

```

## MCP server setup

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