- Home
- Skills
- APIs & Backend
- Brazil B2B Leads from Open CNPJ Data
Brazil B2B Leads from Open CNPJ Data
by Kaike Souza
Turns Brazil's open CNPJ company data (Receita Federal) into a ranked B2B prospect list: filter by CNAE, state, city and name keywords, then lead-score every company. Runs locally with DuckDB + Python, no API keys.
Free
Brazil B2B Leads from Open CNPJ Data
Example session with this skill installed
Quero uma lista de prospecção de clínicas de terapia (fono, TO, psicologia) no Grande Rio a partir dos dados abertos do CNPJ. Roda primeiro com os dados de exemplo pra eu ver como fica.
- Read your context and instructions
- Compiled the brazil b2b leads
- Generated the data export
Resumo
Rodei o pipeline com os
dados fictícios de exemplo (120 empresas no layout oficial da Receita) e o ICP de clínicas de terapia no Grande Rio. Das 120 empresas,
29 entraram na lista priorizada.
Funil
| Etapa | Critério | Empresas |
|---|---|---|
| 1 | Ativas, nos municípios-alvo, com CNAE do ICP | 69 |
| 2 | Multidisciplinares e com sócios cadastrados | 42 |
| 3 | Com nome de clínica | 29 |
| 4 | Lista priorizada (top por região) | 29 |
Top 5 no Rio de Janeiro (grupo sede)
| # | Pontos | Nome fantasia | CNAEs do ICP | Sócios |
|---|---|---|---|---|
| 1 | 16 | NUCLEO NEURO INFANTIL | 4 | 3 |
| 2 | 13 | CONSULTORIO TEA KIDS | 4 | 1 |
| 3 | 11 | INSTITUTO INCLUSAO | 2 | 2 |
| 4 | 11 | CENTRO MULTI TERAPIAS | 3 | 3 |
| 5 | 10 | CONSULTORIO TEA KIDS | 2 | 1 |
Nos demais municípios, o líder é NUCLEO NEURO INFANTIL em Nova Iguaçu (15 pontos), seguido de NUCLEO ABA AFETO em São Gonçalo (14).
Arquivos gerados
saida/funil.csv: quantas empresas sobram em cada etapasaida/lista_priorizada.csv: a lista final, ordenada por pontuação em cada grupo (abre no Excel)
Próximos passos
- Baixe os arquivos Estabelecimentos, Empresas, Sócios e Municípios no portal de dados abertos do CNPJ (dados.gov.br) e descompacte em
dados/. - Confirme os municípios e CNAEs no
config.toml(já deixei o do Grande Rio pronto) e troquepasta = "exemplo"porpasta = "dados". - Rodo de novo e te entrego a lista real. Se a etapa 2 cortar demais, dá para baixar
min_cnaes_icppara 1.
funil.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
What it does
This skill turns the public CNPJ files from Brazil's Receita Federal into a prioritized outbound prospect list. It filters companies that match your ideal customer profile (ICP), drops the ones that don't look like customers, and scores the rest so your sales team knows who to call first.
Built for markets with low digital presence (small clinics, local service providers), where inbound doesn't work and the real question is who to approach first.
The funnel
| Step | Filter |
|---|---|
| 1 | Active companies in the target state and cities, with an ICP CNAE (main or secondary) |
| 2 | Multidisciplinary (2+ ICP CNAEs) and with registered partners |
| 3 | Name looks like a real customer (clinic, center, institute...) |
| 4 | Lead score, then top N in the main city + top N in the others |
Score = CNAEs in the ICP + number of partners + niche and multidisciplinary keywords + capital social. Every weight, CNAE, city and keyword lives in one config file, so switching markets means editing the config, not the SQL.
Why it works
- Free data: the official Receita Federal base, no paid lookups.
- Runs on a laptop: DuckDB reads the raw files from disk and filters by state at read time.
- Tested in production: the same logic built a weekly call list for a healthtech selling to therapy clinics in Greater Rio (3,121 companies down to 470 prioritized leads).
- LGPD-aware: partner names never leave the load step (only the count is used); phone and e-mail are off by default.
What's inside
- SQL pipeline (DuckDB) + Python orchestrator
- Example config (therapy clinics in Greater Rio) and a guide with CNAEs for other markets
- Fictitious data generator to try it in seconds before downloading the real base
Requires manual download of large official files. City names must be uppercase and match the Receita database exactly. Processing speed depends on local disk I/O for large CSV files.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 12 days ago
- Free with an Agensi account
- Software
Python
You download the CNPJ files yourself from dados.gov.br (several GB). The pipeline makes no network calls.
Permissions
What's inside
Creator
Kaike Souza
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.