# Brazil CNPJ Scraper — Company Data from Receita Federal (`hipersoft/brazil-cnpj-scraper`) Actor

Look up Brazilian companies by CNPJ and get the full official record: legal name, address, industry (CNAE), partners/shareholders (QSA), tax regime, and status. Fast, reliable, and cheap.

- **URL**: https://apify.com/hipersoft/brazil-cnpj-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.001 / company scraped

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 CNPJ Scraper — Company Data from Receita Federal

Look up any Brazilian company by **CNPJ** and get its full official record from Receita Federal's open registry: legal name, trade name, address, industry codes (CNAE), partners/shareholders (QSA), tax regime, share capital, and registration status. Clean structured output, fast, and priced fairly.

### Features

- 🏢 **Full company record** — legal name, trade name, HQ/branch, status & status date, opening date, company size
- 🗺️ **Complete address** — street, number, district, city (+ IBGE code), state, ZIP
- 🏭 **Industry (CNAE)** — primary and secondary activities with codes and descriptions
- 👥 **Partners & shareholders (QSA)** — names, roles, entry dates
- 💰 **Financials & tax** — share capital, Simples Nacional / MEI status, tax regime
- 📞 **Contact** — phone and email where available
- ⚡ **Batch & reliable** — look up thousands of CNPJs per run, with automatic retries and a backup data source
- 🧹 **Clean output** — normalized, English-labelled fields with ISO dates (optionally include the full raw record)

### Input

```json
{
  "cnpjs": ["00.000.000/0001-91", "33000167000101"],
  "includeRaw": false
}
```

| Field | Description |
|---|---|
| `cnpjs` | List of CNPJs — any format (with or without punctuation) |
| `includeRaw` | Also include the full raw Receita Federal record |

### Output

Each company is one dataset item:

```json
{
  "type": "company",
  "cnpj": "00000000000191",
  "cnpjFormatted": "00.000.000/0001-91",
  "companyName": "BANCO DO BRASIL SA",
  "tradeName": "DIRECAO GERAL",
  "status": "ATIVA",
  "openingDate": "1966-08-01",
  "companySize": "DEMAIS",
  "shareCapital": 120000000000,
  "mainActivity": { "code": "6422100", "description": "Bancos múltiplos, com carteira comercial" },
  "address": { "city": "BRASILIA", "state": "DF", "zip": "70073901" },
  "partners": [ { "name": "…", "role": "Diretor", "since": "…" } ],
  "partnerCount": 42
}
```

### Common use cases

- **KYC / KYB & compliance** — verify companies and their shareholders
- **Lead generation & enrichment** — enrich CRM records with official company data
- **Market & competitor research** — analyze companies by industry (CNAE), region, or size
- **Due diligence** — check registration status and ownership structure

### FAQ

**Do I need an API key or account?**
No. The Actor reads Brazil's open company registry from [Receita Federal](https://www.gov.br/receitafederal) via the free minhareceita.org mirror — no login and no key required.

**How many CNPJs can I look up per run?**
Thousands. Pass a list of CNPJs in any format (with or without punctuation) and the Actor batches them, with automatic retries and a backup data source for reliability.

**How fresh is the data?**
The registry is refreshed monthly from Receita Federal's official bulk open data, so records reflect the most recent monthly snapshot rather than same-day changes.

**Is the data official?**
Yes — it originates from Receita Federal's public open registry (the official Brazilian tax authority). Only public data is returned; this is an independent tool and is not affiliated with or endorsed by Receita Federal.

**What's the output format?**
Clean, structured JSON — one item per company with normalized, English-labelled fields and ISO dates. Invalid CNPJs are returned with `found: false`, and you can optionally include the full raw record. Export as JSON, CSV or Excel.

### Related Actors

More government and regulatory data scrapers from the same publisher:

- [USASpending.gov Scraper](https://apify.com/hipersoft/usaspending-scraper) — US federal contracts, grants, loans and awards.
- [SEC EDGAR Filings Scraper](https://apify.com/hipersoft/sec-edgar-scraper) — 10-K, 10-Q and 8-K filings by ticker or CIK.
- [openFDA Scraper](https://apify.com/hipersoft/openfda-scraper) — FDA drug, device and food recalls, labels and adverse events.

### Notes

Data comes from Receita Federal's public open registry (via the free minhareceita.org mirror, refreshed monthly from the official bulk data). Only public data is returned. Invalid CNPJs are reported with `found: false`.

# Actor input Schema

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

List of CNPJs to look up. Any format works — with or without dots/slash/dash (e.g. "00.000.000/0001-91" or "00000000000191").

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

Also include the full raw Receita Federal record (all original Portuguese fields) alongside the clean structured output.

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

Optional. The data source is a public API that works without a proxy; enable a proxy only if you scrape very large volumes and hit rate limits.

## Actor input object example

```json
{
  "cnpjs": [
    "00000000000191"
  ],
  "includeRaw": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "cnpjs": [
        "00000000000191"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/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 = { "cnpjs": ["00000000000191"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hipersoft/brazil-cnpj-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TodZjYXANcfpZPGLw/builds/jWQ4flZCxkYUnXADA/openapi.json
