BrasilAPI CNPJ Company Scraper avatar

BrasilAPI CNPJ Company Scraper

Pricing

Pay per event

Go to Apify Store
BrasilAPI CNPJ Company Scraper

BrasilAPI CNPJ Company Scraper

Enrich Brazilian CNPJ numbers with legal names, status, CNAE, address, contacts, partners, Simples/MEI flags, and source metadata.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Categories

Share

Enrich Brazilian company CNPJ numbers with public BrasilAPI registry data.

Turn a list of CNPJs into clean company records with legal names, trade names, registration status, CNAE activity, address, contact fields, Simples/MEI tax flags, share capital, and QSA partner data.

What does BrasilAPI CNPJ Company Scraper do?

BrasilAPI CNPJ Company Scraper is an Apify Actor for Brazilian company registry enrichment.

It calls the public BrasilAPI CNPJ endpoint for each CNPJ you provide.

It normalizes the response into a consistent dataset that is ready for export, CRM enrichment, compliance screening, and analytics.

Use it when you already have Brazilian CNPJ numbers and need structured company details at scale.

Who is it for?

🧾 Compliance teams use it to enrich supplier and customer CNPJs before KYB checks.

🏢 B2B sales teams use it to add firmographic fields to Brazilian lead lists.

📊 Data teams use it to normalize company registry data for warehouses and BI tools.

🛒 Procurement teams use it to validate supplier registration status and legal entity details.

⚙️ RevOps teams use it to enrich CRM accounts from CNPJ lists.

Why use this actor?

The actor is built for repeatable enrichment workflows.

It accepts formatted or digits-only CNPJs.

It deduplicates values inside each run to avoid unnecessary API traffic.

It saves typed rows for both successful and failed lookups.

It includes bounded retry logic for temporary BrasilAPI errors.

It does not require browser automation, login, cookies, or a private API key.

Data you can extract

Field groupExamples
IdentityCNPJ, formatted CNPJ, legal name, trade name
Statusregistration status, status reason, opening date
Activitymain CNAE code, main CNAE description, secondary CNAEs
Firmographicslegal nature, company size, share capital, headquarters flag
Addressstreet, number, complement, district, city, state, ZIP, country
Contactphone 1, phone 2, fax, email
Tax flagsSimples option, MEI option, option dates
PartnersQSA count and optional partner records
Metadatasource URL, scrape timestamp, raw response option

How much does it cost to enrich CNPJ company data?

This actor uses pay-per-event pricing.

You pay a small run start fee and a per-record event for each CNPJ row saved to the dataset.

The default input is intentionally small so your first run stays inexpensive.

Larger batches get lower tier prices according to the Apify pricing tier shown on the actor page.

Input

Provide a list of Brazilian CNPJ values.

Formatted values are accepted.

Digits-only values are accepted.

Duplicate CNPJs are processed once per run.

Example input:

{
"cnpjs": [
"19.131.243/0001-97",
"00.000.000/0001-91",
"60.746.948/0001-12"
],
"maxItems": 100,
"includePartners": true,
"includeRawData": false,
"maxConcurrency": 3
}

Input options

cnpjs is the main required field.

maxItems limits how many unique CNPJs are processed.

includePartners controls whether QSA partner records are included.

includeRawData attaches the original BrasilAPI JSON object for custom mapping.

maxConcurrency controls how many requests run in parallel.

maxRetries controls retry attempts for 429, 5xx, and network errors.

retryDelayMillis controls the base retry delay.

Output

Each dataset row represents one processed CNPJ.

Successful rows include normalized company data.

Failed rows include success=false, the HTTP status when available, and an error message.

Example output item:

{
"requestedCnpj": "19.131.243/0001-97",
"cnpj": "19131243000197",
"cnpjFormatted": "19.131.243/0001-97",
"success": true,
"legalName": "OPEN KNOWLEDGE BRASIL",
"tradeName": "REDE PELO CONHECIMENTO LIVRE",
"registrationStatus": "ATIVA",
"mainActivityDescription": "Atividades de associações de defesa de direitos sociais",
"addressCity": "SAO PAULO",
"addressState": "SP",
"sourceUrl": "https://brasilapi.com.br/api/cnpj/v1/19131243000197"
}

