# Brazil CNPJ Leads & Lookup: Companies by CNAE, City, Email (`singgendarhan/brazil-cnpj-company-leads`) Actor

Build B2B lead lists of Brazilian companies by CNAE, state, municipality and legal form, or bulk-enrich CNPJs. Active companies only, MEIs left out, with registered email, phones, partners (QSA), address and Simples status. $2 per 1,000 companies.

- **URL**: https://apify.com/singgendarhan/brazil-cnpj-company-leads.md
- **Developed by:** [Starry Night](https://apify.com/singgendarhan) (community)
- **Categories:** Lead generation, Business, 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 $2.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

## Brazil CNPJ Leads & Lookup: companies by CNAE, city and state, with email

**Brazil CNPJ Leads & Lookup** builds B2B lead lists of Brazilian companies from Receita Federal's CNPJ open data. Pick a CNAE (activity), state, municipality and legal form, and get active companies with their **registered email and phones**, partners (QSA), address, size, share capital and Simples/MEI status. Lookup mode enriches a list of CNPJs you already have.

- **Real lead lists, not raw registry dumps.** Active companies only by default, MEIs and sole traders left out, and closed (BAIXADA, INAPTA) companies dropped before you pay for them.
- **Email and phone on every row where Receita has one.** Each company is enriched with one lookup at OpenCNPJ, which publishes the email that the free Minha Receita search leaves out. "Only with email" and "Only with phone" drop the rest for free.
- **Weekly or monthly schedules.** "Only new since last run" remembers which companies you already got and continues the scan where the last run stopped.
- **Simple pricing.** $2.00 per 1,000 companies saved. No start fee. Closed, filtered-out, not-found and failed CNPJs cost nothing.

### What you get

One row per CNPJ establishment (head office or branch):

| Field | What it is |
|---|---|
| `cnpj`, `cnpjFormatted`, `cnpjBase` | CNPJ (14 characters), as XX.XXX.XXX/XXXX-XX, and the 8-character base shared by head office and branches |
| `razaoSocial`, `nomeFantasia` | Legal name and trade name |
| `matrizFilial` | MATRIZ (head office) or FILIAL (branch) |
| `situacaoCadastral`, `dataSituacaoCadastral`, `motivoSituacao` | Registration status (ATIVA, BAIXADA, INAPTA, SUSPENSA, NULA), its date and reason |
| `dataInicioAtividade` | Opening date |
| `naturezaJuridica` | Legal form `{codigo, descricao}`, e.g. 2062 Sociedade Empresária Limitada |
| `porte`, `capitalSocial` | Size class (ME, EPP, DEMAIS) and share capital in BRL |
| `opcaoSimples`, `dataOpcaoSimples`, `dataExclusaoSimples`, `opcaoMei`, `isMei` | Simples Nacional and MEI status |
| `cnaePrincipal`, `cnaesSecundarios` | Primary and secondary CNAEs with descriptions |
| `endereco` | `{tipoLogradouro, logradouro, numero, complemento, bairro, cep, municipio, codigoMunicipioIbge, codigoMunicipioSiafi, uf}` |
| `email` | Email registered with Receita Federal |
| `telefonePrincipal`, `telefones` | Registered phones, formatted and in E.164 (`+5519...`) |
| `qsa` | Partners and officers: name, type, role, entry date, age band, masked CPF (as published) |
| `sanctions`, `federalContracts` | Optional: CEIS, CNEP and CEPIM federal sanctions and a federal-contracts summary |
| `isNewSinceLastRun`, `contactsWithheld`, `lgpdAnonimizado` | Run and privacy flags (see the FAQ) |
| `source`, `sourceUrls`, `retrievedAt` | Provenance: registry, which service each part came from, Receita snapshot month, links |

Each run also writes a summary (`OUTPUT` in the key-value store): rows scanned, companies saved, how many were left out and why, CNPJs not found or invalid, and the source snapshot.

### How to use it

**1. Lead list: restaurants in Campinas with email.**

```json
{
  "mode": "search",
  "municipios": ["Campinas/SP"],
  "cnaes": ["5611201"],
  "onlyWithEmail": true,
  "maxResults": 500
}
```

**2. Several cities and activities, any CNAE position, LTDA only.** Secondary CNAEs catch companies that list the activity second.

```json
{
  "mode": "search",
  "municipios": ["São Paulo/SP", "Campinas/SP", "3304557"],
  "cnaes": ["6201-5/01", "6202-3/00"],
  "includeSecondaryCnae": true,
  "naturezasJuridicas": ["2062"],
  "onlyWithPhone": true,
  "maxResults": 2000,
  "maxScanPages": 50
}
```

**3. Weekly schedule: only companies you have not received yet.** Schedule this in Apify (Schedules) and connect the dataset to your CRM, Google Sheets, Make, Zapier or n8n.

```json
{
  "mode": "search",
  "ufs": ["SC"],
  "cnaes": ["4120400"],
  "onlyWithEmail": true,
  "onlyNewSinceLastRun": true,
  "maxResults": 300
}
```

**4. Bulk lookup / enrichment of your own CNPJ list.** Punctuation is optional, leading zeros lost in spreadsheets are restored, and the new alphanumeric CNPJs are accepted. In lookup mode every status is returned unless you set `status`.

```json
{
  "mode": "lookup",
  "cnpjs": ["33.000.167/0001-01", "00093791000141"],
  "includeSanctionsAndContracts": true
}
```

Municipalities can be written as a name with its state (`Campinas/SP`, `Belo Horizonte - MG`), a unique name alone, a 7-digit IBGE code (`3509502`) or a Receita/SIAFI code (`6291`). A name that exists in several states (for example "Bom Jesus") needs its state.

### Output example

A real lookup row (run on 2026-11-08; partner and secondary-CNAE lists shortened):

```json
{
  "cnpj": "33000167000101",
  "cnpjFormatted": "33.000.167/0001-01",
  "cnpjBase": "33000167",
  "razaoSocial": "PETROLEO BRASILEIRO S A PETROBRAS",
  "nomeFantasia": "PETROBRAS - EDISE",
  "matrizFilial": "MATRIZ",
  "situacaoCadastral": "ATIVA",
  "dataSituacaoCadastral": "2005-11-03",
  "motivoSituacao": "SEM MOTIVO",
  "situacaoEspecial": null,
  "dataInicioAtividade": "1966-09-28",
  "naturezaJuridica": { "codigo": "2038", "descricao": "Sociedade de Economia Mista" },
  "porte": "DEMAIS",
  "porteDescricao": "Demais",
  "capitalSocial": 205431960490.52,
  "opcaoSimples": null,
  "dataOpcaoSimples": null,
  "dataExclusaoSimples": null,
  "opcaoMei": null,
  "isMei": false,
  "cnaePrincipal": { "codigo": "0600001", "codigoFormatado": "0600-0/01", "descricao": "Extração de petróleo e gás natural" },
  "cnaesSecundarios": [
    { "codigo": "1921700", "codigoFormatado": "1921-7/00", "descricao": "Fabricação de produtos do refino de petróleo" }
  ],
  "endereco": {
    "tipoLogradouro": "AVENIDA",
    "logradouro": "REPUBLICA DO CHILE",
    "numero": "65",
    "complemento": null,
    "bairro": "CENTRO",
    "cep": "20031170",
    "municipio": "RIO DE JANEIRO",
    "codigoMunicipioIbge": "3304557",
    "codigoMunicipioSiafi": "6001",
    "uf": "RJ"
  },
  "email": "cc-rfisc@petrobras.com.br",
  "telefonePrincipal": "(21) 2166-0000",
  "telefones": [
    { "ddd": "21", "numero": "21660000", "formatted": "(21) 2166-0000", "e164": "+552121660000", "isFax": false }
  ],
  "qsa": [
    {
      "nome": "WILLIAM FRANCA DA SILVA",
      "tipo": "Pessoa Física",
      "qualificacao": "Diretor",
      "dataEntradaSociedade": "2023-04-17",
      "faixaEtaria": "61 a 70 anos",
      "cpfCnpjMascarado": "***487787**",
      "paisSocio": null,
      "nomeRepresentanteLegal": null
    }
  ],
  "isNewSinceLastRun": null,
  "contactsWithheld": false,
  "lgpdAnonimizado": false,
  "source": {
    "registry": "Receita Federal CNPJ open data",
    "searchVia": null,
    "recordVia": "api.opencnpj.org",
    "contactsVia": "api.opencnpj.org",
    "receitaSnapshot": "2026-10",
    "sourceUpdatedAt": "2026-11-01T21:47:27.1957841Z"
  },
  "sourceUrls": [
    "https://api.opencnpj.org/33000167000101",
    "https://minhareceita.org/33000167000101"
  ],
  "retrievedAt": "2026-11-09T01:02:18.064Z"
}
```

In a test search on 2026-11-08 (active non-MEI restaurants, CNAE 5611-2/01, in Campinas, only with phone), 296 of the 300 companies saved had a registered email. The scan read 3,000 registry rows and took 82 seconds.

### Pricing

Pay per event, no subscription and no start fee:

| Event | Price | When |
|---|---|---|
| Company | **$0.002** ($2.00 per 1,000) | Each company saved to your dataset |
| Sanctions and contracts check | $0.002 | Only if you turn on "Add federal sanctions and contracts": once per company saved, whether or not anything is found |

Scanning is free. You are never charged for closed companies, MEIs and sole traders that are left out, companies without email when you ask for email only, CNPJs that are not found or invalid, or failed lookups. Set "Max companies" or a maximum cost per run to cap the bill.

### How it works and limits

- **Search** uses the paginated search of Minha Receita, which filters by state, municipality, CNAE (primary, or primary plus secondary) and legal form. Each page holds up to 1,000 registry rows, closed companies included, so a page yielded 150-400 active non-MEI companies in our tests (for example, about 170 of 1,000 for Campinas restaurants). Status, MEI, size, CEP, opening-date and head-office filters are applied to the scanned rows; raise "Max pages to scan" for big lists or rare filters. Runs of 50 companies or fewer read 500-row pages (each counts as half a page), and the Actor drops to smaller pages when the source is busy.
- **Enrichment** reads each remaining company once from OpenCNPJ (email, phones, Simples/MEI, partners). If OpenCNPJ is unavailable for a company, the row comes from Minha Receita without email (`source.contactsVia` is `null`), and it is dropped when you ask for email only.
- **Dates:** the source cannot sort by opening date, so "Opened on or after" is applied within the scanned pages.
- **Freshness:** Receita Federal publishes the CNPJ base about once a month; each row says which snapshot it comes from (`source.receitaSnapshot`, 2026-10 at launch). Brand-new companies appear after the next monthly release.
- **Speed and politeness:** one search request at a time and at most 2 parallel OpenCNPJ lookups (about 4 per second), with retries and backoff. Minha Receita's search is experimental and answers "too busy" (HTTP 429) when its shared server is loaded; the Actor waits about a minute, retries with smaller pages, and tells you clearly if the search could not run. **A run can take a few minutes when the source is busy**, even for a few companies. Expect about 4-5 minutes per 1,000 companies when it is not busy (300 companies took 82 seconds in a test).
- **Only new since last run** keeps its memory in a key-value store named `brazil-cnpj-leads-memory` in your own Apify account, one record per filter set (use "Memory name" to keep two schedules apart). It remembers up to 300,000 companies per filter set. Do not let two runs with the same filters and memory name overlap: each reads the memory when it starts and saves it when it ends, so overlapping runs can return the same companies.

### Data source and terms

- **Receita Federal do Brasil, CNPJ open data** (Cadastro Nacional da Pessoa Jurídica), published as open data under Brazil's Access to Information Law. This Actor is **unofficial** and is not affiliated with or endorsed by Receita Federal.
- **[Minha Receita](https://docs.minhareceita.org/)** (search and fallback lookups), a free open-source API over the same data, "sem cadastro, sem chave, sem cobrança". Consider supporting the project.
- **[OpenCNPJ](https://opencnpj.org/)** (email, phones, Simples/MEI and the optional sanctions and contracts datasets from Portal da Transparência), a free API whose FAQ says use is free "inclusive para fins comerciais". OpenCNPJ describes its API as meant for point lookups by CNPJ and recommends its BigQuery dataset or NDJSON downloads for bulk enrichment and large-scale analysis. So this Actor calls the API only for companies that already passed the free filters, at a modest pace (at most 2 parallel requests, about 4 per second) with backoff on HTTP 429. For millions of rows, OpenCNPJ's bulk downloads are the better tool.
- Municipality names and IBGE/SIAFI codes come from [municipios-brasileiros](https://github.com/kelvins/municipios-brasileiros) (MIT licence), bundled with the Actor.
- The Actor does not use BrasilAPI (its robots.txt disallows its API paths) and does not log in anywhere.

### FAQ

**Is this legal?** It reads public registry data that Receita Federal publishes as open data, through two free public APIs, without logging in or bypassing anything: Minha Receita states it has no usage limits, and OpenCNPJ states that use is free, including commercial use. You are responsible for how you use the contacts: B2B prospecting in Brazil must follow the LGPD (for example, legitimate interest, a clear opt-out and respect for objections) and anti-spam rules.

**Why are MEIs and sole traders left out by default?** An MEI or Empresário Individual is one person, so its email and phone are personal contacts. They are left out by default. If you turn "Leave out MEIs and sole traders" off, these companies are included but their email and phones are withheld (`contactsWithheld: true`).

**Whose email is it?** The address the company gave Receita Federal when registering or updating its CNPJ. For many small companies it is the accountant's address. The Actor does not guess or verify emails.

**Why do some rows have no email or phone?** Receita has none for that company, the phone is a placeholder (such as 1111-1111, which is dropped), or OpenCNPJ was unavailable for it. Turn on "Only with email" or "Only with phone" to receive, and pay for, only rows that have them.

**What does `lgpdAnonimizado` mean?** OpenCNPJ anonymizes personal fields when the data subject asks under the LGPD. Such rows keep that flag, and the Actor does not fill those fields from elsewhere.

**How fresh is the data?** Monthly, following Receita's release cycle. See `source.receitaSnapshot` and `source.sourceUpdatedAt` on each row.

**Can I get every company in a state?** A state-only search is very broad and Minha Receita may refuse it as too costly. Add a CNAE or municipality, or split the job by municipality.

**Can I use it from code or AI agents?** Yes: the Apify API, the Apify MCP server (AI agents read the input descriptions), and integrations such as Make, Zapier, n8n and Google Sheets. Export as JSON, CSV or Excel.

**Something is wrong or missing.** Open an issue on the Issues tab with the run link; we answer there.

### Em português

**Leads de empresas brasileiras por CNAE, município e UF, com email e telefone**, a partir dos dados abertos do CNPJ da Receita Federal. Modo busca: listas de empresas ativas (sem MEI e sem empresário individual, por padrão) filtradas por CNAE principal ou secundário, UF, município (nome, código IBGE ou SIAFI), natureza jurídica, porte, CEP e data de abertura, com email e telefones cadastrados, QSA, endereço, capital social e Simples/MEI. Modo consulta: enriquecimento em lote de uma lista de CNPJs (inclusive o CNPJ alfanumérico). Opção "apenas novas desde a última execução" para agendamentos semanais ou mensais. US$ 2,00 por 1.000 empresas, sem taxa de início; empresas baixadas, filtradas ou não encontradas não são cobradas. Ferramenta não oficial; fontes: Receita Federal, Minha Receita e OpenCNPJ.

# Changelog

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

# Actor input Schema

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

search = find companies by the filters below (lead lists). lookup = return the companies whose CNPJs you list in "CNPJs to look up".

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

7-digit CNAE subclasses, with or without punctuation, e.g. 5611201 (restaurants) or 6201-5/01 (custom software). Up to 50. By default only the company's primary (fiscal) CNAE is matched; turn on "Also match secondary CNAEs" to match any of its activities.

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

Off = the CNAE must be the company's primary activity. On = primary or any secondary activity (more companies, broader list).

## `ufs` (type: `array`):

Two-letter state codes, e.g. SP, RJ, MG. Ignored for the search itself when municipalities are given (a municipality already fixes its state). A state with no CNAE or municipality is a very broad search that the free source may refuse as too costly.

## `municipios` (type: `array`):

Municipality names or codes, one per line: a name with its state ("Campinas/SP", "Belo Horizonte - MG"), a name alone when it is unique in Brazil or in the chosen states, a 7-digit IBGE code (3509502) or a Receita/SIAFI code (6291). Up to 100.

## `naturezasJuridicas` (type: `array`):

4-digit legal-form codes, e.g. 2062 Sociedade Empresária Limitada (LTDA, incl. SLU), 2054 S.A. fechada, 2046 S.A. aberta, 2240 Sociedade Simples Limitada, 2232 Sociedade Simples Pura, 2143 Cooperativa, 3999 Associação Privada, 2135 Empresário Individual (needs excludeMei off). Leave empty for all legal forms.

## `portes` (type: `array`):

Only these Receita size classes. ME = microempresa, EPP = empresa de pequeno porte, DEMAIS = all larger companies. Leave empty for all sizes.

## `cepPrefixes` (type: `array`):

Only addresses whose CEP (postal code) starts with these digits, e.g. 13015 or 130. Applied to the scanned rows.

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

Only companies whose activity start date (data de início de atividade) is on or after this date, YYYY-MM-DD. The source cannot sort by date, so this is applied to the scanned pages: for rare dates raise "Max pages to scan".

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

Only companies opened on or before this date, YYYY-MM-DD.

## `openedWithinLastDays` (type: `integer`):

Only companies opened in the last N days, counted back from the run date. Overrides "Opened on or after". Receita publishes monthly, so the newest companies are those of the latest snapshot.

## `status` (type: `string`):

auto = active (ATIVA) companies only in search mode, every status in lookup mode. active = ATIVA only. any = every status (ATIVA, BAIXADA, INAPTA, SUSPENSA, NULA). inactive = everything except ATIVA.

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

On (default) = leave out MEIs and every Empresário Individual (legal form 2135): they are one person's business and their contacts are personal. Off = include them; their email and phones are still withheld (contactsWithheld = true).

## `onlyHeadOffice` (type: `boolean`):

Only the head office (matriz) of each company, no branches (filiais).

## `onlyWithEmail` (type: `boolean`):

Only companies that registered an email with Receita Federal. Companies left out this way are not charged.

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

Only companies with at least one registered phone (placeholder numbers such as 1111-1111 do not count).

## `onlyNewSinceLastRun` (type: `boolean`):

For weekly or monthly schedules: skip companies that an earlier run with the same filters already returned. The memory lives in your own key-value store "brazil-cnpj-leads-memory" (one record per filter set), and the scan continues where the last run stopped.

## `memoryKey` (type: `string`):

Only with "Only new since last run": a name that keeps separate memories for two schedules that use the same filters, e.g. "client-a". Do not run two runs with the same filters and memory name at the same time: each reads the memory at its start and saves it at its end, so overlapping runs can return the same companies.

## `includeSanctionsAndContracts` (type: `boolean`):

Adds CEIS, CNEP and CEPIM sanctions and a summary of federal contracts (Portal da Transparência, via OpenCNPJ) to each company. Charged as one extra event per company saved, whether or not anything is found.

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

Lookup mode only: CNPJs with or without punctuation (33.000.167/0001-01 or 33000167000101), one per line, up to 10,000. Leading zeros dropped by spreadsheets are restored, and the new alphanumeric CNPJs are accepted. Invalid CNPJs are listed in the run summary and not charged.

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

Stop after saving this many companies. You pay only for companies saved. Default: 100 in search mode, all listed CNPJs in lookup mode.

## `maxScanPages` (type: `integer`):

Search mode: the scan budget in pages of 1,000 registry rows, so the Actor reads at most this many x 1,000 rows (closed companies included; small runs and busy periods use 500- or 250-row pages, each counted as a half or a quarter page; typically 15-50% of rows are active non-MEI companies). Raise it for big lists or rare filters. Scanning is free; only saved companies are charged.

## Actor input object example

```json
{
  "mode": "search",
  "cnaes": [
    "5611201"
  ],
  "includeSecondaryCnae": false,
  "ufs": [
    "SP"
  ],
  "municipios": [
    "Campinas/SP"
  ],
  "status": "auto",
  "excludeMei": true,
  "onlyHeadOffice": false,
  "onlyWithEmail": true,
  "onlyWithPhone": false,
  "onlyNewSinceLastRun": false,
  "includeSanctionsAndContracts": false,
  "maxResults": 25,
  "maxScanPages": 3
}
```

# Actor output Schema

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

One item per company (CNPJ establishment): status, legal form, CNAEs, address, registered email and phones, partners and source links.

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

Rows scanned, companies saved, why others were left out, CNPJs not found or invalid, and the source snapshot.

# 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 = {
    "mode": "search",
    "cnaes": [
        "5611201"
    ],
    "ufs": [
        "SP"
    ],
    "municipios": [
        "Campinas/SP"
    ],
    "onlyWithEmail": true,
    "maxResults": 25,
    "maxScanPages": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("singgendarhan/brazil-cnpj-company-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 = {
    "mode": "search",
    "cnaes": ["5611201"],
    "ufs": ["SP"],
    "municipios": ["Campinas/SP"],
    "onlyWithEmail": True,
    "maxResults": 25,
    "maxScanPages": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("singgendarhan/brazil-cnpj-company-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 '{
  "mode": "search",
  "cnaes": [
    "5611201"
  ],
  "ufs": [
    "SP"
  ],
  "municipios": [
    "Campinas/SP"
  ],
  "onlyWithEmail": true,
  "maxResults": 25,
  "maxScanPages": 3
}' |
apify call singgendarhan/brazil-cnpj-company-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,singgendarhan/brazil-cnpj-company-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/E7DOFFriLLB3IXjbl/builds/EcpRBSadU7sKXjVpP/openapi.json
