# Brazil Company Data — CNPJ, Partners (QSA) & CNAE Activity (`foxlabs/brazil-company-data`) Actor

Official Brazilian company data by CNPJ: legal and trade name, CNAE activity, legal nature, share capital, status, partners (QSA) and registered address.

- **URL**: https://apify.com/foxlabs/brazil-company-data.md
- **Developed by:** [Berkan Kaplan](https://apify.com/foxlabs) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 company records

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

## Brazil Company Registry Scraper (CNPJ / Receita Federal)

Official Brazilian company data by CNPJ: legal and trade name, registration status with its reason, CNAE activity, legal nature, share capital, **partners and shareholders (QSA)**, tax regime flags and registered address.

**Free · No API key · Official source · Same schema across every country in this series**

### What data do you get?

| Field | Description |
|---|---|
| `companyName` | Registered legal name |
| `registrationNumber` | CNPJ — the register's own identifier |
| `taxNumber` | VAT / tax identifier where published |
| `status` | Normalized to `active` / `inactive` / `dissolved` / `unknown` |
| `statusRaw` | The register's own wording, untranslated |
| `legalForm` | Legal form as registered |
| `incorporatedOn` / `dissolvedOn` | ISO dates |
| `address`, `city`, `postalCode` | Registered address |
| `industry`, `industryCode` | Activity classification where published |
| `employees`, `capital` | Where the register publishes them |
| `officers[]` | Directors / partners where published |
| `sourceUrl` | Link to the company's page on the register |

Country-specific fields on top of the shared schema: `tradeName`, `statusReason`, `statusChangedOn`, `state`, `secondaryIndustries[]`, `companySize`, `isHeadquarters`, `simplesNacional`, `mei`.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | array | — | CNPJ numbers (14 digits — `19.131.243/0001-97` or `19131243000197`). |
| `maxResultsPerQuery` | integer | `5` | For name searches, how many matching companies to return. |
| `includeRaw` | boolean | `false` | Attach the register's untouched response under `raw`. |
| `requestDelayMs` | integer | `200` | Politeness delay against a public register. |
| `proxyConfiguration` | object | none | Optional. |

```json
{
  "queries": [
    "19131243000197",
    "00000000000191"
  ],
  "maxResultsPerQuery": 5
}
```

### Example output

```json
{
  "country": "BR",
  "registry": "Receita Federal — CNPJ",
  "companyName": "OPEN KNOWLEDGE BRASIL",
  "tradeName": "REDE PELO CONHECIMENTO LIVRE",
  "registrationNumber": "19131243000197",
  "status": "active",
  "statusRaw": "ATIVA",
  "legalForm": "Associação Privada",
  "incorporatedOn": "2013-10-03",
  "city": "SAO PAULO",
  "state": "SP",
  "industry": "Atividades de associações de defesa de direitos sociais",
  "industryCode": "94992",
  "capital": "0 BRL",
  "officers": [
    {
      "name": "HAYDEE SVAB",
      "role": "Presidente",
      "ageRange": "Entre 41 a 50 anos"
    }
  ],
  "sourceUrl": "https://casadosdados.com.br/solucao/cnpj/19131243000197"
}
```

### What can you use it for?

- **KYC and onboarding** — registration status, its reason and the partners (QSA) behind the company.
- **Tax regime checks** — Simples Nacional and MEI flags tell you how a supplier is taxed.
- **Lead enrichment** — CNAE activity, legal nature, share capital and full address from a CNPJ.

### Frequently asked questions

#### Is this Brazilian company registry scraper free?

The data source is free and needs no API key — you pay only for the Apify compute the run uses.

#### Do I need an API key or an account with the registry?

No. Receita Federal publishes the CNPJ base as open data; this actor reads it per company through the free BrasilAPI gateway.

#### Can I search by company name, or only by CNPJ?

CNPJ only. Receita Federal publishes no public search-by-name index, so a name query fails with a clear message rather than returning nothing.

#### How current is the data?

Every run queries the source live, so results are as current as the register itself.

#### Can I export the results to CSV, Excel or JSON?

Yes. Apify datasets export to CSV, Excel, JSON, XML and HTML, and can be pulled through the API or pushed to your own storage.

#### Can I combine this with other countries in one dataset?

Yes — that is why it exists. Every actor in this series emits the same core schema, so results from different countries concatenate into one table with no remapping.

#### Is scraping this data legal?

This actor reads a public register that the Brazilian authorities publish deliberately for public inspection. Company records are public by design; where a record names a person (a director, owner or partner), that is personal data and your use of it falls under GDPR or the local equivalent — handle it accordingly.

#### Does it return the company's partners?

Yes. The QSA (quadro de sócios e administradores) is mapped into the shared `officers` array with each partner's role and age band.

### Notes and limits

- **Lookup is by CNPJ only.** Receita Federal publishes no public search-by-name index — a name query fails with a clear message rather than returning nothing.
- Read through **BrasilAPI**, which serves Receita Federal's open CNPJ base as per-company lookups. The official release is a multi-gigabyte monthly dump, which is not usable per company.
- `qsa` partners are mapped into the shared `officers` array, including each partner's role and age band.
- Queries that match nothing are still pushed as `{ query, error }`, so a partial run is never silent.

### Other country registries in this series

Norway · Finland · Denmark · Iceland · Poland · Slovakia · Slovenia · Latvia · Estonia · Czechia ·
France · UK · Israel · Taiwan · Singapore · Vietnam · Brazil · Colombia · Peru · USA — plus
**EU VAT Validation (VIES)** covering all 27 member states.

# Actor input Schema

## `queries` (type: `array`):

CNPJ numbers (14 digits, with or without punctuation — `19.131.243/0001-97` works). Lookup by company name is not supported by the source.

## `maxResultsPerQuery` (type: `integer`):

When a query is a name rather than an exact identifier, how many matching companies to return.

## `includeRaw` (type: `boolean`):

Attach the register's untouched response under `raw`. Useful when you need a field this actor does not map.

## `requestDelayMs` (type: `integer`):

Politeness delay against a public register. Raise it for large runs.

## `proxyConfiguration` (type: `object`):

Optional. Raise concurrency-friendly delays instead if you hit rate limits.

## Actor input object example

```json
{
  "queries": [
    "19131243000197",
    "00000000000191"
  ],
  "maxResultsPerQuery": 5,
  "includeRaw": false,
  "requestDelayMs": 200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "queries": [
        "19131243000197",
        "00000000000191"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("foxlabs/brazil-company-data").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 = { "queries": [
        "19131243000197",
        "00000000000191",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("foxlabs/brazil-company-data").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 '{
  "queries": [
    "19131243000197",
    "00000000000191"
  ]
}' |
apify call foxlabs/brazil-company-data --silent --output-dataset

```

## MCP server setup

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

```

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/C1fvjTgissfXm0EFY/builds/UT5t2bjHZ3ejU92Qf/openapi.json
