# CNPJ Lookup: Brazil Company Registry Data (Receita Federal) (`nightwave-owner/brazil-cnpj-companies`) Actor

Returns the official Receita Federal registration of Brazilian companies by CNPJ, one row per company with legal and trade name, status, opening date, legal nature, main and secondary CNAE activities, address, share capital and company size. No partners, no personal data.

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

## Pricing

$3.00 / 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.

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

## CNPJ Lookup: Brazil Company Registry Data (Receita Federal)

The CNPJ (Cadastro Nacional da Pessoa Jurídica) is the national register number of every company and establishment in Brazil, kept by Receita Federal, the Brazilian federal revenue service. Its registration data (legal name, trade name, status, opening date, legal nature, CNAE activities, address, share capital and size) is public open data.

This actor takes a list of CNPJ numbers and returns one clean row per company, with English field names and stable types. Use it to check that a Brazilian customer or supplier exists and is active before you sign or invoice, to enrich a CRM or ERP list with the official name, address and activity code, or to watch a list of counterparties for status changes (for example ATIVA to BAIXADA or INAPTA) with a daily schedule.

Partners and directors (the QSA) and contact details are never returned. Sole proprietors and MEI (microempreendedor individual) are left out, since their registration is a private person.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `cnpjs` | array | `["00000000000191"]` | CNPJ numbers, 14 characters with or without punctuation (`00.000.000/0001-91` or `00000000000191`). The new alphanumeric CNPJ is accepted. Duplicates are looked up once. |
| `maxResults` | integer | `50` | Maximum number of CNPJ numbers looked up in one run, 1 to 5 000. |
| `onlyNew` | boolean | `false` | Return only companies not delivered before by a run with the same input, or whose status or status date has changed since. See Monitoring and scheduling. |

With an empty input the actor looks up Banco do Brasil, so you can see the output format at once.

Example input, as used in our test run on Apify:

```json
{
  "cnpjs": ["00.000.000/0001-91", "33.683.111/0002-80"],
  "maxResults": 50
}
```

### Output

One row per CNPJ. Companies are charged; rows with an `error` are not.

| Field | Description |
|---|---|
| `cnpj`, `cnpjFormatted` | `00000000000191` and `00.000.000/0001-91` |
| `legalName` | Razão social, the registered legal name |
| `tradeName` | Nome fantasia, the trade name, `null` when none is registered |
| `isHeadOffice` | `true` for the head office (matriz), `false` for a branch (filial) |
| `status`, `statusDate`, `statusReason` | Situação cadastral: `ATIVA`, `SUSPENSA`, `INAPTA`, `BAIXADA` or `NULA`, the date it took effect and the reason |
| `openingDate` | Data de início de atividade, `YYYY-MM-DD` |
| `legalNatureCode`, `legalNatureName` | Natureza jurídica, for example `2062` Sociedade Empresária Limitada or `2054` Sociedade Anônima Fechada |
| `mainActivityCode`, `mainActivityDescription` | Main CNAE activity, for example `6204-0/00` Consultoria em tecnologia da informação |
| `secondaryActivities` | Secondary CNAE activities, a list of `code` and `description` |
| `address` | The full address on one line |
| `street`, `number`, `complement`, `district`, `city`, `state`, `cep` | The address in parts. `state` is the two letter UF, `cep` the postal code |
| `cityIbgeCode`, `country` | IBGE municipality code and country |
| `capitalSocial` | Share capital in BRL |
| `companySize` | Porte: `MICRO EMPRESA`, `EMPRESA DE PEQUENO PORTE` or `DEMAIS` |
| `source`, `sourceUrl`, `retrievedAt` | Where and when the record was read |
| `error` | `null` for a company. Otherwise why there is no company row: invalid number, not found, sole proprietor or MEI, or a failed lookup |

Excerpt from a cloud run on 2026-10-03 (input as above, address fields shortened):

