CNPJ Lookup
Send the CNPJ (Brazil's company registration number) and get the company's registration data: legal name, trade name, registration status, address, CNAE (activity code), size, Simples Nacional/MEI and partners (QSA). It costs 1 credit per CNPJ found, the same as the CPF Simple Lookup.
Using Cursor, Lovable, v0 or another AI? Copy the CNPJ Lookup prompt and paste it into your assistant.
Many CNPJs at once? Use the CNPJ Batch Lookup. Without code, the dashboard looks up one CNPJ at a time and keeps the result in the History.
Endpoint
https:/ / api.cpfhub.io/ cnpj/ {cnpj}Parameters
| Where | Name | Required | Description |
|---|---|---|---|
| Path | cnpj | Yes | CNPJ with or without formatting: 11222333000181 or 11.222.333/0001-81. Accepts the alphanumeric CNPJ (see below). |
| Header | x-api-key | Yes | Your API key. See Authentication. |
Alphanumeric CNPJ
The API accepts the new alphanumeric CNPJ format, which the Receita Federal (Brazil's federal revenue service) started issuing in July 2026: 12 characters with letters (A to Z) and digits, followed by 2 numeric check digits. Fictional example: 12ABC34501DE35 (or 12.ABC.345/01DE-35).
- Lowercase letters are converted to uppercase.
- Dots, slash and hyphen are removed before validation.
- The check digits are validated in both formats. Repeated sequences such as
00000000000000are rejected. - Store the CNPJ as text in your database, never as a number.
Example
The examples read the key from CPFHUB_API_KEY, treat 404 as a normal result and use a 10 s timeout.
curl --max-time 10 "https://api.cpfhub.io/cnpj/11222333000181" \
-H "x-api-key: $CPFHUB_API_KEY"Response
HTTP 200 OK
{
"success": true,
"data": {
"cnpj": "11222333000181",
"razao_social": "EMPRESA EXEMPLO LTDA",
"nome_fantasia": "EXEMPLO",
"situacao_cadastral": "Ativa",
"data_situacao_cadastral": "2015-03-10",
"matriz_filial": "Matriz",
"data_inicio_atividade": "2015-03-10",
"cnae_principal": "6201501",
"cnaes_secundarios": ["6204000", "6311900"],
"codigo_natureza_juridica": "2062",
"natureza_juridica": "Sociedade Empresária Limitada",
"tipo_logradouro": "RUA",
"logradouro": "DAS FLORES",
"numero": "100",
"complemento": "SALA 1",
"bairro": "CENTRO",
"cep": "01001000",
"uf": "SP",
"municipio": "SAO PAULO",
"email": "contato@example.com",
"telefones": [
{ "ddd": "11", "numero": "00000000", "is_fax": false }
],
"capital_social": "100000,00",
"porte_empresa": "Microempresa (ME)",
"opcao_simples": "S",
"data_opcao_simples": "2015-03-10",
"opcao_mei": "N",
"data_opcao_mei": null,
"QSA": [
{
"nome_socio": "FULANO DE TAL",
"cnpj_cpf_socio": "***.456.789-**",
"qualificacao_socio": "Sócio-Administrador",
"data_entrada_sociedade": "2015-03-10",
"identificador_socio": "Pessoa Física",
"faixa_etaria": "31 a 40 anos"
}
]
}
}Fields come from the public CNPJ database, so names and values are in Portuguese and are mostly string. Dates use YYYY-MM-DD. An empty field may come as "".
| Field | Type | Description |
|---|---|---|
data.cnpj | string | CNPJ looked up, 14 characters without formatting |
data.razao_social | string | Legal name |
data.nome_fantasia | string | Trade name. May be empty |
data.situacao_cadastral | string | Registration status: "Ativa" (active), "Baixada" (closed), "Inapta" (unfit), "Suspensa" (suspended) or "Nula" (void) |
data.data_situacao_cadastral | string | null | Date of the current registration status |
data.matriz_filial | string | "Matriz" (headquarters) or "Filial" (branch) |
data.data_inicio_atividade | string | null | Opening date |
data.cnae_principal | string | Main CNAE, 7 digits |
data.cnaes_secundarios | string[] | Secondary CNAEs, 7 digits each |
data.codigo_natureza_juridica, data.natureza_juridica | string | Code (4 digits) and description of the legal nature |
data.tipo_logradouro, data.logradouro, data.numero, data.complemento, data.bairro | string | Address of the establishment |
data.cep | string | Postal code (CEP), 8 digits without formatting |
data.uf, data.municipio | string | State (abbreviation) and city |
data.email | string | Email registered with the Receita Federal. May be empty |
data.telefones[] | object[] | ddd (area code), numero and is_fax (boolean) |
data.capital_social | string | Share capital with a decimal comma: "100000,00" |
data.porte_empresa | string | Size: "Microempresa (ME)", "Empresa de Pequeno Porte (EPP)", "Demais" or "Não informado" |
data.opcao_simples, data.opcao_mei | string | "S" (yes), "N" (no) or "" (no information) |
data.data_opcao_simples, data.data_opcao_mei | string | null | Date the company opted into Simples Nacional and MEI |
data.QSA[] | object[] | Partners and managers (below) |
data.lgpd_anonimizado | boolean | Only present when the data subject asked for anonymization. Some fields come hidden |
Each item of data.QSA:
| Field | Description |
|---|---|
nome_socio | Partner name (person or company) |
cnpj_cpf_socio | CNPJ of a corporate partner. For individuals, the CPF is always masked: ***.456.789-** |
qualificacao_socio | Role, for example "Sócio-Administrador" (managing partner) |
data_entrada_sociedade | Date the partner joined, or null |
identificador_socio | "Pessoa Física" (individual), "Pessoa Jurídica" (company) or "Estrangeiro" (foreign) |
faixa_etaria | Partner age range |
- Empty dates or
0000-00-00in the source database come asnull. - The response may gain new fields. Ignore fields your code does not know.
Errors
The API only responds in Portuguese. Error messages are shown as returned, with the translation in parentheses.
| Status | When it happens | What to do |
|---|---|---|
400 | CNPJ with an invalid format or wrong check digit ("CNPJ inválido. Formato ou dígito verificador incorreto.", invalid CNPJ) | Fix the CNPJ. Do not retry. No credit used. |
401 | Missing, invalid or inactive API key (error is a string) | Check the x-api-key header. |
403 | No credits left and no overage ("Limite de créditos excedido", credit limit exceeded, usually with error as a string, sometimes in error.message) or inactive/blocked account (error is a string) | Add credits or contact support. Do not retry. |
404 | CNPJ not in the database ("CNPJ não encontrado na base de dados") | Normal result. No credit used. |
429 | Per-minute limit exceeded, shared with the CPF Simple Lookup (30/min by default) | Wait the seconds in the Retry-After header. No credit used. |
503 | CNPJ database unavailable ("cnpj_unavailable") or a transient failure reserving credits or saving the lookup | Retry with increasing waits (2 s, 4 s, 8 s). No credit used. |
Error format and retries: Error Codes. Per-minute limit and credits: Usage Limits.
Details
- Cost: 1 credit per CNPJ found (
200), the same cost as the CPF Simple Lookup, from the same plan allowance. Some plans have their own cost: check yours in the dashboard.400,404,429and503use no credit. - Per-minute limit: the CNPJ Lookup and the CPF Simple Lookup share the same limit per API key (30 requests per minute by default, both combined).
- Data source: the public CNPJ database published by the Receita Federal (Dados Abertos do CNPJ), updated monthly and processed by the OpenCNPJ project (MIT license). CPFHub.io does not query the Receita Federal in real time for CNPJ: a record may be out of date until the next monthly update. There is no real-time CNPJ lookup.
- Individual partners: the partner's CPF is always masked. The API never returns a partner's full CPF.
- History: CNPJ lookups show up in the dashboard History, together with CPF lookups.
- Client timeout: the lookup may have completed and been charged on the server. Retrying charges again.
- Sample data: the CNPJ
11222333000181, the alphanumeric CNPJ12ABC34501DE35and the data above are fictional.
Updated on October 15, 2026