← Back to Skills Marketplace
runawaydevil

Cnpj Lookup

by runawaydevil · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
317
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install cnpj-lookup
Description
Consulta CNPJ via APIs públicas brasileiras (BrasilAPI, CNPJ.ws, OpenCNPJ) com fallback automático, cache e rate limit. Ativar quando o usuário pedir consult...
README (SKILL.md)

CNPJ Lookup 🔍

Consulta empresas brasileiras via CNPJ usando APIs públicas com fallback automático.

Início Rápido

"Consultar CNPJ 12.345.678/0001-95"
"Pesquisar empresa pelo CNPJ 19131243000197"
"Me diga razão social, situação cadastral, CNAE principal, endereço e QSA"
"Detalhe do CNPJ 19131243000197 em JSON"

Workflows

Workflow 1: Consulta Simples (Resumo)

O usuário pede apenas informações básicas:

  • Razão social
  • Nome fantasia
  • Situação cadastral
  • Endereço resumido

Prompt típico: "consultar cnpj 19131243000197"

Workflow 2: Consulta Completa (Detalhes + QSA)

O usuário pede informações detalhadas incluindo:

  • CNAE principal e secundários
  • Quadro de Sócios e Administradores (QSA)
  • Contato (email, telefone)
  • Capital social

Prompt típico: "consulta completa do CNPJ 19131243000197" ou "detalhes QSA"

Workflow 3: Exportar JSON

O usuário quer dados estruturados para integração:

  • Retorna JSON com schema normalizado
  • Inclui metadados (fonte, cache, timestamp)

Prompt típico: "cnpj 19131243000197 json" ou "exportar dados CNPJ"

Como Funciona

  1. Validação: CNPJ é sanitizado (só dígitos) e verifica dígitos verificadores
  2. Cache: Consulta anterior retorna dados em cache (TTL: 24h)
  3. Fallback em cascata:
    • BrasilAPI → CNPJ.ws → OpenCNPJ
  4. Rate Limit: Respeita limites de cada provider (30/2/30 req/min)
  5. Normalização: Output padronizado independente do provider

Execução via Script

# Consulta completa (já vem com detalhes por padrão: QSA, CNAEs, etc)
python3 scripts/cnpj_lookup.py 19131243000197

# Consulta com JSON
python3 scripts/cnpj_lookup.py 19131243000197 --json

# Forçar provider específico
python3 scripts/cnpj_lookup.py 19131243000197 --provider brasilapi

# Ignorar cache
python3 scripts/cnpj_lookup.py 19131243000197 --no-cache

# TTL customizado (em segundos)
python3 scripts/cnpj_lookup.py 19131243000197 --ttl 3600

# Consulta simples (apenas基本信息)
python3 scripts/cnpj_lookup.py 19131243000197 --detailed False

Referências

  • Provedores - Endpoints, limites e comportamento de rate limit
  • Campos - Schema normalizado e divergências entre provedores

Aviso

Dados para consulta/enriquecimento; não substitui documento oficial.

Usage Guidance
This skill appears internally consistent and matches its description: it makes outbound HTTP requests to public Brazilian CNPJ APIs and caches responses in a local .cache directory. It does not request credentials or perform unexpected actions. Consider: (1) cached data is written to disk under the skill folder — if you run in a shared environment, verify you are comfortable with those files; (2) the skill makes network calls to third-party public APIs (which is required for its function) — if you must restrict network access, block or review those endpoints first; (3) the TTL can be changed with the CNPJ_LOOKUP_TTL_SECONDS environment variable if you wish to control caching. If you want higher assurance, inspect the full scripts/cnpj_lookup.py file (it uses only Python standard library modules).
Capability Analysis
Type: OpenClaw Skill Name: cnpj-lookup Version: 1.0.0 The OpenClaw AgentSkills skill bundle for CNPJ lookup is benign. The `scripts/cnpj_lookup.py` script correctly implements its stated purpose of querying public CNPJ APIs, handling caching, rate limiting, and data normalization. There is no evidence of data exfiltration, malicious execution (e.g., `os.system`, `eval` on untrusted input), persistence mechanisms, or obfuscation. The `SKILL.md` and `README.md` files contain only legitimate instructions for the agent and user, with no attempts at prompt injection to manipulate the agent into unauthorized actions. The use of `urllib.request` and `json.loads` for network communication and data parsing is standard and secure within this context.
Capability Assessment
Purpose & Capability
Name and description match the contained code and SKILL.md: the script queries BrasilAPI, CNPJ.ws, and OpenCNPJ with fallback, normalization, caching and simple rate limiting. No unrelated services, binaries, or credentials are requested.
Instruction Scope
SKILL.md instructs the agent to validate CNPJ, use cache, call public provider endpoints, apply fallback and rate limiting, and return normalized JSON or markdown. The instructions do not ask the agent to read unrelated files, exfiltrate data, or contact endpoints outside the documented providers.
Install Mechanism
There is no install spec (instruction-only + included Python script). The bundled Python script uses only standard library modules (urllib, json, pathlib, etc.), so no third-party install or remote code download is required.
Credentials
The skill does not require credentials or configuration paths. It optionally reads one environment variable (CNPJ_LOOKUP_TTL_SECONDS) to override cache TTL; this is proportional to caching behavior and not sensitive. No SECRET/TOKEN/PASSWORD env vars are requested.
Persistence & Privilege
The script writes cache files under a local .cache directory inside the skill base path; this is expected for caching but means it will create files on disk. always is false and the skill does not modify other skills or global agent settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cnpj-lookup
  3. After installation, invoke the skill by name or use /cnpj-lookup
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Primeira versão estável do cnpj-lookup para consulta de empresas brasileiras via CNPJ. - Integração automática com BrasilAPI, CNPJ.ws e OpenCNPJ com fallback inteligente, cache e rate limit. - Suporte a três workflows: consulta simples, consulta completa (com QSA, CNAE, etc.) e exportação em JSON. - Utilização de cache com TTL configurável e validação automática do CNPJ. - Outputs normalizados para fácil integração e resultados consistentes.
Metadata
Slug cnpj-lookup
Version 1.0.0
License
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Cnpj Lookup?

Consulta CNPJ via APIs públicas brasileiras (BrasilAPI, CNPJ.ws, OpenCNPJ) com fallback automático, cache e rate limit. Ativar quando o usuário pedir consult... It is an AI Agent Skill for Claude Code / OpenClaw, with 317 downloads so far.

How do I install Cnpj Lookup?

Run "/install cnpj-lookup" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Cnpj Lookup free?

Yes, Cnpj Lookup is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Cnpj Lookup support?

Cnpj Lookup is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Cnpj Lookup?

It is built and maintained by runawaydevil (@runawaydevil); the current version is v1.0.0.

💬 Comments