```json
{
  "cnpj": "00000000000191",
  "cnpjFormatted": "00.000.000/0001-91",
  "legalName": "BANCO DO BRASIL SA",
  "tradeName": "DIRECAO GERAL",
  "isHeadOffice": true,
  "status": "ATIVA",
  "statusDate": "2005-11-03",
  "statusReason": "SEM MOTIVO",
  "openingDate": "1966-08-01",
  "legalNatureCode": 2038,
  "legalNatureName": "Sociedade de Economia Mista",
  "mainActivityCode": "6422-1/00",
  "mainActivityDescription": "Bancos múltiplos, com carteira comercial",
  "secondaryActivities": [
    { "code": "6499-9/99", "description": "Outras atividades de serviços financeiros não especificadas anteriormente" }
  ],
  "district": "ASA NORTE",
  "city": "BRASILIA",
  "cityIbgeCode": 5300108,
  "state": "DF",
  "cep": "70040912",
  "country": "BRASIL",
  "capitalSocial": 120000000000,
  "companySize": "DEMAIS",
  "sourceUrl": "https://minhareceita.org/00000000000191",
  "error": null
}
```

### Example from a real run

Input:

```json
{
  "cnpjs": [
    "00.000.000/0001-91"
  ],
  "maxResults": 5
}
```

Output (first 1 of 1 rows, values unchanged):

```json
[
  {
    "cnpj": "00000000000191",
    "cnpjFormatted": "00.000.000/0001-91",
    "legalName": "BANCO DO BRASIL SA",
    "tradeName": "DIRECAO GERAL",
    "isHeadOffice": true,
    "status": "ATIVA",
    "statusDate": "2005-11-03",
    "statusReason": "SEM MOTIVO",
    "openingDate": "1966-08-01",
    "legalNatureCode": 2038,
    "legalNatureName": "Sociedade de Economia Mista",
    "mainActivityCode": "6422-1/00",
    "mainActivityDescription": "Bancos múltiplos, com carteira comercial",
    "secondaryActivities": [
      {
        "code": "6499-9/99",
        "description": "Outras atividades de serviços financeiros não especificadas anteriormente"
      }
    ],
    "address": "QUADRA SAUN QUADRA 5 BLOCO B TORRE I, II, III, SN, ANDAR T I SL S101 A S1602 T II SL C101 A C1602 TIII SL N101 A N1602, ASA NORTE, BRASILIA/DF, 70040912",
    "street": "QUADRA SAUN QUADRA 5 BLOCO B TORRE I, II, III",
    "number": "SN",
    "complement": "ANDAR T I SL S101 A S1602 T II SL C101 A C1602 TIII SL N101 A N1602",
    "district": "ASA NORTE",
    "city": "BRASILIA",
    "cityIbgeCode": 5300108,
    "state": "DF",
    "cep": "70040912",
    "country": "BRASIL",
    "capitalSocial": 120000000000,
    "companySize": "DEMAIS",
    "source": "Receita Federal do Brasil, Cadastro Nacional da Pessoa Jurídica (open data), via the Minha Receita API (minhareceita.org)",
    "sourceUrl": "https://minhareceita.org/00000000000191",
    "retrievedAt": "2026-10-04T07:49:44.353Z",
    "error": null
  }
]
```

Run HryteUYmouCtX3vu7 on 2026-10-04, 1 row, 4 seconds.

### Common uses

- Know your customer and supplier checks: confirm that a CNPJ exists, is `ATIVA` and has the legal name on the contract.
- Clean and enrich a list of Brazilian accounts with the official name, address, CNAE code and size.
- Segment accounts by CNAE activity, state or size.
- Monitor counterparties for status changes with a daily scheduled run and `onlyNew`.

### Monitoring and scheduling

Set `onlyNew` to `true` and schedule the actor in Apify (Schedules, Create new, for example the cron expression `0 7 * * *` for every morning at 07:00) with the same input each time. The first run returns every company in the list. Later runs return only companies that are new in the list or whose `status` or `statusDate` has changed, so a run where nothing happened returns no rows and costs only the start. The state is kept in the key-value store `nightwave-state-brazil-cnpj-companies`, one record per input; changing `maxResults` does not reset it.

```json
{
  "cnpjs": ["00000000000191", "33683111000280"],
  "onlyNew": true
}
```

### Pricing

