excrtx-source-cnpj

Collects Brazilian company registry data from BrasilAPI and ReceitaWS into a normalized JSON envelope.

1|Updated May 26, 2026
One-click install
npx skills add https://github.com/elderbernardi/exocortex.saas --skill excrtx-source-cnpj-elderbernardi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: excrtx-source-cnpj
Source: https://github.com/elderbernardi/exocortex.saas/tree/main/skills/excrtx-source-cnpj
Command: npx skills add https://github.com/elderbernardi/exocortex.saas --skill excrtx-source-cnpj-elderbernardi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Validating or enriching a Brazilian company's public registration data (razão social, CNAEs, capital social, partners) normally requires manual lookups across government and third-party sources. This Skill automates that lookup via public APIs and returns a single normalized JSON envelope with provenance. ## Core Features & Use Cases - Public CNPJ lookup: Queries BrasilAPI first with automatic fallback to ReceitaWS for company registry data. - Normalized output: Returns a consistent JSON envelope with data, provenance URL, and structured errors, plus a quick text output mode. - Local caching: Caches responses for 24 hours in /tmp to avoid repeated API calls, with a --no-cache flag for fresh queries. - Use Case: Before signing a contract with a new Brazilian vendor, run the CLI with their CNPJ to confirm the razão social, registration status (situação cadastral), and corporate partners (QSA). ## Quick Start Ask the assistant to look up the public registry data for CNPJ 33000167000101 and return the normalized JSON result.

Frequently Asked Questions about excrtx-source-cnpj

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I look up a Brazilian company by CNPJ via API?▼

Run the CLI with the 14-digit CNPJ: python3 -m tools.excrtx_source_cnpj.cli "33000167000101" --output json. It queries BrasilAPI first and falls back to ReceitaWS, returning a normalized JSON envelope with registry data and provenance.

What data does a CNPJ lookup return from BrasilAPI?▼

The lookup returns razão social, nome fantasia, opening date, capital social, registration status (situação cadastral), CNAEs, and the partners list (QSA). Results are wrapped in a JSON envelope with source, query timestamp, and provenance URL.

BrasilAPI vs ReceitaWS for CNPJ data, which is used?▼

BrasilAPI is the primary source because ReceitaWS is more sensitive to rate limits. The collector only falls back to ReceitaWS when BrasilAPI fails, and the provenance field records which URL actually served the data.

Can I bypass the cache to get fresh CNPJ data?▼

Yes, pass the --no-cache flag to force a fresh API query. By default results are cached locally for 24 hours in /tmp/excrtx-source-cnpj-cache to avoid repeated calls and rate limiting.

What are the limitations of public CNPJ API lookups?▼

Public APIs return only the queried CNPJ's registration, not a consolidated branch network, so the filiais field is often empty. Capital social, CNAEs, and QSA may differ slightly between sources or be outdated, so always cite the provenance URL.