# Brazil CNPJ Lookup Scraper (`parseforge/brazil-cnpj-scraper`) Actor

Scrapes Brazilian company registration data by CNPJ number. Returns each company as a flat row with name, address, activity codes, and legal status. Supports bulk lookup and exports to CSV, JSON, Excel, or XML.

- **URL**: https://apify.com/parseforge/brazil-cnpj-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Lead generation, Automation
- **Stats:** 18 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 result-items

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?

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Brazil CNPJ Lookup Scraper

**Look up any Brazilian company by CNPJ and get its full registration data in one flat row.** No API key, no rate limits, no captchas. Export to CSV, JSON, Excel, or XML.

The official Receita Federal CNPJ lookup is slow, captcha-protected, and returns one company at a time. This Actor reads the public registration data directly, so you can check 10 or 10,000 CNPJs in a single run and get every company back in the same fixed schema.

| Who uses it | What they scrape Receita Federal CNPJ for |
|---|---|
| Compliance officers | Verify a supplier's CNPJ and legal status before signing a contract |
| Sales teams | Enrich a lead list with company name, address, and activity codes |
| Data analysts | Build a clean dataset of Brazilian companies for market research |
| Fintech developers | Automate KYB checks by pulling registration data on demand |

### What it does

This Actor collects Brazilian company registration data by CNPJ number and returns each company as one flat row.

- 🔢 **Bulk CNPJ lookup:** paste up to a million CNPJs, with or without punctuation, and get one row per company.
- 📋 **Fixed schema:** every company returns the same fields, so you can append runs without cleaning.
- ⚡ **No API key:** reads the public Receita Federal data directly, no registration or OAuth.
- 📤 **Multiple exports:** download as CSV, JSON, Excel, or XML from the Apify dataset.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Receita Federal CNPJ data

**🧾 Verify suppliers before you pay.**

A procurement team pastes a list of vendor CNPJs and checks each company's legal status and activity codes before approving invoices.

**📊 Enrich a lead list for sales.**

A B2B sales team runs their CRM leads through the Actor to add company name, address, and contact data to every record.

**🏦 Automate KYB checks.**

A fintech developer calls the Actor from their onboarding flow to pull registration data for every new business customer.

**🗂️ Build a company database.**

A data analyst collects CNPJ data for thousands of companies and exports it to CSV for analysis in Python or Excel.

### Why choose this scraper

| | What you get |
|---|---|
| **Bulk lookup** | Check thousands of CNPJs in one run instead of one at a time on the official site |
| **Clean output** | Every company comes back in the same flat schema, ready for your CRM or database |
| **No captchas** | The Actor handles the public data source, so you never solve a captcha |
| **Flexible input** | Accept CNPJs with dots, slashes, and dashes, or the 14 digits |

### How it compares

This Actor focuses on bulk CNPJ lookup with a simple list input, while the competitor below enriches data with additional fields.

| Feature | ParseForge | CNPJ Enricher - Brazilian Company Data Lookup |
|---|---|---|
| Bulk CNPJ lookup | Yes | Not listed |
| No API key required | Yes | Not listed |
| Exports to CSV, JSON, Excel, XML | Yes | Not listed |
| Accepts CNPJ with or without punctuation | Yes | Not listed |
| Enriches with additional data fields | Not listed | Yes |

### Configure the run

Drive the Actor from a list of CNPJs, with or without punctuation, and set a maximum number of companies to collect per run. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "cnpjs": [
 "33000167000101",
 "60872504000123",
 "60746948000112"
 ],
 "maxItems": 10
}
```

A larger pull:

```json
{
 "cnpjs": [
 "33000167000101",
 "60872504000123",
 "60746948000112"
 ],
 "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.008 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.80 |
| 1,000 results | $8.00 |
| 10,000 results | $80.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Brazil CNPJ Lookup Scraper](https://apify.com/parseforge/brazil-cnpj-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Receita Federal CNPJ through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/brazil-cnpj-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that your CNPJs are valid 14-digit numbers. The Actor skips invalid entries. Also make sure you have not set maxItems to 0.

**Why is the run slow?**

The Actor reads data from the public source, which can be slow under heavy load. Try reducing the number of CNPJs per run or increasing the Actor's memory in the run settings.

**Why do some CNPJs return empty data?**

The public source may not have data for that CNPJ, or it may be temporarily unavailable. Try running the Actor again later.

**Can I use this for real-time lookups?**

The Actor is designed for batch processing. For real-time single lookups, consider using the Apify API to run the Actor on demand with one CNPJ.

### FAQ

| Question | Answer |
|---|---|
| What is a CNPJ? | CNPJ is the Brazilian national registry number for companies, similar to a tax ID. It has 14 digits and is issued by the Receita Federal. |
| Do I need an API key or login? | No. The Actor reads the public Receita Federal data directly, so you only need an Apify account to run it. |
| Can I input CNPJs with punctuation? | Yes. The Actor accepts both formatted CNPJs like 33.000.167/0001-01 and plain 14-digit strings like 33000167000101. |
| How many CNPJs can I look up in one run? | You can set the maximum companies field up to 1,000,000. The Actor will process as many as you provide, up to that limit. |
| What data do I get for each company? | Each row includes the company's registration data as returned by the public source, such as name, address, activity codes, and legal status. The exact fields are shown in the sample output. |
| Is this legal? | Yes. The data is public information published by the Brazilian government. You are responsible for complying with any applicable laws in how you use it. |
| Can I schedule this Actor to run regularly? | Yes. You can set up a schedule in Apify to run the Actor daily, weekly, or at any interval, and it will process the same CNPJ list each time. |
| What formats can I export? | You can export the results as CSV, JSON, Excel, or XML directly from the Apify dataset. |
| Does it work for MEI or individual companies? | Yes. The Actor looks up any valid CNPJ, including MEI (individual micro-entrepreneurs) and larger companies. |
| What if a CNPJ is invalid? | The Actor will return an empty result or an error for that CNPJ, and continue with the rest of the list. You can check the run log for details. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Receita Federal do Brasil. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

List of Brazilian CNPJs (14 digits each, with or without punctuation). Examples: '33.000.167/0001-01' or '33000167000101'.

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

How many companies to collect per run.

## Actor input object example

```json
{
  "cnpjs": [
    "33000167000101",
    "60872504000123",
    "60746948000112"
  ],
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (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 = {
    "cnpjs": [
        "33000167000101",
        "60872504000123",
        "60746948000112"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/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": [
        "33000167000101",
        "60872504000123",
        "60746948000112",
    ],
    "maxItems": 10,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/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/fcdWKrkDaGTtS0dfB/builds/pG3q74DXOct4pEgkI/openapi.json