Pay per event: one `company` event per company row. Invalid numbers, numbers not found, sole proprietors and MEI give a row with an `error` and are not charged.

### Limits

- This is a lookup by CNPJ. It does not search the register by name, activity or city.
- The data is as fresh as the latest monthly release from Receita Federal loaded by the source, so a status change can show up some weeks later than in the Receita Federal website.
- Lookups are paced at 2 per second out of respect for the volunteer run source, so 1 000 CNPJ numbers take about 9 minutes.
- Phone numbers, e-mail addresses and partners are left out on purpose, also for companies.

### Source and license

- Data: Receita Federal do Brasil, Cadastro Nacional da Pessoa Jurídica, published as open data ("Dados Abertos do CNPJ"). Under the Brazilian Access to Information Law (Lei nº 12.527/2011) and the federal open data policy (Decreto nº 8.777/2016), data published by the federal executive as open data is free to use by the public (livre utilização).
- Access: the public API of Minha Receita (https://minhareceita.org), an open source project (MIT license) that loads the Receita Federal files into one database. Its documentation (docs.minhareceita.org, read 2026-10-03) describes the purpose as making the CNPJ data, which by the Access to Information Law must be public and machine readable, easier to use, and states that the public API has no service level guarantee. It sets no restriction on use. The actor paces its requests and identifies itself with a user agent. If you run many lookups, consider supporting the project.
- We looked at BrasilAPI too, but its terms ask users not to make automated high volume requests, so it is not used.

This actor is not affiliated with Receita Federal or Minha Receita.

### På svenska

Actorn slår upp brasilianska bolag på CNPJ-nummer (bolagsregistret hos Receita Federal, den brasilianska skattemyndigheten) och returnerar en rad per bolag: firma, särskilt namn, status, startdatum, bolagsform, huvud- och bibranscher (CNAE), adress, aktiekapital och storleksklass. Delägare, styrelse, telefon och e-post tas aldrig med, och enskilda firmor och MEI utelämnas eftersom de är privatpersoner. Använd den för kund- och leverantörskontroll, för att berika en kundlista eller för att bevaka statusändringar med en daglig schemalagd körning och `onlyNew`. Källan är Receita Federals öppna data via det öppna API:t Minha Receita. Debitering sker per bolag; rader med fel debiteras inte.

Exempel från en verklig körning: input och de första raderna i outputen finns i avsnittet Example from a real run ovan (körning HryteUYmouCtX3vu7, 2026-10-04, 1 rad, 4 sekunder).

Nightwave AB, kontakt@nightwave.se

# Actor input Schema

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

CNPJ numbers to look up, 14 characters with or without punctuation, for example 00.000.000/0001-91 or 33683111000280. The new alphanumeric CNPJ format is accepted too. Invalid numbers get a row with an error and are not charged. Leave empty to try the actor on Banco do Brasil (00000000000191).

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

Maximum number of CNPJ numbers to look up in one run, 1 to 5 000. Numbers beyond it are left out with a note in the log. Example: 50.

## `onlyNew` (type: `boolean`):

Return only companies that earlier runs with the same input did not deliver, or whose registration status or status date has changed since, for daily monitoring of a customer or supplier list. Default false.

## Actor input object example

```json
{
  "cnpjs": [
    "00000000000191",
    "33683111000280"
  ],
  "maxResults": 50,
  "onlyNew": false
}
```

# Actor output Schema

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

All rows produced by the run, as JSON. Open in Apify Console or download via the dataset API.

# 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": [
        "00.000.000/0001-91",
        "33.683.111/0002-80"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("nightwave-owner/brazil-cnpj-companies").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": [
        "00.000.000/0001-91",
        "33.683.111/0002-80",
    ],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("nightwave-owner/brazil-cnpj-companies").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": [
    "00.000.000/0001-91",
    "33.683.111/0002-80"
  ],
  "maxResults": 50
}' |
apify call nightwave-owner/brazil-cnpj-companies --silent --output-dataset

```

## MCP server setup

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

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/plrolXX9HtmfsBG4p/builds/r3PzdLR71vk2jIZiM/openapi.json
