# Lista de Empresas por CNAE e Consulta CNPJ: Brazil Leads (`leafcliff/brazil-companies-cnpj`) Actor

Lista de empresas ativas por CNAE, cidade, raio e data de abertura, ou consulta CNPJ em lote, com telefone, e-mail, sócios (QSA) e 20 bases do governo. Receita Federal, atualizada todo mês. Brazil company leads and bulk CNPJ lookup.

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

## Pricing

from $1.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

## Lista de Empresas por CNAE e Consulta CNPJ: Brazil Leads

🇧🇷 *Versão em português [no fim da página](#-versão-em-português).*

![Brazilian companies filtered by state, CNAE, opening date and mobile phone](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/hero-en.png?v=4)

Active Brazilian companies straight from the official Receita Federal open data (Dados Abertos do CNPJ), refreshed every month and cross-referenced with 20 other government datasets. Build a prospect list by activity, city, radius or opening date, or paste a list of CNPJs to enrich.

### ✨ Highlights

- **27.8 million active companies**, headquarters and branches, from the November 2026 release
- **New companies feed**: companies opened in the last N days, and an option to receive only the ones you have not seen yet
- **Radius search**: every company within X km of a point, with the distance
- **Contacts, classified**: phones typed as mobile or landline, emails typed as corporate, personal, shared or invalid
- **Partners (QSA)** with name and role
- **20 government datasets** by CNPJ: federal debt, sanctions, tax regime, public contracts, trademarks, health, financial and more
- **Fast**: a run takes seconds, because it reads an indexed copy of the data instead of downloading 7 GB of files

### 🎯 What people use it for

| Use | Example |
|---|---|
| Weekly feed of new companies | Every company opened this week in your city and segment. Accountants, banks, software and equipment vendors use this one |
| Prospect lists | Every restaurant (CNAE 5611) in Curitiba with a phone number |
| Local market mapping | All clinics within 3 km of an address |
| Enrichment | Address, activity, size, contacts and partners for a spreadsheet of CNPJs |
| Due diligence | Federal debt, sanctions and public contracts for a list of suppliers |

### 🚀 How to use

1. Pick a **mode**: `search` to filter companies, or `lookup` to enrich a list of CNPJs.
2. Set the filters (state, city, CNAE, opening date, radius…) and **Max results**, which caps what you pay.
3. Run, then download as Excel, CSV or JSON, or connect to your CRM through the API, Make, Zapier or n8n.

**Ready-made examples** (open one and click *Start*):

- [New companies in São Paulo, last 30 days](https://apify.com/leafcliff/brazil-companies-cnpj/tasks/empresas-recem-abertas-sao-paulo)
- [Restaurants in Curitiba with a phone number](https://apify.com/leafcliff/brazil-companies-cnpj/tasks/restaurantes-curitiba-telefone)
- [Bulk CNPJ lookup](https://apify.com/leafcliff/brazil-companies-cnpj/tasks/consulta-cnpj-em-lote)

Example input:

```json
{
  "mode": "search",
  "states": ["SP"],
  "cities": ["Campinas"],
  "cnaes": ["6201-5/01"],
  "openedWithinDays": 30,
  "requirePhone": true,
  "maxResults": 500
}
```

### 🔎 Filters

| Filter | How it works |
|---|---|
| **State, city, region** | One or more UFs, cities or regions. Optionally a minimum city population |
| **CNAE** | Full codes (`6201-5/01`) or prefixes: `62` matches every IT services subclass, `4711` every supermarket subclass. Main activity only, or secondary activities too |
| **Opening date** | Opened in the last N days (counted back from the newest date in the current release), or a from/to range |
| **Radius** | Latitude, longitude and radius in km. Each company comes with `distanceKm` |
| **Company profile** | Size, legal nature, Simples Nacional, MEI (include, exclude or only), headquarters only |
| **Contacts** | Require phone, mobile, email or website. Filter by email type |
| **Government data** | Federal debt, sanctions, tax regime, public supplier, and any true/false marker (e.g. `anvisaAfeActive`, `ispProvider`, `cvmListed`) |
| **Only new since my last run** | Remembers the newest company delivered for the same filters. Schedule the Actor weekly and pay only for companies you have not received |

Results come newest first.

![Radius search: 572 food service companies within 1 km of MASP, sorted by distance](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/radius-en.png?v=4)

### 📦 What you get

One row per establishment (headquarters or branch).

![JSON output of one company: registry, contacts and government data](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/row-en.png?v=4)

#### Registry

| Field | Description |
|---|---|
| `cnpj` | 14 digits, e.g. `12345678000199` |
| `legalName`, `tradeName` | Razão social and nome fantasia |
| `openedOn`, `activeSince` | Opening date and date the status became active |
| `mainCnae`, `mainCnaeDescription`, `secondaryCnaes` | Activity codes |
| `legalNature`, `companySize`, `shareCapital` | Company profile |
| `simplesNacional`, `mei` | Tax regime flags |
| `isHeadquarters` | Matriz or filial |
| `partners` | Partners (QSA): name, role, type and start date. Company partners include their CNPJ |

#### Location

| Field | Description |
|---|---|
| `street`, `number`, `complement`, `neighborhood`, `zipCode`, `city`, `uf`, `region` | Address |
| `cityIbgeCode`, `cityPopulation` | IBGE code and population estimate of the city |
| `latitude`, `longitude`, `geoPrecision` | Coordinates from IBGE's 2022 address registry (CNEFE). `address` = matched street and number, `zip` = center of the ZIP code. MEI and sole proprietors only get the ZIP center |

#### Contacts

| Field | Description |
|---|---|
| `phone1`, `phone2` | Normalized phones. Old 8-digit mobiles get the leading 9 |
| `phone1Raw`, `phone2Raw` | The same phones exactly as registered, digits only (area code + number), e.g. `1130465800` |
| `phone1Type`, `phone2Type`, `whatsappLikely` | Mobile or landline, from the number format |
| `email`, `emailType` | `corporate` (own domain), `personal` (Gmail, Hotmail…), `shared` (the accountant's, or a domain used by many unrelated companies) or `invalid` (typos like gmail.con, placeholders) |
| `websiteDomain` | Probable website, inferred from an email on the company's own domain |
| `emailAcceptsMail` | Whether the email's domain accepts mail (DNS MX record) |

### 🏛️ Government data

Optional, cross-referenced by CNPJ with 20 official open datasets. A field is empty when the company does not appear in that source.

| Topic | Fields | Source |
|---|---|---|
| Federal debt | `federalDebt` (true only when debt is being collected), `federalDebtInCollection`, `federalDebtNegotiated`, `federalDebtSuspended`, `federalDebtTotal`, `federalDebtTax`, `federalDebtSocialSecurity`, `federalDebtFgts`, `federalDebtJudicial`, `federalDebtInscriptions` | PGFN, quarterly |
| Installment plans | `installment`, `installmentCount`, `installmentBalance`, `installmentPrograms`, `installmentLastDate` | Receita Federal, monthly |
| Tax regime | `taxRegime`, `taxRegimeYear` | ECF, annual |
| Tax benefits | `taxBenefits`, `taxBenefitCount`, `taxBenefitEmpresaCidada`, `taxBenefitPerse`, `taxBenefitSudamSudene`, `taxBenefitRetIncorporacao`, `taxBenefitReidi` | SISEN (Receita) |
| Declared tax benefit amounts | `dirbiYear`, `dirbiTotalLastYear`, `dirbiByTax`, `dirbiTotalYtd`, `dirbiLastPeriod` | DIRBI (Receita), semiannual |
| Sanctions | `sanctioned`, `sanctions` (CEIS/CNEP), `tcuIneligible`, `tcuIneligibleUntil`, `leniencyAgreement`, `leniencyAgreements`, `cepimImpeded`, `cepimReasons` | CGU, TCU, daily |
| Public contracts | `govContracts`, `govContractsValue`, `govLastContract` | PNCP, since 2023 |
| Construction works | `constructionWorks`, `constructionActiveWorks`, `constructionAreaM2`, `constructionLastStart`, `constructionBuilder`, `constructionDeveloper` | CNO (Receita) |
| Trademarks and patents | `trademarksActive`, `trademarksPending`, `trademarkNames`, `trademarkNextExpiry`, `trademarkLastFiling`, `patentApplications` | INPI, weekly |
| Health | `healthUnits`, `healthUnitTypes`, `healthHospital`, `healthSus`, `healthBeds`, `healthIcuBeds` | CNES |
| Health regulators | `anvisaAfeActive`, `anvisaProductTypes`, `anvisaActivities`, `anvisaGmpValid`, `anvisaGdpValid`, `ansOperator`, `ansModality` | ANVISA, ANS |
| Financial | `bcbInstitution`, `bcbGroup`, `bcbSegment`, `cvmListed`, `cvmCategory`, `cvmIssuerStatus` (e.g. in judicial recovery), `cvmSector` | Banco Central, CVM |
| Fuel stations | `anpFuelStation`, `anpBrand`, `anpBrandSince` | ANP |
| Internet providers | `ispProvider`, `ispBroadbandSubscribers`, `ispMunicipalities`, `ispStates`, `ispTechnologies`, `ispFiberShare` | ANATEL, monthly |
| Private schools | `school`, `schoolStudents`, `schoolTeachers`, `schoolLevels`, `schoolCategory` | INEP school census |
| Meat and dairy plants | `sifRegistered`, `sifNumbers`, `sifAreas`, `sifCategories` | SIF (Ministry of Agriculture) |

Any true/false field works in **Require markers**, for example `anvisaAfeActive` for licensed pharma and cosmetics companies, `ispProvider` for internet providers or `cvmListed` for listed companies.

### ✅ Data quality

![Contacts of new companies: phone, WhatsApp and email type](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/contacts-en.png?v=4)

Nothing is invented, but not everything is a raw copy of a government file. Every field falls into one of three levels:

| Level | Meaning | Fields |
|---|---|---|
| 🟢 **Official, as published** | Copied from the source, only formatted | `cnpj`, `tradeName`, `legalNature`, `mei`, `simplesNacional`, `shareCapital`, `companySize`, `openedOn`, `activeSince`, `mainCnae`, `secondaryCnaes`, address fields, `phone1Raw`, `phone2Raw`, `email` (as declared), `partners`, `taxRegime`, sanction details, CVM, Banco Central, ANS, ANP, ANVISA and SIF registrations |
| 🟡 **Official, computed by us** | Derived from official data with a documented rule | `federalDebt` (true only for debt in collection) and debt totals, installment totals, DIRBI yearly totals, active tax benefits, trademark counts (INPI's 100+ statuses mapped to active/pending), construction counts and area (areas over 5 million m² ignored as typos), hospital beds, school students, broadband subscribers, `region`, `cityIbgeCode`, `cityPopulation`, `legalName` of MEI and sole proprietors (CPF removed) |
| 🔵 **Our inference, can be wrong** | A best guess, clearly labeled | `phone1Type`, `phone2Type`, `whatsappLikely`, `emailType`, `websiteDomain`, `emailAcceptsMail` (a real DNS check, but it does not confirm the mailbox exists), `latitude`/`longitude`/`distanceKm`, `govContracts` (PNCP coverage starts in 2023) |

Keep in mind:

- **Official does not mean current.** Address, CNAE, phone and email are declared by the company and often outdated, and contacts are frequently the accountant's. Each source has its own cycle: Receita Federal is monthly, PGFN quarterly, the ECF tax regime annual (Simples Nacional companies do not file it, so an empty value means nothing).
- **Negative markers are facts with dates, not judgments.** A sanction, debt or impediment means the company appears in that official list, as published.
- If you need verified contacts, use this as the list and validate emails and phones with a dedicated service before a campaign.

### 🔒 Privacy

- Partners come with name and role only. No CPF, not even the masked digits, and no age range.
- For MEI and sole proprietors (empresário individual) the company *is* a person, so the CPF is removed from the legal name and the street number and complement are omitted, because that address is usually the owner's home.
- Individual-person legal natures (rural producers, auctioneers…) and inactive companies are not included.
- Anyone can ask to be removed. Removals apply to every new run.

### 💰 Pricing

You pay only for what you get, per company returned. No subscription.

| What | Price |
|---|---|
| Company (registry, partners, contacts, location, IBGE) | **$1.50 per 1,000** |
| Government data, optional | **+$1.00 per 1,000** |
| Run start | $0.00005 per run |

- Government data is off by default. Turn on **Include government data**, or use any government filter, and it is included and charged automatically.
- CNPJs not found in lookup mode are free.
- The run stops cleanly at your maximum cost per run and never charges for a company it did not deliver.

### 🔄 Data source and freshness

Receita Federal publishes the full CNPJ registry as open data once a month. This Actor reads a cleaned and indexed copy of the latest release, updated a few days after each publication. Government datasets are refreshed on their own cycles (see the table above).

### ❓ FAQ

**Is this data legal to use?**
It is public open data published by the Brazilian government. Use it according to the LGPD, especially for marketing to sole proprietors.

**Does it include inactive companies?**
No. Only companies with active status (situação cadastral ativa).

**Can I get only new companies every week?**
Yes. Set **Opened in the last N days**, turn on **Only new since my last run** and schedule the Actor.

**What if a CNPJ in my list does not exist?**
It is skipped and not charged.

***

## 🇧🇷 Versão em português

![Empresas filtradas por UF, CNAE, data de abertura e celular](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/hero-pt.png?v=4)

Empresas ativas do Brasil direto dos Dados Abertos do CNPJ da Receita Federal, atualizados todo mês e cruzados com outras 20 bases do governo. Monte uma lista de empresas para prospecção por atividade, cidade, raio ou data de abertura, ou cole uma lista de CNPJs para enriquecer.

### ✨ Destaques

- **27,8 milhões de empresas ativas**, matrizes e filiais, da base de novembro de 2026
- **Feed de empresas novas**: empresas abertas nos últimos N dias, com a opção de receber só as que você ainda não viu
- **Busca por raio**: todas as empresas a até X km de um ponto, com a distância
- **Contatos classificados**: telefones identificados como celular ou fixo, e-mails como corporativo, pessoal, compartilhado ou inválido
- **Sócios (QSA)** com nome e qualificação
- **20 bases do governo** por CNPJ: dívida ativa, punições, regime tributário, contratos públicos, marcas, saúde, setor financeiro e outras
- **Rápido**: cada execução leva segundos, porque lê uma cópia indexada dos dados em vez de baixar 7 GB de arquivos

### 🎯 Para que serve

| Uso | Exemplo |
|---|---|
| Feed semanal de empresas novas | Todas as empresas abertas na semana na sua cidade e segmento. Muito usado por contadores, bancos e fornecedores de software e equipamentos |
| Listas de prospecção | Todos os restaurantes (CNAE 5611) de Curitiba com telefone |
| Mapeamento de mercado local | Todas as clínicas a até 3 km de um endereço |
| Enriquecimento | Endereço, atividade, porte, contatos e sócios para uma planilha de CNPJs |
| Análise de fornecedores | Dívida ativa, punições e contratos públicos de uma lista de fornecedores |

### 🚀 Como usar

1. Escolha o **modo**: `search` para filtrar empresas ou `lookup` para enriquecer uma lista de CNPJs.
2. Defina os filtros (UF, cidade, CNAE, data de abertura, raio…) e o **Max results**, que limita quanto você paga.
3. Rode e baixe em Excel, CSV ou JSON, ou conecte ao seu CRM pela API, Make, Zapier ou n8n.

**Exemplos prontos** (abra um e clique em *Start*):

- [Empresas recém-abertas em São Paulo, últimos 30 dias](https://apify.com/leafcliff/brazil-companies-cnpj/tasks/empresas-recem-abertas-sao-paulo)
- [Restaurantes em Curitiba com telefone](https://apify.com/leafcliff/brazil-companies-cnpj/tasks/restaurantes-curitiba-telefone)
- [Consulta CNPJ em lote](https://apify.com/leafcliff/brazil-companies-cnpj/tasks/consulta-cnpj-em-lote)

Exemplo de entrada:

```json
{
  "mode": "search",
  "states": ["SP"],
  "cities": ["Campinas"],
  "cnaes": ["6201-5/01"],
  "openedWithinDays": 30,
  "requirePhone": true,
  "maxResults": 500
}
```

### 🔎 Filtros

| Filtro | Como funciona |
|---|---|
| **UF, cidade, região** | Uma ou mais UFs, cidades ou regiões. Opcionalmente, população mínima da cidade |
| **CNAE** | Código completo (`6201-5/01`) ou prefixo: `62` pega todas as subclasses de serviços de TI, `4711` todos os supermercados. Só a atividade principal ou também as secundárias |
| **Data de abertura** | Abertas nos últimos N dias (contados a partir da data mais recente da base do mês) ou um intervalo de datas |
| **Raio** | Latitude, longitude e raio em km. Cada empresa vem com `distanceKm` |
| **Perfil da empresa** | Porte, natureza jurídica, Simples Nacional, MEI (incluir, excluir ou só MEI), só matrizes |
| **Contatos** | Exigir telefone, celular, e-mail ou site. Filtrar por tipo de e-mail |
| **Dados do governo** | Dívida ativa, punições, regime tributário, fornecedor do governo e qualquer marcador verdadeiro/falso (ex.: `anvisaAfeActive`, `ispProvider`, `cvmListed`) |
| **Só as novas desde a última execução** | Guarda a empresa mais recente entregue para os mesmos filtros. Agende o Actor toda semana e pague só pelas empresas que você ainda não recebeu |

Os resultados vêm das mais novas para as mais antigas.

![Busca por raio: 572 empresas de alimentação a até 1 km do MASP, por distância](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/radius-pt.png?v=4)

### 📦 O que vem no resultado

Uma linha por estabelecimento (matriz ou filial).

![Saída em JSON de uma empresa: cadastro, contatos e dados do governo](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/row-pt.png?v=4)

#### Cadastro

| Campo | Descrição |
|---|---|
| `cnpj` | 14 dígitos, ex.: `12345678000199` |
| `legalName`, `tradeName` | Razão social e nome fantasia |
| `openedOn`, `activeSince` | Data de abertura e data da situação ativa |
| `mainCnae`, `mainCnaeDescription`, `secondaryCnaes` | Códigos de atividade |
| `legalNature`, `companySize`, `shareCapital` | Perfil da empresa |
| `simplesNacional`, `mei` | Simples Nacional e MEI |
| `isHeadquarters` | Matriz ou filial |
| `partners` | Sócios (QSA): nome, qualificação, tipo e data de entrada. Sócios pessoa jurídica vêm com o CNPJ |

#### Localização

| Campo | Descrição |
|---|---|
| `street`, `number`, `complement`, `neighborhood`, `zipCode`, `city`, `uf`, `region` | Endereço |
| `cityIbgeCode`, `cityPopulation` | Código IBGE e população estimada da cidade |
| `latitude`, `longitude`, `geoPrecision` | Coordenadas do Cadastro de Endereços do IBGE de 2022 (CNEFE). `address` = rua e número encontrados, `zip` = centro do CEP. MEI e empresário individual recebem só o centro do CEP |

#### Contatos

| Campo | Descrição |
|---|---|
| `phone1`, `phone2` | Telefones padronizados. Celulares antigos de 8 dígitos ganham o 9 na frente |
| `phone1Raw`, `phone2Raw` | Os mesmos telefones exatamente como foram registrados, só os dígitos (DDD + número), ex.: `1130465800` |
| `phone1Type`, `phone2Type`, `whatsappLikely` | Celular ou fixo, pelo formato do número |
| `email`, `emailType` | `corporate` (domínio próprio), `personal` (Gmail, Hotmail…), `shared` (do contador, ou domínio usado por muitas empresas sem relação) ou `invalid` (erros como gmail.con, e-mails de preenchimento) |
| `websiteDomain` | Site provável, deduzido de um e-mail no domínio da própria empresa |
| `emailAcceptsMail` | Se o domínio do e-mail recebe mensagens (registro MX no DNS) |

### 🏛️ Dados do governo

Opcionais, cruzados por CNPJ com 20 bases oficiais abertas. O campo fica vazio quando a empresa não aparece naquela fonte.

| Tema | Campos | Fonte |
|---|---|---|
| Dívida ativa da União | `federalDebt` (verdadeiro só com dívida em cobrança), `federalDebtInCollection`, `federalDebtNegotiated`, `federalDebtSuspended`, `federalDebtTotal`, `federalDebtTax`, `federalDebtSocialSecurity`, `federalDebtFgts`, `federalDebtJudicial`, `federalDebtInscriptions` | PGFN, trimestral |
| Parcelamentos | `installment`, `installmentCount`, `installmentBalance`, `installmentPrograms`, `installmentLastDate` | Receita Federal, mensal |
| Regime tributário | `taxRegime`, `taxRegimeYear` | ECF, anual |
| Benefícios fiscais | `taxBenefits`, `taxBenefitCount`, `taxBenefitEmpresaCidada`, `taxBenefitPerse`, `taxBenefitSudamSudene`, `taxBenefitRetIncorporacao`, `taxBenefitReidi` | SISEN (Receita) |
| Valores de benefícios declarados | `dirbiYear`, `dirbiTotalLastYear`, `dirbiByTax`, `dirbiTotalYtd`, `dirbiLastPeriod` | DIRBI (Receita), semestral |
| Punições | `sanctioned`, `sanctions` (CEIS/CNEP), `tcuIneligible`, `tcuIneligibleUntil`, `leniencyAgreement`, `leniencyAgreements`, `cepimImpeded`, `cepimReasons` | CGU, TCU, diária |
| Contratos públicos | `govContracts`, `govContractsValue`, `govLastContract` | PNCP, desde 2023 |
| Obras | `constructionWorks`, `constructionActiveWorks`, `constructionAreaM2`, `constructionLastStart`, `constructionBuilder`, `constructionDeveloper` | CNO (Receita) |
| Marcas e patentes | `trademarksActive`, `trademarksPending`, `trademarkNames`, `trademarkNextExpiry`, `trademarkLastFiling`, `patentApplications` | INPI, semanal |
| Saúde | `healthUnits`, `healthUnitTypes`, `healthHospital`, `healthSus`, `healthBeds`, `healthIcuBeds` | CNES |
| Agências de saúde | `anvisaAfeActive`, `anvisaProductTypes`, `anvisaActivities`, `anvisaGmpValid`, `anvisaGdpValid`, `ansOperator`, `ansModality` | ANVISA, ANS |
| Setor financeiro | `bcbInstitution`, `bcbGroup`, `bcbSegment`, `cvmListed`, `cvmCategory`, `cvmIssuerStatus` (ex.: em recuperação judicial), `cvmSector` | Banco Central, CVM |
| Postos de combustível | `anpFuelStation`, `anpBrand`, `anpBrandSince` | ANP |
| Provedores de internet | `ispProvider`, `ispBroadbandSubscribers`, `ispMunicipalities`, `ispStates`, `ispTechnologies`, `ispFiberShare` | ANATEL, mensal |
| Escolas particulares | `school`, `schoolStudents`, `schoolTeachers`, `schoolLevels`, `schoolCategory` | Censo Escolar (INEP) |
| Frigoríficos e laticínios | `sifRegistered`, `sifNumbers`, `sifAreas`, `sifCategories` | SIF (Ministério da Agricultura) |

Qualquer campo verdadeiro/falso funciona em **Require markers**, por exemplo `anvisaAfeActive` para farmacêuticas e cosméticos licenciados, `ispProvider` para provedores de internet ou `cvmListed` para empresas listadas.

### ✅ Qualidade dos dados

![Contatos das empresas novas: telefone, WhatsApp e tipo de e-mail](https://api.apify.com/v2/key-value-stores/646yr2ue8WMdV1lvi/records/contacts-pt.png?v=4)

Nada é inventado, mas nem tudo é cópia direta de um arquivo do governo. Cada campo está em um de três níveis:

| Nível | O que significa | Campos |
|---|---|---|
| 🟢 **Oficial, como publicado** | Copiado da fonte, só formatado | `cnpj`, `tradeName`, `legalNature`, `mei`, `simplesNacional`, `shareCapital`, `companySize`, `openedOn`, `activeSince`, `mainCnae`, `secondaryCnaes`, campos de endereço, `phone1Raw`, `phone2Raw`, `email` (como declarado), `partners`, `taxRegime`, detalhes das punições, cadastros da CVM, Banco Central, ANS, ANP, ANVISA e SIF |
| 🟡 **Oficial, calculado por nós** | Derivado de dados oficiais com uma regra documentada | `federalDebt` (verdadeiro só com dívida em cobrança) e totais de dívida, totais de parcelamento, totais anuais da DIRBI, benefícios fiscais vigentes, contagem de marcas (os mais de 100 status do INPI agrupados em ativa/pendente), contagem e área de obras (áreas acima de 5 milhões de m² ignoradas como erro), leitos, alunos, assinantes de banda larga, `region`, `cityIbgeCode`, `cityPopulation`, `legalName` de MEI e empresário individual (sem o CPF) |
| 🔵 **Inferência nossa, pode errar** | Uma estimativa, identificada como tal | `phone1Type`, `phone2Type`, `whatsappLikely`, `emailType`, `websiteDomain`, `emailAcceptsMail` (consulta real ao DNS, mas não confirma que a caixa de e-mail existe), `latitude`/`longitude`/`distanceKm`, `govContracts` (o PNCP cobre a partir de 2023) |

Vale lembrar:

- **Oficial não quer dizer atual.** Endereço, CNAE, telefone e e-mail são declarados pela empresa e muitas vezes estão desatualizados, e o contato costuma ser o do contador. Cada fonte tem seu ciclo: a Receita é mensal, a PGFN trimestral, o regime tributário da ECF anual (empresas do Simples Nacional não entregam a ECF, então o campo vazio não quer dizer nada).
- **Marcadores negativos são fatos com data, não julgamentos.** Punição, dívida ou impedimento significam que a empresa aparece naquela lista oficial, como foi publicada.
- Se você precisa de contatos verificados, use esta lista como base e valide e-mails e telefones com um serviço próprio antes de uma campanha.

### 🔒 Privacidade

- Sócios vêm só com nome e qualificação. Sem CPF, nem os dígitos mascarados, e sem faixa etária.
- No MEI e no empresário individual a empresa *é* uma pessoa, então o CPF sai da razão social e o número e o complemento do endereço não aparecem, porque geralmente é a casa do dono.
- Naturezas jurídicas de pessoa física (produtor rural, leiloeiro…) e empresas inativas não entram.
- Qualquer pessoa pode pedir a remoção. A remoção vale para todas as execuções seguintes.

### 💰 Preço

Você paga só pelo que recebe, por empresa entregue. Sem mensalidade.

| O quê | Preço |
|---|---|
| Empresa (cadastro, sócios, contatos, localização, IBGE) | **US$ 1,50 por mil** |
| Dados do governo, opcional | **+US$ 1,00 por mil** |
| Início da execução | US$ 0,00005 por execução |

- Os dados do governo vêm desligados. Ligue **Include government data** ou use qualquer filtro do governo, e eles entram e são cobrados automaticamente.
- CNPJ não encontrado no modo de consulta não é cobrado.
- A execução para no custo máximo que você definir e nunca cobra por empresa que não entregou.

### 🔄 Fonte e atualização

A Receita Federal publica a base completa do CNPJ como dado aberto uma vez por mês. Este Actor lê uma cópia limpa e indexada da versão mais recente, atualizada poucos dias depois de cada publicação. As bases do governo seguem seus próprios ciclos (veja a tabela acima).

### ❓ Perguntas frequentes

**Posso usar esses dados?**
São dados abertos publicados pelo governo. Use de acordo com a LGPD, principalmente em ações de marketing para empresário individual e MEI.

**Vem empresa inativa?**
Não. Só empresas com situação cadastral ativa.

**Dá para receber só as empresas novas toda semana?**
Sim. Use **Opened in the last N days**, ligue **Only new since my last run** e agende o Actor.

**E se um CNPJ da minha lista não existir?**
Ele é ignorado e não é cobrado.

# Actor input Schema

## `mode` (type: `string`):

Search companies with filters, or look up a list of CNPJs.

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

Leave empty for the whole country.

## `cities` (type: `array`):

City names, with or without accents (e.g. São Paulo, Campinas). Combine with the state to avoid homonyms.

## `nearLatitude` (type: `string`):

Optional radius search. Center latitude, e.g. -23.5614 (Av. Paulista). Use with longitude and radius.

## `nearLongitude` (type: `string`):

Center longitude, e.g. -46.6559.

## `radiusKm` (type: `integer`):

Companies within this distance of the point. Results include distanceKm.

## `cnaes` (type: `array`):

Full codes (6201-5/01) or prefixes: '62' matches every IT services activity, '4711' every supermarket subclass.

## `cnaeScope` (type: `string`):

Match the CNAE codes in the main activity only, or in the main and secondary activities.

## `openedWithinDays` (type: `integer`):

Counted back from the newest opening date in the current dataset. Overrides the date range below.

## `openedFrom` (type: `string`):

YYYY-MM-DD

## `openedTo` (type: `string`):

YYYY-MM-DD

## `companySizes` (type: `array`):

As declared to Receita Federal. Leave empty for all.

## `simplesNacional` (type: `string`):

Filter by Simples Nacional tax option.

## `mei` (type: `string`):

MEI records come without the owner's CPF and without street number or complement, since the address is usually the owner's home.

## `legalNatures` (type: `array`):

Optional. E.g. 2062 (LTDA), 2135 (Empresário Individual), 2054 (S/A fechada). Leave empty for all.

## `regions` (type: `array`):

Brazilian macro-regions. Leave empty for all.

## `minCityPopulation` (type: `integer`):

IBGE population estimate of the company's city.

## `emailTypes` (type: `array`):

Corporate = company's own domain. Personal = Gmail, Hotmail etc. Shared = a domain used by many companies, usually the accountant.

## `requireWebsite` (type: `boolean`):

The company uses an email on its own domain (e.g. contato@padaria.com.br), which usually is its website.

## `requireMobile` (type: `boolean`):

Only companies with at least one mobile phone number.

## `includeGovernmentData` (type: `boolean`):

Adds federal debt, installment plans, tax regime and benefits, sanctions, public contracts, construction works, trademarks and health, financial and sector registrations. Using any government filter below turns this on automatically.

## `federalDebt` (type: `string`):

Dívida ativa da União, updated quarterly.

## `sanctioned` (type: `string`):

Companies currently barred or fined by public administration.

## `taxRegimes` (type: `array`):

Latest regime declared in the ECF. Companies in Simples Nacional do not file an ECF.

## `govSupplier` (type: `string`):

Has signed at least one public contract published on PNCP since 2023.

## `requireFlags` (type: `array`):

Only companies where all these markers are true, e.g. anvisaAfeActive, ispProvider, cvmListed, sifRegistered, school. See the README for the full list.

## `headquartersOnly` (type: `boolean`):

Skip branch establishments (filiais).

## `requireEmail` (type: `boolean`):

Only companies with a valid email whose domain accepts mail.

## `requirePhone` (type: `boolean`):

Only companies with at least one phone number.

## `nameContains` (type: `string`):

Text to find in the legal or trade name.

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

Remembers the newest company delivered for these exact filters and returns only companies opened after it. Great for a weekly or monthly scheduled feed.

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

You are charged per company returned. Newest companies come first.

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

Used in 'Look up CNPJs' mode. With or without punctuation. CNPJs not found (inactive, MEI, sole proprietor or nonexistent) are not charged.

## Actor input object example

```json
{
  "mode": "search",
  "states": [
    "SP"
  ],
  "cnaes": [
    "6201-5/01"
  ],
  "cnaeScope": "main",
  "simplesNacional": "any",
  "mei": "any",
  "requireWebsite": false,
  "requireMobile": false,
  "includeGovernmentData": false,
  "federalDebt": "any",
  "sanctioned": "any",
  "govSupplier": "any",
  "headquartersOnly": false,
  "requireEmail": false,
  "requirePhone": false,
  "onlyNew": false,
  "maxResults": 1000
}
```

# Actor output Schema

## `results` (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 = {
    "states": [
        "SP"
    ],
    "cnaes": [
        "6201-5/01"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leafcliff/brazil-companies-cnpj").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 = {
    "states": ["SP"],
    "cnaes": ["6201-5/01"],
}

# Run the Actor and wait for it to finish
run = client.actor("leafcliff/brazil-companies-cnpj").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 '{
  "states": [
    "SP"
  ],
  "cnaes": [
    "6201-5/01"
  ]
}' |
apify call leafcliff/brazil-companies-cnpj --silent --output-dataset

```

## MCP server setup

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

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/Bfa39XT7bJzMx191y/builds/wqxIrd3rbVIQLrwIu/openapi.json
