# Brazil Company Search (CNPJ): Receita Federal Open Data (`swiftkit/brazil-companies`) Actor

Find Brazilian companies by state, city, CNAE activity or legal form, or look up CNPJ numbers: name, trade name, status, founding date, activities, size, capital, address and phone. Official Receita Federal open data. No partner data. $1 per 1,000 companies.

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

## Pricing

$1.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 Company Search (CNPJ): Receita Federal Open Data

Find **Brazilian companies** by state, city, CNAE activity or legal form, or look up CNPJ numbers in
bulk, and get one clean row per company:

- **Identity:** CNPJ (raw and formatted), legal name (razão social), trade name (nome fantasia),
  legal form (natureza jurídica), founding date, head office or branch
- **Status:** registration status (ativa, baixada, inapta…), status date and reason
- **Activity:** main CNAE code and description, plus all secondary CNAEs
- **Size and tax:** size (ME, EPP, demais), share capital in BRL, Simples Nacional and MEI flags
- **Address:** street, number, complement, district, CEP, city, state and IBGE city code
- **Contact:** the registered phone numbers (and email, when the registry has one)

**Cities by name:** type `Campinas` or `Florianópolis/SC`. We turn names into IBGE codes for you
using the official IBGE list.

Data comes from the **Receita Federal CNPJ open data** (public under Brazil's Access to Information
Law), served by [Minha Receita](https://minhareceita.org), a free open-source project. No key, no
login, no CAPTCHA.

### Who it's for

- **B2B sales:** lists of active companies by activity and city, e.g. every software house in
  Florianópolis or every restaurant in Campinas.
- **KYB and finance:** check CNPJ status, legal form and activity in bulk.
- **Market research:** count companies by sector, size and region.

### Input

| Option | Default | What it does |
|---|---|---|
| States (UF) | – | One or more states |
| Cities | – | Names (`Campinas`, `São José/SC`) or 7-digit IBGE codes |
| Activity (CNAE) codes | – | e.g. `6201-5/01` or `6201501` |
| Also match secondary activities | off | Main CNAE only, or main + secondary |
| Legal form codes | – | e.g. `2062` (Ltda), `2054` (S.A. fechada) |
| Company size | – | Micro, small, other |
| Only active companies | on | Skip closed and unfit registrations |
| Only head offices | on | One row per company instead of one per branch |
| Include sole traders (MEI) | off | See privacy below |
| CNPJ numbers | – | Bulk lookup (ignores the filters) |
| Max companies | 100 | Up to 10,000 per run |

### Output

Real data:

```json
{
  "status": "ok",
  "cnpj": "60610781000168",
  "cnpjFormatted": "60.610.781/0001-68",
  "name": "CICI3 TECNOLOGIA E ASSESSORIA LTDA",
  "tradeName": "CICI3 TECH",
  "headOffice": true,
  "registrationStatus": "ATIVA",
  "founded": "2025-04-30",
  "legalForm": "Sociedade Empresária Limitada",
  "mainActivityCode": "6201-5/01",
  "mainActivity": "Desenvolvimento de programas de computador sob encomenda",
  "secondaryActivities": [{ "code": "6204-0/00", "description": "Consultoria em tecnologia da informação" }],
  "size": "micro",
  "shareCapitalBRL": 1000,
  "simplesNacional": true,
  "address": { "street": "RODOVIA JOAO CARLOS DAUX", "number": "4190", "district": "SACO GRANDE", "postalCode": "88032005", "city": "FLORIANOPOLIS", "state": "SC", "ibgeCityCode": 4205407 },
  "phones": ["+55 41 98130414"]
}
```

### Privacy, on purpose

- **Partners and shareholders (QSA) are never returned**, and you can't search by a person's CPF.
- **Sole traders are excluded by default** (MEI, empresário individual and other one-person
  forms): their business name is usually the owner's own name, often with ID digits.

### Pricing

You pay **per company returned**. Errors, not-found numbers and skipped sole traders are free.
See the Pricing tab.

### Limits, honestly

- Filters on status, head office and size are applied after fetching, so a narrow search may
  read many registry entries to find a few matches. A run stops after about 80,000 entries checked;
  add a city or CNAE to narrow it.
- We send one request per second to be kind to the free service, so large runs take a while
  (about 200 entries checked per second at best).
- The Receita Federal updates the open data about once a month, so very recent changes may be missing.
- Many small companies have no phone or email on file.

### Thank you, Minha Receita

This tool relies on [Minha Receita](https://minhareceita.org), run by volunteers. If it's useful to
you, consider supporting the project there.

### More tools from SwiftKit

- [French Company Search (SIRENE)](https://apify.com/swiftkit/france-companies): official French company data
- [Norway & Finland Company Search](https://apify.com/swiftkit/nordic-companies): official Brreg and YTJ registers
- [Company Domain & Logo Finder](https://apify.com/swiftkit/company-lookup): websites, logos and socials for company names
- [Website Contact Finder](https://apify.com/swiftkit/website-contacts): business emails and phones from company websites

### Use it from your AI agent (MCP)

Claude, Cursor and other MCP clients can call this tool directly through Apify's MCP server. Add it as
an MCP server / connector:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=swiftkit/brazil-companies",
      "headers": { "Authorization": "Bearer <YOUR_APIFY_TOKEN>" }
    }
  }
}
```

Then just ask, for example: *"List 50 active software companies in Florianópolis with their phone numbers"*. Each call is billed like a normal run.

### Questions?

Open an issue on the Issues tab.

# Actor input Schema

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

One or more states.

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

City names, with the state if the name exists in several states: Campinas, Florianópolis/SC, São José - SC. 7-digit IBGE codes also work.

## `activityCodes` (type: `array`):

7-digit CNAE codes, with or without punctuation: 6201-5/01 (software development), 5611-2/01 (restaurants), 4711-3/02 (supermarkets).

## `includeSecondaryActivities` (type: `boolean`):

Off: the CNAE must be the company's main activity. On: it can also be a secondary activity.

## `legalFormCodes` (type: `array`):

e.g. 2062 (Sociedade Empresária Limitada), 2054 (S.A. fechada), 2046 (S.A. aberta), 3999 (Associação).

## `sizes` (type: `array`):

Size as registered with the Receita Federal.

## `onlyActive` (type: `boolean`):

Skip closed, suspended and unfit registrations.

## `onlyHeadOffices` (type: `boolean`):

Every branch has its own CNPJ. On: one row per company (the head office).

## `includeSoleTraders` (type: `boolean`):

MEIs and empresários individuais are excluded by default because their business name is usually the owner's name.

## `cnpjList` (type: `array`):

14-digit CNPJs, with or without punctuation, one per line. When given, the filters above are ignored.

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

Stop after this many companies.

## Actor input object example

```json
{
  "states": [
    "SC"
  ],
  "cities": [
    "Florianópolis"
  ],
  "activityCodes": [
    "6201-5/01"
  ],
  "includeSecondaryActivities": false,
  "onlyActive": true,
  "onlyHeadOffices": true,
  "includeSoleTraders": false,
  "maxResults": 100
}
```

# Actor output Schema

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

One row per company.

# 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": [
        "SC"
    ],
    "cities": [
        "Florianópolis"
    ],
    "activityCodes": [
        "6201-5/01"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("swiftkit/brazil-companies").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": ["SC"],
    "cities": ["Florianópolis"],
    "activityCodes": ["6201-5/01"],
}

# Run the Actor and wait for it to finish
run = client.actor("swiftkit/brazil-companies").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": [
    "SC"
  ],
  "cities": [
    "Florianópolis"
  ],
  "activityCodes": [
    "6201-5/01"
  ]
}' |
apify call swiftkit/brazil-companies --silent --output-dataset

```

## MCP server setup

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

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/FsqD9tbzD0onbxh2Q/builds/ER2M6tcopN3vsBbet/openapi.json
