# Brazilian Company Database (CNPJ) — 69M Leads, No Scraping ✅ (`brazilayer/brazilian-company-search`) Actor

Search Brazil's official company registry by industry code (CNAE), state, city, size, capital and founding date. Returns name, CNPJ, full address, phone and e-mail. Straight from the Receita Federal bulk dataset — a database query, not a scraper, so it does not break and does not rate-limit.

- **URL**: https://apify.com/brazilayer/brazilian-company-search.md
- **Developed by:** [Brazilayer](https://apify.com/brazilayer) (community)
- **Categories:** Lead generation, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 85.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 company returneds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Brazilian Company Database Search (CNPJ)

Search Brazil's **official company registry** — 69 million CNPJs from the Receita
Federal — by industry, state, city, size, share capital and founding date. Get
back legal name, trade name, CNPJ, full address, phone and e-mail.

**This is a database query, not a scraper.** The registry is loaded in our own
Postgres, so there is no target site to block you, no rate limit to respect, and
nothing that breaks when a page changes layout. A thousand companies come back in
seconds, every time.

### What you get per company

| Field | Example |
|---|---|
| `razao_social` | PC DEBUG DESENVOLVIMENTO DE SOFTWARE LTDA |
| `nome_fantasia` | ACG ANYWARE |
| `cnpj` | 00000611000130 |
| `cnae` | 6201501 — Custom software development |
| `porte` | Micro / Small / Medium-Large |
| `capital_social` | 401545.00 |
| `data_abertura` | 1994-05-10 |
| `endereco`, `bairro`, `municipio`, `uf`, `cep` | full postal address |
| `telefone`, `email` | contact channels, when published |
| `tipo` | head office or branch |
| `situacao` | active / closed / suspended |

### Typical uses

- **B2B prospecting** — every software company in São Paulo with an e-mail on file
- **Market sizing** — how many active firms in a sector, by state, by size band
- **Territory planning** — companies founded in the last 12 months in a given city
- **Supplier discovery** — manufacturers in a specific industry code and region

### Input

Give it at least one filter:

```json
{
  "cnae": "6201",
  "uf": "SP",
  "comContato": true,
  "maxResultados": 1000
}
```

`cnae` accepts the full 7-digit code for one activity, or a 2–6 digit prefix to
sweep an entire sector (`62` = information technology, `47` = retail trade).
Other filters: `municipio`, `porte`, `situacao`, `aberturaDe`, `aberturaAte`,
`capitalMin`.

### Pricing

Charged **per company delivered**, not per run. Ask for 50 companies and you pay
for 50 — a small test run costs cents. No subscription, no minimum, no charge for
records that fail to arrive.

### Data source and privacy

Data comes from the Receita Federal's public open-data release of the National
Registry of Legal Entities, redistributed as published.

Contact fields are **omitted for sole proprietors (*empresário individual*) and
MEI**, because in those cases the registered name is a natural person's name and
the phone is usually their personal line. The company record is still returned —
only the personal contact channels are withheld. This is a deliberate LGPD
safeguard, not a data gap.

***

Built by [Brazilayer](https://www.brazilayer.com) — Brazilian public data, structured.
Questions: contato@brazilayer.com

# Actor input Schema

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

Brazilian industry classification. Use the full 7-digit code for one activity (6201501 = custom software development) or a 2-6 digit prefix to sweep a whole sector (62 = information technology). Digits only.

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

Two-letter Brazilian state code, e.g. SP, RJ, MG.

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

Receita Federal city code — narrower than state. Leave empty for the whole state.

## `porte` (type: `string`):

Registered size band.

## `situacao` (type: `string`):

Defaults to active — the only status worth prospecting.

## `comContato` (type: `boolean`):

Skip records with no contact channel. Recommended for prospecting.

## `aberturaDe` (type: `string`):

Useful for finding recently opened companies.

## `aberturaAte` (type: `string`):

Upper bound for the founding date. Combine with the field above to get a window.

## `capitalMin` (type: `integer`):

Filters out shell and micro entities when you need larger targets.

## `maxResultados` (type: `integer`):

How many companies to return. Charged per company delivered.

## Actor input object example

```json
{
  "cnae": "6201",
  "uf": "SP",
  "porte": "",
  "situacao": "ativa",
  "comContato": true,
  "maxResultados": 100
}
```

# Actor output Schema

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

Every company returned by this run, one item per company.

## `companiesCsv` (type: `string`):

Same list as a CSV download — the format most CRMs and spreadsheets import directly.

## `consoleView` (type: `string`):

Browse the results as a table.

# 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 = {
    "cnae": "6201",
    "uf": "SP",
    "porte": "",
    "situacao": "ativa",
    "comContato": true,
    "maxResultados": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("brazilayer/brazilian-company-search").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 = {
    "cnae": "6201",
    "uf": "SP",
    "porte": "",
    "situacao": "ativa",
    "comContato": True,
    "maxResultados": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("brazilayer/brazilian-company-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "cnae": "6201",
  "uf": "SP",
  "porte": "",
  "situacao": "ativa",
  "comContato": true,
  "maxResultados": 100
}' |
apify call brazilayer/brazilian-company-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=brazilayer/brazilian-company-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/vQ2gXvXX0KELk0hmA/builds/qC0QQKpVmYchiRoHr/openapi.json
