# Brazil CNPJ Lookup & Company Registry Scraper (`parsebird/brazil-cnpj-scraper`) Actor

Look up any Brazilian CNPJ or search the Receita Federal company registry by state, CNAE, city, legal form, or partner CPF. Get status, address, phones, CNAEs, capital, Simples/MEI, tax regime, and partners (QSA). Export JSON, CSV, Excel.

- **URL**: https://apify.com/parsebird/brazil-cnpj-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 2 total users, 1 monthly users, 75.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.79 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Brazil CNPJ Lookup & Company Registry Scraper

Brazil CNPJ Lookup & Company Registry Scraper gets official **Receita Federal** company data for any Brazilian **CNPJ**, or searches the whole Brazilian company registry by state, CNAE activity code, municipality, legal form, or partner CPF.

<table><tr>
<td style="border-left:4px solid #009C3B;padding:12px 16px;font-weight:600">
Look up thousands of CNPJs in one run, or build B2B lead lists of Brazilian companies filtered by UF, CNAE, city, legal form, partner, status, and head office, with 45+ fields per company including address, phones, capital, Simples/MEI, tax regime, and the full partner list (QSA).
</td>
</tr></table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```text
Use Apify Actor parsebird/brazil-cnpj-scraper to get Brazilian company registry (Receita Federal CNPJ) data. Example with ApifyClient (Python): client.actor("parsebird/brazil-cnpj-scraper").call(run_input={"uf":"SP","cnae":"6209100","activeOnly":True,"maxItems":500}). Two modes. Lookup mode: cnpjs array of strings and/or cnpj string (14 digits; dots, slashes, dashes ignored; missing leading zeros added; check digits validated; search filters ignored). Search mode (needs at least one filter; each accepts comma-separated values): uf string (two-letter state codes, e.g. "SP, RJ"), cnae string (7-digit CNAE, matches primary and secondary activities), primaryCnaeOnly boolean default false, municipio string (IBGE 7-digit or SIAFI 4-digit code), naturezaJuridica string (4-digit legal-form code, e.g. 2135 Empresário Individual), partnerCpf string (full CPF, masked ***456789**, or a partner company CNPJ). Both modes: activeOnly boolean default false (status ATIVA only), headOfficeOnly boolean default false (MATRIZ only), maxItems integer default 100, pageSize integer default 500 (1-1024). Output: one row per company: cnpj, cnpj_formatado, cnpj_basico, razao_social, nome_fantasia, matriz_filial, situacao_cadastral, situacao_cadastral_motivo, data_situacao_cadastral, situacao_especial, data_situacao_especial, data_abertura, cnae_principal_codigo, cnae_principal_descricao, cnaes_secundarios [string "CODE — Description"], natureza_juridica_codigo, natureza_juridica, porte, capital_social (number, BRL), logradouro, numero, complemento, bairro, municipio, municipio_codigo_ibge, uf, cep, pais, cidade_exterior, telefone1, telefone2, fax, simples_nacional (bool or null), data_opcao_simples, data_exclusao_simples, mei (bool or null), data_opcao_mei, data_exclusao_mei, regime_tributario [string "LUCRO REAL (2021)"], ente_federativo, orgao_publico (bool), qsa [string "NAME — ROLE — id: ***123456** — entry: YYYY-MM-DD"], qsa_count, socios [{nome, cpf_cnpj, tipo, qualificacao, data_entrada, faixa_etaria, pais, representante_legal_nome, representante_legal_cpf, representante_legal_qualificacao}], ultima_atualizacao (Receita data release, YYYY-MM), source_url. API docs: https://docs.apify.com/api/client/python/ and https://docs.apify.com/api/client/js/. Token: https://console.apify.com/account/integrations.
```

### What is Brazil CNPJ Lookup & Company Registry Scraper?

