GET /v0/br/cnpj
Validates a CNPJ (Cadastro Nacional da Pessoa Jurídica) — the 14-digit registration number assigned to Brazilian companies by the Receita Federal. The number consists of an 8-digit base, a 4-digit branch number (0001 for headquarters), and 2 check digits computed using weighted mod-11 sums. Standard Brazilian formatting (dots, slash, hyphen) is stripped automatically. Optionally looks up company details from the BrasilAPI.
Query Parameters Parameter Type Required Description value string Yes The 14-digit CNPJ (e.g. 11.222.333/0001-81) lookup string No Set to true or 1 to look up company details from the BrasilAPI
Example Request Bash Node.js Python
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.isvalid.dev/v0/br/cnpj?value=11.222.333/0001-81" Response Fields Field Type Description valid boolean Whether the CNPJ passed format and check digit validation formatted string CNPJ in standard Brazilian format (XX.XXX.XXX/XXXX-XX) base string First 8 digits identifying the company branch string 4-digit branch number (0001 = headquarters) checkDigits string The 2 check digits isHeadquarters boolean Whether the branch number is 0001 (headquarters)
Additional Fields (with lookup) Field Type Description found boolean Whether the CNPJ was found in the registry razaoSocial string | null Legal name (razão social) nomeFantasia string | null Trade name (nome fantasia) situacao string | null Registration status (Ativa, Suspensa, Inapta, Baixada) dataInicioAtividade string | null Activity start date cnaeFiscal string | null Primary CNAE code (economic activity) cnaeDescricao string | null CNAE description naturezaJuridica string | null Legal nature porte string | null Company size (ME, EPP, etc.) capitalSocial number | null Share capital in BRL uf string | null State (UF) code (e.g. SP, RJ) municipio string | null Municipality name cep string | null Postal code (CEP) dataSource string | null brasilapi when data was retrieved from the BrasilAPI
Example Response {
"valid": true,
"formatted": "11.222.333/0001-81",
"base": "11222333",
"branch": "0001",
"checkDigits": "81",
"isHeadquarters": true
}Example Response — with lookup {
"valid": true,
"formatted": "11.222.333/0001-81",
"base": "11222333",
"branch": "0001",
"checkDigits": "81",
"isHeadquarters": true,
"found": true,
"razaoSocial": "EMPRESA EXEMPLO LTDA",
"nomeFantasia": "EXEMPLO",
"situacao": "Ativa",
"dataInicioAtividade": "2010-05-15",
"cnaeFiscal": "6201501",
"cnaeDescricao": "Desenvolvimento de programas de computador sob encomenda",
"naturezaJuridica": "206-2 - Sociedade Empresária Limitada",
"porte": "ME",
"capitalSocial": 50000,
"uf": "SP",
"municipio": "SAO PAULO",
"cep": "01310100",
"dataSource": "brasilapi"
}Example Response — invalid {
"valid": false
}