CPFHub.io
Start for free

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.

Open in Cursor

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

GEThttps://api.cpfhub.io/cnpj/{cnpj}

Parameters

WhereNameRequiredDescription
PathcnpjYesCNPJ with or without formatting: 11222333000181 or 11.222.333/0001-81. Accepts the alphanumeric CNPJ (see below).
Headerx-api-keyYesYour 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 00000000000000 are 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

JSON
{
  "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 "".

FieldTypeDescription
data.cnpjstringCNPJ looked up, 14 characters without formatting
data.razao_socialstringLegal name
data.nome_fantasiastringTrade name. May be empty
data.situacao_cadastralstringRegistration status: "Ativa" (active), "Baixada" (closed), "Inapta" (unfit), "Suspensa" (suspended) or "Nula" (void)
data.data_situacao_cadastralstring | nullDate of the current registration status
data.matriz_filialstring"Matriz" (headquarters) or "Filial" (branch)
data.data_inicio_atividadestring | nullOpening date
data.cnae_principalstringMain CNAE, 7 digits
data.cnaes_secundariosstring[]Secondary CNAEs, 7 digits each
data.codigo_natureza_juridica, data.natureza_juridicastringCode (4 digits) and description of the legal nature
data.tipo_logradouro, data.logradouro, data.numero, data.complemento, data.bairrostringAddress of the establishment
data.cepstringPostal code (CEP), 8 digits without formatting
data.uf, data.municipiostringState (abbreviation) and city
data.emailstringEmail registered with the Receita Federal. May be empty
data.telefones[]object[]ddd (area code), numero and is_fax (boolean)
data.capital_socialstringShare capital with a decimal comma: "100000,00"
data.porte_empresastringSize: "Microempresa (ME)", "Empresa de Pequeno Porte (EPP)", "Demais" or "Não informado"
data.opcao_simples, data.opcao_meistring"S" (yes), "N" (no) or "" (no information)
data.data_opcao_simples, data.data_opcao_meistring | nullDate the company opted into Simples Nacional and MEI
data.QSA[]object[]Partners and managers (below)
data.lgpd_anonimizadobooleanOnly present when the data subject asked for anonymization. Some fields come hidden

Each item of data.QSA:

FieldDescription
nome_socioPartner name (person or company)
cnpj_cpf_socioCNPJ of a corporate partner. For individuals, the CPF is always masked: ***.456.789-**
qualificacao_socioRole, for example "Sócio-Administrador" (managing partner)
data_entrada_sociedadeDate the partner joined, or null
identificador_socio"Pessoa Física" (individual), "Pessoa Jurídica" (company) or "Estrangeiro" (foreign)
faixa_etariaPartner age range
  • Empty dates or 0000-00-00 in the source database come as null.
  • 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.

StatusWhen it happensWhat to do
400CNPJ 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.
401Missing, invalid or inactive API key (error is a string)Check the x-api-key header.
403No 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.
404CNPJ not in the database ("CNPJ não encontrado na base de dados")Normal result. No credit used.
429Per-minute limit exceeded, shared with the CPF Simple Lookup (30/min by default)Wait the seconds in the Retry-After header. No credit used.
503CNPJ database unavailable ("cnpj_unavailable") or a transient failure reserving credits or saving the lookupRetry 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, 429 and 503 use 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 CNPJ 12ABC34501DE35 and the data above are fictional.

Updated on October 15, 2026