**Brazil CNPJ Lookup & Company Registry Scraper** is a **CNPJ lookup tool** and **Brazil company data scraper** built on the open CNPJ data that [Receita Federal](https://www.gov.br/receitafederal/pt-br) publishes every month. Every Brazilian company and branch has a **CNPJ** (Cadastro Nacional da Pessoa Jurídica), and this actor returns its registry record: **legal name (razão social)**, **trade name**, **registration status**, **opening date**, **CNAE activity codes**, **legal form**, **size**, **share capital**, **address**, **phones**, **Simples Nacional and MEI status**, **tax regime history**, and the **partner list (QSA)**.

Use it as a **CNPJ API** alternative: you don't need to solve the Receita Federal CAPTCHA or download and join the monthly CSV dumps yourself. The data comes from [Minha Receita](https://minhareceita.org), an open-source project that serves the Receita Federal files through a public API.

The easiest way to try it is to open the actor, keep the prefilled search (IT support companies in the Federal District), and click **Start**. The prefilled run saves 20 companies in a few seconds.

### What can Brazil CNPJ Lookup & Company Registry Scraper do?

- 🔎 **Look up CNPJs in bulk**: paste up to 10,000 CNPJs in any format (`00.000.000/0001-91`, `00000000000191`, or `191`). Check digits are validated and duplicates removed before any request.
- 🏢 **Search the Brazilian company registry** by **state (UF)**, **CNAE code**, **municipality** (IBGE or SIAFI code), **legal form** (natureza jurídica), and **partner CPF or CNPJ**. Combine filters, and give several values per filter (`SP, RJ, MG`).
- 👥 **Find every company a person or company owns a stake in**: enter a full CPF and the actor converts it to the masked format Receita uses, or enter a partner company's CNPJ.
- ✅ **Keep only active companies** and **only head offices** to build clean B2B lead lists without closed companies or duplicate branches.
- 📋 **Get partner data two ways**: `qsa` as readable strings, and `socios` as structured objects with role, entry date, age range, and legal representative.
- ⏱️ **Automate** with [Apify schedules](https://docs.apify.com/platform/schedules), the [Apify API](https://docs.apify.com/api/v2), webhooks, and [integrations](https://apify.com/integrations) such as Google Sheets, Make, Zapier, and Slack.
- 📁 **Export** results as JSON, CSV, Excel, HTML, or XML.

### What data can you extract from the Receita Federal CNPJ registry?

| Field | Description |
|-------|-------------|
| `cnpj`, `cnpj_formatado`, `cnpj_basico` | 14-digit CNPJ, the formatted version, and the 8-digit root shared by a company's head office and branches |
| `razao_social`, `nome_fantasia` | Legal name and trade name |
| `matriz_filial` | `MATRIZ` (head office) or `FILIAL` (branch) |
| `situacao_cadastral`, `situacao_cadastral_motivo`, `data_situacao_cadastral` | Status (`ATIVA`, `SUSPENSA`, `INAPTA`, `BAIXADA`, `NULA`), reason, and date |
| `data_abertura` | Date the company started operating |
| `cnae_principal_codigo`, `cnae_principal_descricao`, `cnaes_secundarios` | Primary and secondary CNAE activity codes with descriptions |
| `natureza_juridica_codigo`, `natureza_juridica` | Legal form code and description |
| `porte`, `capital_social` | Size class (`MICRO EMPRESA`, `EMPRESA DE PEQUENO PORTE`, `DEMAIS`) and declared share capital in BRL |
| `logradouro`, `numero`, `complemento`, `bairro`, `cep`, `municipio`, `municipio_codigo_ibge`, `uf` | Full registered address |
| `telefone1`, `telefone2`, `fax` | Phone and fax numbers with area code (DDD) |
| `simples_nacional`, `mei` and their dates | Simples Nacional and MEI opt-in and opt-out |
| `regime_tributario` | Tax regime by year, e.g. `LUCRO PRESUMIDO (2022)` |
| `orgao_publico`, `ente_federativo` | Public-administration flag and the responsible federative entity |
| `qsa`, `qsa_count`, `socios` | Partners and directors (quadro de sócios e administradores) |
| `ultima_atualizacao`, `source_url` | Receita Federal data release (`YYYY-MM`) and the record's API link |

### How to look up a CNPJ or search Brazilian companies

1. Open [Brazil CNPJ Lookup & Company Registry Scraper](https://apify.com/parsebird/brazil-cnpj-scraper) and click **Try for free** or **Start**.
2. To look up specific companies, paste CNPJs into **CNPJs to look up**, one per line.
3. To search the registry instead, leave the CNPJ fields empty and set at least one filter: **State (UF)**, **CNAE activity code**, **Municipality code**, **Legal form code**, or **Partner CPF or CNPJ**.
4. Optionally turn on **Active companies only** or **Head offices only**, and set **Max companies**.
5. Click **Start**, then open the **Output** tab or export the results as JSON, CSV, or Excel.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `cnpjs` | array of strings | No | — | CNPJs to look up, up to 10,000. Turns on lookup mode |
| `cnpj` | string | No | — | One CNPJ to look up |
| `uf` | string | No\* | — | State codes, comma-separated (`SP, RJ`); `EX` for companies registered abroad. Prefilled with `DF` |
| `cnae` | string | No\* | — | 7-digit CNAE codes, comma-separated. Prefilled with `6209100` |
| `primaryCnaeOnly` | boolean | No | `false` | Match `cnae` against the primary activity only |
| `municipio` | string | No\* | — | IBGE (7-digit) or SIAFI (4-digit) municipality codes |
| `naturezaJuridica` | string | No\* | — | 4-digit legal-form codes, e.g. `2135`, `2062` |
| `partnerCpf` | string | No\* | — | Partner CPF (full or masked `***456789**`) or partner company CNPJ |
| `activeOnly` | boolean | No | `false` | Save only companies with status `ATIVA` |
| `headOfficeOnly` | boolean | No | `false` | Save only head offices (`MATRIZ`) |
| `maxItems` | integer | No | `100` | Maximum companies to save. Prefilled with 20 |
| `pageSize` | integer | No | `500` | Records per API page (1 to 1,024) |

\* Search mode needs at least one of `uf`, `cnae`, `municipio`, `naturezaJuridica`, or `partnerCpf`. The actor stops right away with a clear message if none is set, so you don't pay for an empty run.

### Input / Output

**Example input: active IT support head offices in São Paulo and Rio de Janeiro**

```json
{
    "uf": "SP, RJ",
    "cnae": "6209100",
    "activeOnly": true,
    "headOfficeOnly": true,
    "maxItems": 1000
}
```

**Example input: CNPJ lookup**

```json
{
    "cnpjs": ["00.000.000/0001-91", "33.683.111/0002-80"]
}
```

**Example input: every Empresário Individual (the legal form MEIs use) in Brasília**

```json
{
    "municipio": "5300108",
    "naturezaJuridica": "2135",
    "maxItems": 1000
}
```

**Example output** (a real row; `qsa`, `socios`, and `cnaes_secundarios` shortened)

```json
{
  "cnpj": "33683111000280",
  "cnpj_formatado": "33.683.111/0002-80",
  "cnpj_basico": "33683111",
  "razao_social": "SERVICO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO)",
  "nome_fantasia": "REGIONAL BRASILIA-DF",
  "matriz_filial": "FILIAL",
  "situacao_cadastral": "ATIVA",
  "situacao_cadastral_motivo": "SEM MOTIVO",
  "data_situacao_cadastral": "2004-05-22",
  "situacao_especial": "",
  "data_situacao_especial": "",
  "data_abertura": "1967-06-30",
  "cnae_principal_codigo": "6204000",
  "cnae_principal_descricao": "Consultoria em tecnologia da informação",
  "cnaes_secundarios": [
    "6201501 — Desenvolvimento de programas de computador sob encomenda",
    "6202300 — Desenvolvimento e licenciamento de programas de computador customizáveis"
  ],
  "natureza_juridica_codigo": "2011",
  "natureza_juridica": "Empresa Pública",
  "porte": "DEMAIS",
  "capital_social": 1786196100,
  "logradouro": "AVENIDA L2 SGAN",
  "numero": "601",
  "complemento": "MODULO G",
  "bairro": "ASA NORTE",
  "municipio": "BRASILIA",
  "municipio_codigo_ibge": "5300108",
  "uf": "DF",
  "cep": "70836900",
  "pais": "",
  "cidade_exterior": "",
  "telefone1": "",
  "telefone2": "",
  "fax": "",
  "simples_nacional": null,
  "data_opcao_simples": "",
  "data_exclusao_simples": "",
  "mei": null,
  "data_opcao_mei": "",
  "data_exclusao_mei": "",
  "regime_tributario": [],
  "ente_federativo": "",
  "orgao_publico": false,
  "qsa": [
    "ALEXANDRE BRANDAO HENRIQUES MAIMONI — Diretor — id: ***641988** — entry: 2023-05-22",
    "ANDRE PICOLI AGATTE — Diretor — id: ***035378** — entry: 2025-03-13"
  ],
  "qsa_count": 7,
  "socios": [
    {
      "nome": "ALEXANDRE BRANDAO HENRIQUES MAIMONI",
      "cpf_cnpj": "***641988**",
      "tipo": "PESSOA FISICA",
      "qualificacao": "Diretor",
      "data_entrada": "2023-05-22",
      "faixa_etaria": "Entre 51 a 60 anos",
      "pais": "",
      "representante_legal_nome": "",
      "representante_legal_cpf": "",
      "representante_legal_qualificacao": ""
    }
  ],
  "ultima_atualizacao": "2026-09",
  "source_url": "https://minhareceita.org/33683111000280"
}
```

Download results from the **Output** tab in JSON, CSV, Excel, HTML, or XML. The Console also has **Address & contact** and **Partners (QSA)** table views.

### Python API example

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")

run = client.actor("parsebird/brazil-cnpj-scraper").call(
    run_input={
        "uf": "SP",
        "cnae": "6209100",
        "activeOnly": True,
        "headOfficeOnly": True,
        "maxItems": 500,
    }
)

for company in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(company["cnpj_formatado"], company["razao_social"], company["municipio"], company["telefone1"])
```

### JavaScript API example

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });

const run = await client.actor('parsebird/brazil-cnpj-scraper').call({
    cnpjs: ['00.000.000/0001-91', '33.683.111/0002-80'],
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const c of items) {
    console.log(c.cnpj_formatado, c.razao_social, c.situacao_cadastral, `${c.qsa_count} partners`);
}
```

See the [Python client docs](https://docs.apify.com/api/client/python/) and [JavaScript client docs](https://docs.apify.com/api/client/js/) for more options.

### Use cases

- **B2B lead generation in Brazil**: list active companies by CNAE and state, with address and phone, for sales prospecting.
- **KYC and supplier checks**: confirm a supplier's CNPJ is `ATIVA`, check its legal form, capital, and who the partners are.
- **CRM enrichment**: add legal name, CNAE, size, and address to the CNPJs already in your database.
- **Ownership research**: find every company where a person or holding company is a partner.
- **Market research**: count companies by activity, city, size, or Simples Nacional status.
- **Monitoring**: schedule weekly runs on your client or supplier CNPJs to catch status changes such as `INAPTA` or `BAIXADA`.

### How it works

1. In lookup mode, the actor cleans and validates each CNPJ, then fetches the registry record for each one.
2. In search mode, it sends your filters to the registry search and follows its pages until it reaches **Max companies** or there are no more matches.
3. Each record is flattened into one row: nested activity codes, tax regimes, and partners become readable strings, and partners are also kept as structured objects.
4. Rows are saved to the dataset as each page arrives, so you can stop a run at any time and keep what was collected.

### How much does it cost to look up a CNPJ?

**What is the price per Brazilian company record?**

The actor uses pay-per-event pricing: you pay per company saved, and platform usage is included.

| Event | Free plan | Bronze | Silver | Gold |
|-------|-----------|--------|--------|------|
| `company-scraped` | $0.00099 (**$0.99 / 1,000**) | $0.00089 (**$0.89 / 1,000**) | $0.00079 (**$0.79 / 1,000**) | $0.00079 (**$0.79 / 1,000**) |

One `company-scraped` event is one company row in the dataset. CNPJs that are invalid or not found, and companies skipped by **Active companies only** or **Head offices only**, are not charged. The prefilled 20-company run costs about $0.02 on the Free plan, and 10,000 companies cost $9.90. Apify's free plan includes monthly platform credits you can use to try the actor.

### Is it legal to scrape Brazilian CNPJ data?

**Is CNPJ data public?**

Yes. Receita Federal publishes the CNPJ registry as open data under Brazil's Access to Information Law (Lei de Acesso à Informação), and partner CPFs are already masked in the source. Partner names are still personal data protected by Brazil's [LGPD](https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2018/lei/l13709.htm), so have a legitimate purpose for collecting them and handle them accordingly. Consult your lawyer if unsure. Read more in Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

### Other company data scrapers and related Actors

| Actor | Best for |
|-------|----------|
| [UK Companies House Scraper](https://apify.com/parsebird/uk-companies-house-scraper) | UK company registry data |
| [Zefix.ch Scraper](https://apify.com/parsebird/zefix-ch-scraper) | Swiss commercial register |
| [FirmenABC.at Scraper](https://apify.com/parsebird/firmenabc-at-scraper) | Austrian company directory |
| [Owler Company Scraper](https://apify.com/parsebird/owler-company-scraper) | Company profiles, revenue, and competitors |
| [BBB Scraper](https://apify.com/parsebird/bbb-scraper) | US business profiles and ratings |

### FAQ

**Where does the data come from, and how fresh is it?**
From the open CNPJ files Receita Federal publishes monthly, served by [Minha Receita](https://docs.minhareceita.org). Every row's `ultima_atualizacao` shows which release it comes from (for example `2026-09`).

**Can I search the whole registry with no filter?**
No. The registry search needs at least one filter, so the actor asks for one before starting. Add a state or a CNAE code to any search.

**How do I search by partner CPF?**
Enter a full CPF such as `123.456.789-01` and the actor converts it to Receita's masked format `***456789**`, or enter the masked value directly. Because only six digits are kept, different people can share the same masked CPF; check the partner name in `qsa`. For a partner company, enter its CNPJ. Adding a state makes partner searches faster.

**Does it return email addresses?**
No. The public registry data this actor reads does not include email addresses, so there's no email field.

**Why are `simples_nacional` and `mei` sometimes `null`?**
`null` means the registry has no Simples Nacional or MEI record for the company, which is common for large companies and branches.

**Does it support the new alphanumeric CNPJ?**
Yes. Letters are accepted in the first 12 characters and the check digits are validated with Receita's alphanumeric rule.

**How fast is it?**
Search results come in pages of up to 1,024 companies. In our tests a 5,000-company search finished in under 30 seconds.

**Can I run it on a schedule or from my app?**
Yes. Use [Apify schedules](https://docs.apify.com/platform/schedules), call it from the [API tab](https://apify.com/parsebird/brazil-cnpj-scraper/api), or connect it to Make, Zapier, Google Sheets, or Slack through [integrations](https://apify.com/integrations).

**Where can I report issues?**
Open the **Issues** tab on the actor page with your input and run ID.

# Changelog

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

# Actor input Schema

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

Add CNPJs, one per line, to get the full registry record for each one. Dots, slashes, and dashes are ignored, and missing leading zeros are added back. When you add CNPJs, the search filters below are ignored.

## `cnpj` (type: `string`):

Look up one CNPJ, for example 00.000.000/0001-91. Same as adding one line to 'CNPJs to look up'.

## `uf` (type: `string`):

Two-letter state code such as SP, RJ, or DF. Separate several states with commas: SP, RJ, MG.

## `cnae` (type: `string`):

7-digit CNAE code, for example 6209100 (IT support) or 62.01-5/01. Matches both the primary and the secondary activities unless 'Primary CNAE only' is on.

## `primaryCnaeOnly` (type: `boolean`):

Match the CNAE code against the company's primary activity only.

## `municipio` (type: `string`):

IBGE code (7 digits, e.g. 3550308 for São Paulo) or SIAFI code (4 digits, e.g. 7107). Digits only.

## `naturezaJuridica` (type: `string`):

4-digit natureza jurídica code, e.g. 2135 (Empresário Individual, used by MEIs), 2062 (Sociedade Empresária Limitada), 2054 (Sociedade Anônima Fechada).

## `partnerCpf` (type: `string`):

Find every company where this person or company is a partner (sócio). Enter a full CPF (123.456.789-01), a masked CPF as Receita shows it (\***456789**), or a partner company's CNPJ. Add a state to make the search faster.

## `activeOnly` (type: `boolean`):

Save only companies whose registration status is ATIVA.

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

Save only head offices (MATRIZ) and skip branches (FILIAL).

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

Stop after saving this many companies.

## `pageSize` (type: `integer`):

Records requested per page from the registry API (1 to 1,024). You rarely need to change this.

## Actor input object example

```json
{
  "uf": "DF",
  "cnae": "6209100",
  "primaryCnaeOnly": false,
  "activeOnly": false,
  "headOfficeOnly": false,
  "maxItems": 20,
  "pageSize": 500
}
```

# 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 = {
    "uf": "DF",
    "cnae": "6209100",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/brazil-cnpj-scraper").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 = {
    "uf": "DF",
    "cnae": "6209100",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/brazil-cnpj-scraper").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 '{
  "uf": "DF",
  "cnae": "6209100",
  "maxItems": 20
}' |
apify call parsebird/brazil-cnpj-scraper --silent --output-dataset

```

## MCP server setup

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

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/MAARGdC195IfpwL0p/builds/HHYMGLR674Kwl6StY/openapi.json
