Look up a CNPJ

CNPJAPI's main endpoint takes a CNPJ and returns the company's registration data in JSON, based on public data from Receita Federal (Brazil's tax authority).

  • Method and path: GET /{cnpj}
  • Base URL: https://api.cnpjapi.com.br
  • Parameter: only the 14 digits of the CNPJ, without punctuation (e.g.: 00776574000156). A masked value with . and / is not accepted in the path.
  • Authentication: API key in the Authorization header (see Authentication).

Example (curl)

curl https://api.cnpjapi.com.br/00776574000156 \
  -H "Authorization: Bearer cnpj_sua_chave"

Examples by language

Prefer copy-paste for your stack? The guides show the same endpoint with authentication and 429/Retry-After handling ready to go:

Want to try it without writing code? Open the Postman collection and run the calls in your browser (just add your key).

Response (200 OK, application/json)

{
  "CNPJ": "00776574000156",
  "RazaoSocial": "...",
  "NomeFantasia": "...",
  "MatrizFilial": { "Codigo": "1", "Descricao": "Matriz" },
  "Porte": { "Codigo": "05", "Descricao": "Demais" },
  "DataAbertura": "0000-00-00",
  "AtividadePrincipal": { "Codigo": "0000000", "Descricao": "..." },
  "AtividadesSecundarias": [ { "Codigo": "0000000", "Descricao": "..." } ],
  "NaturezaJuridica": { "Codigo": "0000", "Descricao": "..." },
  "SituacaoCadastral": { "Codigo": "02", "Descricao": "ATIVA", "Motivo": "...", "Data": "0000-00-00" },
  "SimplesNacional": "...",
  "Endereco": {
    "TipoLogradouro": "...", "Logradouro": "...", "Numero": "...",
    "Complemento": "...", "Bairro": "...", "CEP": "...", "Municipio": "...", "UF": "..."
  },
  "Municipio": { "SIAFI": "...", "IBGE": "...", "Nome": "..." },
  "Contato": { "DDD1": "...", "Telefone1": "...", "Email": "...", "DDD2": "...", "Telefone2": "..." },
  "QSA": [
    { "Nome": "...", "Tipo": "...", "CPFCNPJ": "...", "Qualificacao": "...", "DataEntradaSociedade": "0000-00-00", "FaixaEtaria": "..." }
  ],
  "CapitalSocial": 0,
  "UltimaAtualizacao": "0000-00-00",
  "EFR": "..."
}

Response fields

Field Description
CNPJ CNPJ looked up (14 digits)
RazaoSocial Legal name
NomeFantasia Trade name
SituacaoCadastral Registration status (Codigo, Descricao, Motivo, Data)
AtividadePrincipal Primary CNAE (Codigo, Descricao)
AtividadesSecundarias List of secondary CNAEs
NaturezaJuridica Legal nature (Codigo, Descricao)
Endereco Street type, street, number, complement, neighborhood, ZIP code, city, state
Municipio City (SIAFI, IBGE, Nome)
Contato Phone numbers and email, when available
QSA Shareholder structure: partners (Nome, Tipo, CPFCNPJ, Qualificacao, ...)
CapitalSocial Share capital
Porte / MatrizFilial / SimplesNacional Registration metadata

Looking up many CNPJs

On a paid plan? Look up up to 20 CNPJs in a single call with POST /consulta/lote - it counts as 1 request for the rate limit. Without a paid plan, or for one-off lookups, call GET /{cnpj} once per CNPJ, respecting your plan's limits (requests per minute and monthly quota). When exceeded, the API responds 429 with Retry-After - use that value to pause before continuing.

State Registration alongside (optional)

Need the State Registration (IE) together with the registration data? Add ?incluir=ie: the response gains an inscricoes_estaduais field (a list per state, from the official SEFAZ source). It is a premium feature: it requires a registered account (an anonymous call with ?incluir=ie gets a 401), spends IE quota/credit, and works in the native format only.

curl "https://api.cnpjapi.com.br/00776574000156?incluir=ie" \
  -H "Authorization: Bearer cnpj_sua_chave"
Field Description
inscricoes_estaduais List of registrations per state (uf, ie, indicador, situacao, tipo, ...). Use ?ie_uf=SP to target one state (1 credit); without it, a nationwide sweep (3 credits)
inscricoes_estaduais_erro Present only when the IE lookup failed: inscricoes_estaduais comes back null and this field carries the reason (e.g. indisponivel). In that case the IE is not charged

Full contract, fields and credits at Look up the State Registration.

ReceitaWS format

Already integrated with ReceitaWS? CNPJAPI also responds in its format, field by field - just use GET /v1/cnpj/{cnpj} or GET /{cnpj}?formato=receitaws. See ReceitaWS-compatible.

Next steps

Create your free account at https://app.cnpjapi.com.br and make your first lookup in minutes.