# Brazil CNPJ Company Leads – Lista de Empresas por CNAE e Cidade (`gazidev/brazil-cnpj-leads`) Actor

Brazil company leads (empresas por CNAE, cidade e UF) from the Receita Federal CNPJ register: active companies with phone, address, CNAE, size, capital and opening date. MEI excluded by default. $0.50 per 1,000 companies; filtered-out rows are free.

- **URL**: https://apify.com/gazidev/brazil-cnpj-leads.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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

## Brazil CNPJ Company Leads – Lista de Empresas por CNAE e Cidade

**Brazil company leads by activity and place.** Give one or more **CNAE codes** and a **city or state**, and get a list of Brazilian companies from the **Receita Federal CNPJ register**: legal and trade name, phone, full address, CNAEs, size, share capital, opening date and status.

- **Active companies only** by default, and **MEI excluded** by default.
- Filters: opening date, size (porte), head office, phone, minimum capital, legal nature, secondary CNAE.
- **$0.50 per 1,000 companies.** You pay only for rows you receive. Rows removed by your filters are **free**.
- No API key, no login, no proxy.

> The company search comes from [Minha Receita](https://minhareceita.org), a free, volunteer-run open-source project. **Its search is a beta feature** and can be busy at times. See *Limits* below.

### Em português: lista de empresas por CNAE

Informe o **CNAE** (ou palavras da descrição, como `odontológica`) e a **cidade** ou **UF**. Você recebe uma **lista de empresas** com razão social, nome fantasia, CNPJ, telefone, endereço, CNAE principal e secundários, porte, capital social, data de abertura, matriz/filial e Simples. Por padrão vêm só empresas **ATIVAS**, sem MEI e sem sócios. Filtre também **empresas novas** por data de abertura (`openedAfter`).

Preço: **US$ 0,50 por 1.000 empresas**. Linhas descartadas pelos filtros não são cobradas. Os dados são os **dados abertos do CNPJ da Receita Federal**. **Não há e-mail** nesta base.

### Em português: LGPD e uso responsável

Os dados são públicos, mas telefone, nome de empresário individual e sócios podem ser **dados pessoais**. **Você é responsável** pelo uso conforme a LGPD (Lei 13.709/2018): tenha base legal (por exemplo, legítimo interesse em B2B), informe a origem dos dados, atenda pedidos de exclusão e não envie spam. Use o mínimo necessário.

### Use cases

- **B2B prospecting:** all active dental clinics in Santa Catarina, restaurants in Campinas, accountants in Curitiba.
- **New companies:** firms opened in the last months in one activity (accounting, insurance, POS, software vendors).
- **Territory and market sizing:** companies by city, size and capital.
- **CRM building:** a clean first list with CNPJ as the key.

### Input

| Field | Description |
|---|---|
| `cnaeCodes` | `8630504` or `86.30-5/04`. A prefix such as `86305` expands to its subclasses. Max 10 codes. |
| `cnaeSearch` | Portuguese words found in the official CNAE description, e.g. `restaurantes e similares`. |
| `municipalities` | `Campinas/SP` or IBGE code `3509502`. Up to 50. |
| `states` | UF codes, used when no city is given. Up to 5. |
| `maxItems` | Stop after this many companies (default 50). |
| `status` | Default `["ATIVA"]`. |
| `openedAfter` / `openedBefore` | `2026-01-01` or `6 months`. |
| `porte` | `ME`, `EPP`, `DEMAIS`, `NAO_INFORMADO`. |
| `onlyWithPhone`, `headOfficeOnly`, `minCapital`, `legalNatureCodes` | More filters. |
| `excludeMei` | Default **true**. |
| `includeSecondaryCnae` | Also match secondary activities (needs cities). Default false. |
| `includePartners` | Partner names and roles (QSA, masked CPFs). Personal data, default **false**. |
| `maxScannedRows` | Register rows read per run, matching or not. Default 2,000, hard cap 10,000. |

At least one CNAE and one city or state are required.

```json
{
  "cnaeCodes": ["8630504"],
  "states": ["SC"],
  "onlyWithPhone": true,
  "maxItems": 200
}
```

### Output

```json
{
  "cnpj": "64454475000130",
  "cnpjFormatted": "64.454.475/0001-30",
  "companyName": "RMR CLINICA ODONTOLOGICA LTDA",
  "tradeName": "SORRISO E VIDA",
  "status": "ATIVA",
  "statusDate": "2026-01-13",
  "openedDate": "2026-01-13",
  "cnaeMain": { "code": "8630504", "description": "Atividade odontológica" },
  "cnaesSecondary": [{ "code": "8640205", "description": "Serviços de diagnóstico por imagem…" }],
  "legalNature": { "code": 2062, "description": "Sociedade Empresária Limitada" },
  "porte": "EPP",
  "capitalSocial": 50000,
  "isHeadOffice": true,
  "mei": false,
  "simples": true,
  "phone1": "(47) 9148-4580",
  "phone2": null,
  "address": "RUA 1500, 881, SALA 1",
  "district": "CENTRO",
  "city": "Balneário Camboriú",
  "ibgeCode": 4202008,
  "state": "SC",
  "cep": "88330-528",
  "partners": null,
  "sourceUrl": "https://minhareceita.org/64454475000130",
  "source": "Receita Federal via Minha Receita",
  "dataMonth": "2026-11"
}
```

The `OUTPUT` record in the key-value store has the run summary: rows scanned, rows removed per filter, the stop reason and whether the result list is complete.

### Pricing

| Event | Price |
|---|---|
| Company delivered | **$0.0005** ($0.50 per 1,000) |
| Actor start | $0.00005 |
| Rows removed by filters, duplicates, failed searches | free |

Set a *Maximum cost per run* and the Actor stops cleanly when it is reached.

#### Other Apify Store actors (price per 1,000 companies, Nov 2026)

| Actor | Price / 1,000 |
|---|---|
| **This Actor** | **$0.50** |
| epicscrapers/brazil-cnpj-scraper | $0.90 |
| johnatan029/cnpj-empresas-brasil-scraper | $1.50 |
| rowfinch/brazil-cnpj-leads | $1.50 + $0.50 partners |
| jeffev/leads-empresas-brasil-cnpj | $5.00 |

Feature sets differ. Some of these also return e-mail addresses; this Actor does not.

### Limits (please read)

- **The search is beta and shared.** Minha Receita may answer "too many requests" (HTTP 429) for everyone at once. The Actor waits 60 seconds, up to 3 times, and then finishes with the companies found so far. If that happens, run again later. A run that finds nothing for this reason says so in its status message and charges no companies.
- **Low load by design.** One request at a time, at least 1.5 seconds apart, 200 rows per page, at most 10,000 rows per run. These limits cannot be changed. Please do not start many runs in parallel; the whole community shares this server.
- **Not sorted by date.** There is no date filter at the source. A search such as "opened in the last 30 days" reads many rows to find a few. Raise `maxScannedRows` if needed; you still pay only for matches.
- **No e-mail** in this source. Phones are published as registered and can be old (some mobiles lack the ninth digit).
- **Monthly data.** `dataMonth` shows the Receita Federal release in use. The register is not live.
- **`includeSecondaryCnae`** works with cities only, because state-wide it is too heavy for the free server.

### Data source, credit and licence

Data: **Receita Federal, Cadastro Nacional da Pessoa Jurídica (CNPJ) open data**, published under Brazil's Access to Information Law (Lei 12.527/2011) and open-data policy (Decree 8.777/2016). Activity and city names come from the IBGE CNAE and Localidades APIs.

Search API: **[Minha Receita](https://minhareceita.org)** ([docs](https://docs.minhareceita.org), open source, MIT). It is free and funded by donations. **If this Actor helps your business, please [support Minha Receita](https://apoia.se/minhareceita).** This Actor is independent: it is not affiliated with Minha Receita or the Receita Federal.

### Personal data and LGPD

The register is public, but some fields can be personal data: phones of small firms, names of sole proprietors, partner names. **You are responsible for using the data in compliance with the LGPD (Lei 13.709/2018)** and with anti-spam rules: have a legal basis, tell people where you got their data and honour objections. To reduce risk, the Actor excludes MEI and partners by default, masks full CPF numbers that appear inside older company names, and has no search by person or CPF. To drop sole proprietors too, use `legalNatureCodes` such as `["2062", "2054"]`.

### Use with AI agents (Apify MCP)

Through the **Apify MCP server** (`https://mcp.apify.com`) an agent can answer requests such as:

- "List 100 active accounting firms in Curitiba with a phone number."
- "Which software companies opened in Florianópolis this year?"
- "Find large restaurants (porte DEMAIS) in Campinas."

API: `POST https://api.apify.com/v2/acts/gazidev~brazil-cnpj-leads/run-sync-get-dataset-items?token=…` with the input JSON.

### How is this different from our CNPJ Lookup?

[CNPJ Lookup in Bulk](https://apify.com/gazidev/brazil-cnpj-lookup) takes **CNPJ numbers you already have** and enriches them (tax regime, partners, status reason). **This Actor finds companies** you do not know yet, by activity and place.

### FAQ

**Which CNAE do I need?** Type Portuguese words in `cnaeSearch`, or check the [IBGE CNAE search](https://cnae.ibge.gov.br). If more than 10 codes match, the run stops and lists them so you can choose.

**Why fewer companies than I asked for?** Either the search ended (`complete: true` in `OUTPUT`) or `maxScannedRows` was reached. `filteredOut` shows which filter removed rows.

**How fast is it?** Normally 1–3 seconds per 200 rows, plus the pause. A 50-company run takes about 3–6 seconds when the server is not busy, and up to about 4 minutes when it is.

**Can I get all companies of a state?** Not in one run. Split by city, and keep the load low. For a full copy of the register, download the Receita Federal open data files.

### Related Actors by gazidev

- [CNPJ Lookup in Bulk](https://apify.com/gazidev/brazil-cnpj-lookup): enrich known CNPJs.
- [Mexico Business Directory](https://apify.com/gazidev/mexico-business-directory): DENUE leads with phone and e-mail.
- [France Company Search](https://apify.com/gazidev/france-company-search): SIRENE companies by NAF code and city.
- [Norway Company Search](https://apify.com/gazidev/norway-company-leads): new companies, CEO and board.
- [Website Contact Finder](https://apify.com/gazidev/website-contact-finder): e-mails and social profiles from company websites.
- [Phone Number Validator](https://apify.com/gazidev/phone-validator): validate and format phones.

# Actor input Schema

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

Activity codes, with or without punctuation: `8630504` or `86.30-5/04`. A shorter prefix such as `86305` expands to all its subclasses. Up to 10 codes per run. At least one code (or `cnaeSearch`) is required.

## `cnaeSearch` (type: `string`):

Words that must all appear in the official CNAE description, e.g. `odontológica`, `restaurantes e similares`, `desenvolvimento de programas`. Accents do not matter. The matching codes are added to the list above (max 10).

## `municipalities` (type: `array`):

`City/UF`, e.g. `Campinas/SP`, or an IBGE code such as `3509502`. Up to 50. If set, only these cities are searched.

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

Whole-state search, used only when no city is given (up to 5 states). With cities, it only helps to tell cities with the same name apart.

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

Stop after this many companies. You pay per company delivered.

## `status` (type: `array`):

Default: active companies only.

## `openedAfter` (type: `string`):

`2026-01-01` or relative, e.g. `6 months`. The source does not sort by date, so a narrow date range needs a higher `maxScannedRows`.

## `openedBefore` (type: `string`):

`2020-12-31` or relative, e.g. `5 years`.

## `porte` (type: `array`):

Leave empty for all sizes.

## `onlyWithPhone` (type: `boolean`):

Skip companies without a phone number.

## `headOfficeOnly` (type: `boolean`):

Skip branches (filiais).

## `excludeMei` (type: `boolean`):

Skip individual micro-entrepreneurs (MEI). Their company name and phone are usually personal data, so this is on by default.

## `minCapital` (type: `integer`):

Skip companies with a lower capital social.

## `legalNatureCodes` (type: `array`):

4-digit codes, e.g. `2062` (Ltda), `2054` (S/A fechada), `2135` (sole proprietor). Leave empty for all.

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

Also return companies that list the CNAE as a secondary activity. Needs `municipalities`.

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

Add partner names, roles and entry dates as published (CPFs are masked by the Receita). This is personal data under the LGPD, so it is off by default.

## `maxScannedRows` (type: `integer`):

Safety limit on register rows read, matching or not. The source is a free volunteer-run service: raise this only when you need it. Hard cap 10,000 per run.

## Actor input object example

```json
{
  "cnaeCodes": [
    "8630504"
  ],
  "states": [
    "SC"
  ],
  "maxItems": 50,
  "status": [
    "ATIVA"
  ],
  "onlyWithPhone": false,
  "headOfficeOnly": false,
  "excludeMei": true,
  "includeSecondaryCnae": false,
  "includePartners": false,
  "maxScannedRows": 2000
}
```

# Actor output Schema

## `companies` (type: `string`):

No description

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

No description

## `summary` (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 = {
    "cnaeCodes": [
        "8630504"
    ],
    "states": [
        "SC"
    ],
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/brazil-cnpj-leads").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 = {
    "cnaeCodes": ["8630504"],
    "states": ["SC"],
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/brazil-cnpj-leads").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 '{
  "cnaeCodes": [
    "8630504"
  ],
  "states": [
    "SC"
  ],
  "maxItems": 50
}' |
apify call gazidev/brazil-cnpj-leads --silent --output-dataset

```

## MCP server setup

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

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/LaY48SCaEyh4BEWpG/builds/5EgPTgL0xmq6orPBp/openapi.json
