# Brazil CNPJ Lookup & Sanctions Check (Receita, CEIS, CNEP) (`metallic_pastry/brazil-cnpj-lookup`) Actor

Bulk Brazil CNPJ lookup from the Receita Federal open registry: status, name, address, phones, email, CNAE, size, capital and partners, screened against the CEIS, CNEP and CEPIM sanction lists and leniency agreements. Risk flags, change tracking, alphanumeric CNPJ.

- **URL**: https://apify.com/metallic_pastry/brazil-cnpj-lookup.md
- **Developed by:** [Simon Liarsgård](https://apify.com/metallic_pastry) (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 $2.00 / 1,000 company records

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 & Sanctions Check

Paste a list of CNPJs and get one clean row per company from the Receita Federal open registry: legal and trade name, registration status, opening date, main and secondary CNAE activities, size, share capital, address, phones, email, Simples Nacional and MEI status, and the partners (QSA).

Each company is also checked against the federal sanction registers kept by the CGU: **CEIS** (suppliers barred from public contracts), **CNEP** (companies penalised under the Clean Company Act), **CEPIM** (non-profits barred from federal agreements) and the **leniency agreements** register. You can see at a glance whether a sanction is still in force or has expired.

### What you can use it for

- **Supplier and partner due diligence (KYB).** Check that a company is active and not barred from contracting before you sign, pay or onboard it.
- **Cleaning a customer or lead list.** Find closed, suspended and *inapta* companies, fix the names and addresses, and add phones, email and the CNAE activity for segmentation.
- **Credit and fraud checks.** Filter on `riskFlags`: companies opened in the last six months, zero share capital, an inactive registration or an active sanction.
- **Monitoring.** Run it on a schedule with change tracking on, and each row lists what changed since the last run (status, name, address, contacts, activity, partners or sanctions) in `changes`, with the field names in `changedFields` for quick filtering.

### Input

| Field | What it does |
|---|---|
| CNPJs | One per line, with or without punctuation. You can paste a whole spreadsheet column. Leading zeros that a spreadsheet dropped are restored, and the new alphanumeric CNPJ format (for example `12.ABC.345/01DE-35`) is supported. |
| Screen sanction lists | On by default. Checks CEIS, CNEP, CEPIM and leniency agreements. |
| Include partners (QSA) | On by default. Adds partners and administrators with their role, entry date and age range. |
| Track changes between runs | Off by default. Remembers each company and reports what changed. |
| Tracking key | Keeps a separate history for each list you watch. |
| Max companies / Parallel lookups | Limits for big lists. |

```json
{
    "cnpjs": ["00.000.000/0001-91", "33.000.167/0001-01", "19.131.243/0001-97"],
    "includeSanctions": true
}
```

### Output

One row per CNPJ. The **Overview** view has status, activity, location, contacts, sanctions and risk flags. **Sanctions** has one row per CEIS or CNEP sanction. **Partners** has one row per partner. **Detail** has every field. A `RUN_SUMMARY` record counts the companies found, those with active sanctions, and companies by state and status.

```json
{
    "cnpjFormatted": "00.002.776/0001-40",
    "status": "ok",
    "legalName": "DEUTSCHEBRAS COMERCIAL E ENGENHARIA LTDA",
    "registrationStatus": "Ativa",
    "isActive": true,
    "openedOn": "1994-05-09",
    "companySize": "Empresa de Pequeno Porte (EPP)",
    "mainActivity": { "code": "4759899", "description": "Comércio varejista de outros artigos de uso pessoal e doméstico não especificados anteriormente" },
    "addressLine": "RUA PALACETE DAS AGUIAS, 154, VILA ALEXANDRIA, SAO PAULO - SP, 04635-020",
    "phones": ["+55 11 5031-9619"],
    "partnerCount": 2,
    "isSanctioned": true,
    "activeSanctionCount": 3,
    "sanctions": [
        { "list": "CEIS", "category": "Declaração de Inidoneidade sem prazo determinado", "startDate": "2022-08-19", "endDate": null, "active": true, "sanctioningBody": "Controladoria-Geral da União" },
        { "list": "CNEP", "category": "Multa", "startDate": "2022-08-19", "endDate": null, "active": true, "fineBrl": 396237.13 }
    ],
    "riskFlags": ["zero_share_capital", "active_sanction_ceis", "active_sanction_cnep"],
    "registryUpdatedAt": "2026-10-14T09:48:02.8167836Z"
}
```

This is a shortened row from a real lookup in October 2026. Field names are in English; the values (statuses, activities, sanction categories) are kept in the original Portuguese, exactly as the government publishes them.

#### Risk flags

| Flag | Meaning |
|---|---|
| `registration_inapta`, `registration_baixada`, `registration_suspensa`, `registration_nula` | The registration is not active. |
| `special_situation` | The registry lists a special situation, such as a judicial recovery. |
| `opened_less_than_6_months_ago` | A very new company. |
| `zero_share_capital` | Share capital is registered as zero. |
| `mei_sole_trader` | Registered as a MEI micro-entrepreneur. |
| `active_sanction_ceis`, `active_sanction_cnep` | At least one sanction in that list is in force today. |
| `past_sanction` | The company has a sanction that has expired. |
| `cepim_impediment` | Listed in CEPIM. |
| `leniency_agreement` | Has signed a leniency agreement. |

A sanction counts as active when it has started and has no end date, or its end date is today or later.

### Pricing

You pay $0.002 per company found ($2 per 1,000), plus a tiny start fee. The sanction screening and partner list are included. You don't pay for:

- invalid CNPJs (wrong length or check digits) or CPFs;
- CNPJs that are not in the registry;
- errors.

Set a maximum charge on the run if you want a hard ceiling. The Actor stops cleanly when it's reached.

### Data source and freshness

The data comes from [OpenCNPJ](https://opencnpj.org), a free and open-source API built on the Receita Federal's monthly open data release of the CNPJ register and on the CGU's sanction lists from the Portal da Transparência. The registry is refreshed once a month, so a change made at the Receita this week may only show up after the next release. Each row has `registryUpdatedAt` with the date of the data it came from. The Actor only reads this public API. It doesn't log in anywhere and doesn't scrape any government website.

### Personal data (LGPD)

Partner names, age ranges and masked CPFs are published by the Receita Federal as public open data. If you store or reuse them, you are the controller of that data under the LGPD and need your own lawful basis, such as due diligence or legitimate interest. Turn off *Include partners* if you don't need them.

### Limits

- Only Brazilian legal entities (CNPJ). Individuals (CPF) are not looked up.
- The sanction lists cover federal registers. State and municipal lists that are not reported to the CGU are not included.
- A clean result is a good sign, not a legal certificate. For formal proof, use the official certificates from the Receita Federal and the Portal da Transparência.

### Support

Found a wrong value or need another field? Open an issue on the Actor page with the CNPJ and what you expected.

# Changelog

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

# Actor input Schema

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

Company CNPJs, one per line, with or without punctuation, for example "19.131.243/0001-97" or "33000167000101". The new alphanumeric format ("12.ABC.345/01DE-35") works, and leading zeros dropped by a spreadsheet are restored. You can paste a whole column. Duplicates are removed.

## `includeSanctions` (type: `boolean`):

Check each company against the federal CEIS (barred suppliers), CNEP (penalised companies) and CEPIM (barred non-profits) lists and the leniency agreement register. Active sanctions are counted and flagged.

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

Add the list of partners and administrators with role, entry date and age range. The partner count is always included.

## `trackChanges` (type: `boolean`):

Remember each company and report what changed since the previous run: status, name, address, contact details, activity, partners or sanctions. Useful on a schedule.

## `stateKey` (type: `string`):

Optional. Keeps separate change histories for different lists, for example "suppliers" and "leads".

## `maxCompanies` (type: `integer`):

Upper limit of CNPJs looked up in one run. Anything above it is skipped and not charged.

## `concurrency` (type: `integer`):

How many CNPJs are looked up at the same time.

## Actor input object example

```json
{
  "cnpjs": [
    "00.000.000/0001-91",
    "33.000.167/0001-01",
    "19.131.243/0001-97"
  ],
  "includeSanctions": true,
  "includePartners": true,
  "trackChanges": false,
  "maxCompanies": 10000,
  "concurrency": 5
}
```

# Actor output Schema

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

Default dataset, Overview view: status, activity, location, contacts, sanctions and risk flags per company.

## `sanctions` (type: `string`):

Default dataset, Sanctions view: one row per CEIS or CNEP sanction.

## `partners` (type: `string`):

Default dataset, Partners view: one row per partner or administrator.

## `detail` (type: `string`):

Default dataset, Detail view: every field per company.

## `runSummary` (type: `string`):

RUN_SUMMARY record in the default key-value store: found, free and charged counts, sanctioned companies and counts by state and status.

# 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.000.167/0001-01",
        "19.131.243/0001-97"
    ]
};

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

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

```

## MCP server setup

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