Skip to content
Search/
CyberMax › Answers

How to look up CNPJs in bulk and list Brazilian companies by CNAE and city

Updated 2026-11-13 · Data and API builders · by CyberMax

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.

  1. Paste CNPJs into cnpjs (with or without punctuation; the new alphanumeric CNPJs work too).
  2. Or leave it empty and set filters: states (SP, RJ), cityCodes (IBGE, e.g. 3550308), activityCodes (CNAE, e.g. 6201501).
  3. Keep activeOnly on to drop BAIXADA/INAPTA companies; add headOfficeOnly to skip branches.
  4. Set maxItems to cap a search, then run.
  5. 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.
Free demo run on Apify (10 Nov 2026: CNPJ lookups plus a search; 2.6 s)
CNPJRazão socialSituaçãoCNAECidadeTelefone
00.000.000/0001-91BANCO DO BRASIL SAATIVA6422100BRASILIA - DF+55 61 3493-9002
60.701.190/0001-04ITAU UNIBANCO S.A.ATIVA6421200SAO PAULO - SP+55 11 3003-4828
12.345.678/0001-00invalid CNPJ (free)

Source: Cadastrelo (Apify Actor cybermax/brazil-cnpj) README, real Apify run on 10 Nov 2026

Run Cadastrelo on ApifyCorproll: EU company registry lookup

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 icon

Hollerdex: Any company's best email, phone and socials

$0.004 per domain with contacts, misses and blocked sites free

Need 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.

You get one email to confirm first. Then the kit, and 5 short emails over two weeks. One-click unsubscribe in every email; we never share your address.

Compare the options

Hollerdex vs vdrmota Contact Details Scraper and khadinakbar Contact Details Scraper: company contact details scrapers comparedHollerdex vs two contact details scrapers on Apify: live prices (per domain or per page), labelled company ema

Related answers

How to look up a company in EU business registers (SIREN, org number, Y-tunnus, IČO, LEI)Check a company's status, legal form, address, industry and VAT number in France, Norway, Finland, Czechia, PoHow to validate phone numbers in bulk (and find the mobile ones)Check a list of phone numbers: valid or not, E.164 format, mobile or landline, carrier, city and time zone. Py