Brazil B2B Leads from Open CNPJ Data

    by Kaike Souza

    1

    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

    Security scanned

    Works with the AI Agents you already use

    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

    EtapaCritérioEmpresas
    1Ativas, nos municípios-alvo, com CNAE do ICP69
    2Multidisciplinares e com sócios cadastrados42
    3Com nome de clínica29
    4Lista priorizada (top por região)29

    Top 5 no Rio de Janeiro (grupo sede)

    #PontosNome fantasiaCNAEs do ICPSócios
    116NUCLEO NEURO INFANTIL43
    213CONSULTORIO TEA KIDS41
    311INSTITUTO INCLUSAO22
    411CENTRO MULTI TERAPIAS33
    510CONSULTORIO TEA KIDS21

    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 etapa
    • saida/lista_priorizada.csv: a lista final, ordenada por pontuação em cada grupo (abre no Excel)

    Próximos passos

    1. Baixe os arquivos Estabelecimentos, Empresas, Sócios e Municípios no portal de dados abertos do CNPJ (dados.gov.br) e descompacte em dados/.
    2. Confirme os municípios e CNAEs no config.toml (já deixei o do Grande Rio pronto) e troque pasta = "exemplo" por pasta = "dados".
    3. Rodo de novo e te entrego a lista real. Se a etapa 2 cortar demais, dá para baixar min_cnaes_icp para 1.

    funil.csv

    CSV · data export

    Generated

    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

    StepFilter
    1Active companies in the target state and cities, with an ICP CNAE (main or secondary)
    2Multidisciplinary (2+ ICP CNAEs) and with registered partners
    3Name looks like a real customer (clinic, center, institute...)
    4Lead 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

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

    Terminal / Shell
    Read Files
    Write Files
    Listed12 days ago

    What's inside

    Creator

    Kaike Souza

    Kaike Souza

    Frequently Asked Questions

    This skill eliminates the need for expensive monthly B2B platform subscriptions by allowing you to process Brazil's massive, multi-gigabyte open CNPJ database locally on your own machine. It automates the complex SQL joins and filtering required to turn raw government files into a prioritized, scored lead list.

    The pipeline requires Python 3.10 or higher and uses DuckDB for high-speed local processing. You will also need sufficient disk space to store and unzip the official Receita Federal CSV files, which can total several gigabytes.

    You receive the complete Python processing scripts, the DuckDB SQL integration logic, and a customizable TOML configuration file to define your Ideal Customer Profile (ICP) and scoring weights. The package also includes a guide on where to source the latest official government data files.

    By processing data locally via DuckDB, your lead lists and ICP criteria never leave your machine or enter the cloud. The skill is also designed to exclude sensitive PII by default, focusing on corporate data like Capital Social and CNAE codes for scoring.

    Yes, the included TOML configuration file allows you to define specific CNAE codes, geographic locations (UF and City), and keywords. You can also adjust the scoring weights for attributes like 'Capital Social' to ensure the output aligns with your specific sales goals.

    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.

    Free