How to look up CNPJs in bulk and list Brazilian companies by CNAE and city
Short answer
Use the Receita Federal's open CNPJ data: validate each CNPJ's check digits, then read its record, or filter the open data by state, IBGE city code and CNAE. Cadastrelo on Apify does both at $0.0008 per company; invalid and not-found CNPJs are free.
- Paste CNPJs into cnpjs (with or without punctuation; the new alphanumeric CNPJs work too).
- Or leave it empty and set filters: states (SP, RJ), cityCodes (IBGE, e.g. 3550308), activityCodes (CNAE, e.g. 6201501).
- Keep activeOnly on to drop BAIXADA/INAPTA companies; add headOfficeOnly to skip branches.
- Set maxItems to cap a search, then run.
- Schedule weekly with monitor on to catch status changes and new companies.
Copy-paste code
Python (pip install apify-client)
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("cybermax/brazil-cnpj").call(run_input={"cityCodes": ["3550308"], "activityCodes": ["6201501"], "headOfficeOnly": True, "maxItems": 200})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
print(row)Chain after any scraper (Apify Integrations -> Run Actor)
{
"cnpjs": ["33.683.111/0002-80", "00.000.000/0001-91"],
"monitor": true,
"monitorKey": "fornecedores"
}No code: n8n, Make or Zapier
n8n: HTTP Request node (or the Apify node, action "Run an Actor and get dataset")
Method: POST
URL: https://api.apify.com/v2/acts/cybermax~brazil-cnpj/run-sync-get-dataset-items
Auth: Header Auth -> Authorization: Bearer <your Apify token>
Body: JSON {"cnpjs": ["33.683.111/0002-80"]}
Make: Apify app -> "Run an Actor" (Actor: cybermax/brazil-cnpj, wait for finish = yes) -> "Get Dataset Items"
Zapier: Apify app -> action "Run Actor" (cybermax/brazil-cnpj) -> "Fetch Dataset Items" -> your app
Runs longer than 5 minutes: start with POST /v2/acts/cybermax~brazil-cnpj/runs and read the dataset when the run finishes.From an AI agent (MCP)
# Any MCP client (Claude Desktop, Claude Code, Cursor, VS Code): Apify's hosted MCP server
{
"mcpServers": {
"brazil-cnpj": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.apify.com/?tools=cybermax/brazil-cnpj",
"--header", "Authorization: Bearer ${APIFY_TOKEN}"],
"env": { "APIFY_TOKEN": "<your Apify token>" }
}
}
}
# The agent sees one tool, cybermax--brazil-cnpj, with the Actor's input schema.| CNPJ | Razão social | Situação | CNAE | Cidade | Telefone |
|---|---|---|---|---|---|
| 00.000.000/0001-91 | BANCO DO BRASIL SA | ATIVA | 6422100 | BRASILIA - DF | +55 61 3493-9002 |
| 60.701.190/0001-04 | ITAU UNIBANCO S.A. | ATIVA | 6421200 | SAO PAULO - SP | +55 11 3003-4828 |
| 12.345.678/0001-00 | invalid CNPJ (free) |
Source: Cadastrelo (Apify Actor cybermax/brazil-cnpj) README, real Apify run on 10 Nov 2026
Where CNPJ data comes from
The Receita Federal publishes the whole CNPJ register as open data every month under the Access to Information Law. Cadastrelo reads it through the open Minha Receita API, with BrasilAPI as a fallback for single lookups.
The new alphanumeric CNPJ
From July 2026 new CNPJs can contain letters in the first 12 characters. Check digits are computed from each character's code, and Cadastrelo validates both formats before looking a CNPJ up.
Lists by CNAE and city
Combine a CNAE code with a state or an IBGE city code to list every company in a sector and place, for prospecting or market sizing.
Good to know
The open data rarely includes company emails; phones are present for about 9 in 10 companies.
Partners (QSA) are optional and exclude CPF fragments and age ranges.
Hollerdex: Any company's best email, phone and socials
$0.004 per domain with contacts, misses and blocked sites freeNeed the companies' contact pages? Hollerdex finds each website's emails, phones and socials in one run.
Runs on your own Apify account, pay per result; failed results are not charged.Questions
Is it free to try?
Yes. Run it with no input for a free demo.
Is the data official?
Yes. It is the Receita Federal open CNPJ data, refreshed monthly.
Can I search by partner CPF?
No. Cadastrelo searches companies, not people.
Can an AI agent use it?
Yes. Apify's MCP server exposes it as cybermax--brazil-cnpj.
Free: the Free API Starter Kit
Copy-paste calls for 4 APIs with free daily tiers (CVE priority, VIN recalls, US duty rates, email checks), then 5 short emails on KEV/EPSS, MCP and free data.