# Brazil CNPJ Company Lookup with Only-New Alerts (`sourcewise/brazil-cnpj-company-lookup`) Actor

Looks up Brazilian companies by CNPJ number from the public Receita Federal registry via BrasilAPI, returning legal and trade names, status, registration date, CNAE activity codes, company partners and address, with an only-new mode for repeat runs.

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

## Pricing

from $1.40 / 1,000 results

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 Company Lookup with Only-New Alerts

Looks up Brazilian companies by CNPJ from the public Receita Federal registry through BrasilAPI. Returns legal and trade names, registration status, registration date, CNAE activity codes, company partners, and address. Includes an only-new mode for repeat runs and monitoring.

Data comes from the public Receita Federal registry, accessed through BrasilAPI. No login or buyer API key is required. Individual partners are not returned, because they are private people.

### Who it's for

- Compliance and KYB teams checking Brazilian counterparties
- Sales and CRM teams enriching Brazilian company records
- Developers building pipelines around public Brazilian company data
- Teams monitoring company status or activity changes over time

### Use cases

- Validate a CNPJ and its current registration status before onboarding
- Enrich records with legal name, trade name, CNAE codes, and address
- Track changes between runs using only-new mode
- Keep a dataset of partners that are legal entities

### Input

- **Company numbers (CNPJ)** (`cnpjs`, required): paste one or more Brazilian company numbers, separated by commas, spaces, or new lines. Dots, slashes, and dashes are removed automatically.
- **Only new or changed since last run** (`onlyNew`, optional): when on, the run reports only companies whose data changed since the previous run. Off by default.

Example input:

{
"cnpjs": "00000000000191",
"onlyNew": false,
"maxItems": 100
}

### Output

Each result is one company record. Key fields include:

| Field | Description |
| --- | --- |
| `cnpj` | 14-digit company number without punctuation |
| `legalName` | Registered legal name (razão social) |
| `tradeName` | Trade name (nome fantasia), if registered |
| `status` | Registration status at Receita Federal |
| `registrationDate` | Company registration date in YYYY-MM-DD format |
| `primaryActivityCode` | Main CNAE activity code |
| `primaryActivityDescription` | Text of the main CNAE activity |
| `secondaryActivities` | Secondary CNAE activity codes and descriptions |
| `companyType` | Legal nature of the company |
| `shareCapital` | Registered share capital in reais |
| `partnerCompanies` | Partners that are companies, with name and role |
| `street` | Street name |
| `city` | Municipality |
| `state` | Two-letter state code |
| `zipCode` | Postal code (CEP) without punctuation |
| `changedAt` | Time this run detected the record, in ISO 8601 format |
| `changedFields` | Names of fields that differ from the previous run |

Example output:

\[
{
"cnpj": "00000000000191",
"legalName": "BANCO DO BRASIL SA",
"tradeName": "DIRECAO GERAL",
"status": "ATIVA",
"registrationDate": "1966-08-01",
"primaryActivityCode": "6422100",
"primaryActivityDescription": "Bancos múltiplos, com carteira comercial",
"secondaryActivities": null,
"companyType": "Sociedade de Economia Mista",
"shareCapital": 120000000000,
"partnerCompanies": null,
"street": "SAUN QUADRA 5 BLOCO B TORRE I, II, III",
"city": "BRASILIA",
"state": "DF",
"zipCode": "70040912",
"changedAt": "2026-11-24T14:50:37.275Z",
"changedFields": \[]
}
]

### Pricing

About $2 per 1,000 results. Buyers are charged per result.

### Limits and notes

- Data depends on the public Receita Federal registry and BrasilAPI availability.
- On the first run, all requested companies are returned and `changedFields` is empty.
- With only-new mode on, a run reports only companies whose data changed since the previous run. If nothing changed, it reports no items.
- `changedAt` is set on every record.
- Partners that are individuals are omitted from `partnerCompanies`.
- No login, buyer API key, or bot-protection bypass is required.

### Example output

```json
[
  {
    "cnpj": "00000000000191",
    "legalName": "BANCO DO BRASIL SA",
    "tradeName": "DIRECAO GERAL",
    "status": "ATIVA",
    "registrationDate": "1966-08-01",
    "primaryActivityCode": "6422100",
    "primaryActivityDescription": "Bancos múltiplos, com carteira comercial",
    "secondaryActivities": null,
    "companyType": "Sociedade de Economia Mista",
    "shareCapital": 120000000000,
    "partnerCompanies": null,
    "street": "SAUN QUADRA 5 BLOCO B TORRE I, II, III",
    "city": "BRASILIA",
    "state": "DF",
    "zipCode": "70040912",
    "changedAt": "2026-11-24T14:50:37.275Z",
    "changedFields": []
  }
]
```

# Actor input Schema

## `cnpjs` (type: `string`):

Paste one or more Brazilian company numbers (CNPJ), separated by commas, spaces or new lines. Dots, slashes and dashes are removed automatically. Example: 00.000.000/0001-91, 33.000.167/0001-01.

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

When on, the run reports only companies whose data changed since the previous run, and reports nothing if nothing changed. Off by default. Example: true.

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

Stop after this many results (you pay per result).

## Actor input object example

```json
{
  "cnpjs": "00000000000191",
  "onlyNew": false,
  "maxItems": 100
}
```

# Actor output Schema

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

One item per result, with: cnpj, legalName, tradeName, status, registrationDate, primaryActivityCode, primaryActivityDescription, secondaryActivities, companyType, shareCapital, partnerCompanies, street, city, state, zipCode, changedAt, changedFields.

## `summary` (type: `string`):

How many results the run returned, and when it finished.

# 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": "00000000000191"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sourcewise/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": "00000000000191" }

# Run the Actor and wait for it to finish
run = client.actor("sourcewise/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": "00000000000191"
}' |
apify call sourcewise/brazil-cnpj-company-lookup --silent --output-dataset

```

## MCP server setup

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