Tips for best results

Use digits-only CNPJs when exporting from a database.

Keep concurrency conservative for very large batches.

Turn on includeRawData only when you need fields that are not normalized yet.

Use success=false rows to clean invalid CNPJs in your source system.

Run smaller scheduled batches if you need daily enrichment.

Common workflows

Enrich a CRM export with legal company names and addresses.

Validate supplier CNPJs before onboarding.

Build a Brazilian company master data table.

Check registration status for customer due diligence.

Append CNAE activity descriptions to sales lead lists.

Review QSA partner data for KYB triage.

Integrations

Export dataset items as CSV for spreadsheets.

Send JSON results to a data warehouse.

Connect Apify datasets to Make or Zapier.

Call the actor from a backend service using the Apify API.

Schedule recurring CNPJ enrichment runs from Apify.

API usage with Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/brasilapi-cnpj-company-scraper').call({
cnpjs: ['19131243000197', '00000000000191'],
includePartners: true
});
console.log(run.defaultDatasetId);

API usage with Python

from apify_client import ApifyClient
import os
client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/brasilapi-cnpj-company-scraper').call(run_input={
'cnpjs': ['19131243000197', '00000000000191'],
'includePartners': True,
})
print(run['defaultDatasetId'])

API usage with cURL

curl -X POST "https://api.apify.com/v2/acts/automation-lab~brasilapi-cnpj-company-scraper/runs?token=$APIFY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"cnpjs":["19131243000197","00000000000191"],"includePartners":true}'

MCP usage

Use this actor from AI tools through Apify MCP.

Claude Code MCP URL:

https://mcp.apify.com/?tools=automation-lab/brasilapi-cnpj-company-scraper

Add it to Claude Code with:

$claude mcp add apify-brasilapi-cnpj --transport http "https://mcp.apify.com/?tools=automation-lab/brasilapi-cnpj-company-scraper"

Claude Desktop can use this JSON MCP server configuration:

{
"mcpServers": {
"apify-brasilapi-cnpj": {
"url": "https://mcp.apify.com/?tools=automation-lab/brasilapi-cnpj-company-scraper"
}
}
}

Example prompts:

  • "Enrich these CNPJs and summarize which companies are active."
  • "Convert this supplier list into a table with legal name, state, CNAE, and status."
  • "Check which CNPJs failed validation and explain why."

Scheduling

You can schedule this actor for recurring enrichment.

For example, run it daily with newly collected CNPJs from your CRM.

Store the resulting dataset ID for downstream processing.

Use a fixed input list for periodic supplier status checks.

Error handling

Invalid CNPJ checksums are saved as failure rows.

BrasilAPI not-found responses are saved as failure rows.

Temporary 429 and 5xx responses are retried.

Network errors are retried and then saved as failure rows if they persist.

This makes batch processing easier because one bad CNPJ does not stop the whole run.

Legality and source

This actor uses BrasilAPI's public CNPJ endpoint.

You are responsible for using the data according to applicable laws, contracts, and privacy obligations.

Do not use the actor to make decisions that require additional legal, financial, or compliance review without appropriate controls.

FAQ

Do I need a BrasilAPI key?

No. The actor uses the public BrasilAPI CNPJ endpoint.

Can I submit formatted CNPJs?

Yes. Values like 19.131.243/0001-97 are accepted.

What happens to duplicate CNPJs?

Duplicates are processed once per run.

Why did a row return success=false?

The CNPJ may be invalid, not found, temporarily unavailable, or blocked by an upstream API error. Check statusCode and errorMessage.

Should I enable raw data?

Enable includeRawData only when you need the complete original BrasilAPI object. It increases dataset size.

Use other automation-lab actors when you need company enrichment outside Brazil.

Use lead generation actors when you need to discover companies first.

Use this actor when you already have CNPJs and need registry enrichment.

Support

If a field returned by BrasilAPI is missing from the normalized output, enable includeRawData and contact support with an example CNPJ.

If you see many 429 responses, lower concurrency and retry later.

Changelog

Initial version: CNPJ lookup, normalized company fields, QSA partner option, typed failure rows, and retry controls.