Skip to content
CNPJ lookup in the API
API · Features

CNPJ lookup in the API

Look up a CNPJ via the API for registration status, address, contacts, CNAE and partners, plus optional resources in expand and the company's branches.

Tip: Concepts on this page: Companies and establishments, Registration status, Alphanumeric CNPJ, Company profile, Phones and e-mails, Data sources and Data freshness.

Lookup CNPJ returns, in a single request, the Receita Federal registration of one CNPJ: registration status, address, contacts, economic activities and the company data, such as legal name, legal nature and partners. Optional resources, such as the tax regime and state registrations, are added on request. Lookup company complements the lookup with the company view and a summary of all of its establishments. To find CNPJs without knowing them, use CNPJ search; for low-volume lookups without an API key, see Public access.

The CNPJ identifies an establishment, and the 8-character root identifies the company, as explained in Companies and establishments. Most of the time, looking up the CNPJ is enough: the response already includes the company data under company. Look up the company when you need the list of establishments, as described in Establishments of a company.

Request

OperationPathInputUpdatesPublic access
Lookup CNPJGET /v2/establishments/{taxId}CNPJ with 14 charactersLive query or cached data, depending on maxAgeYes, without parameters
Lookup companyGET /v2/companies/{id}CNPJ root with 8 charactersCached data onlyNo

Send the CNPJ and the root with no punctuation, with the letters of an alphanumeric CNPJ in uppercase. A CNPJ in any other format, or with invalid check digits, is rejected with 400 REQUEST_VALIDATION_FAILED; for the root, the warning in Establishments of a company applies. In responses, taxId and company.id come in the same format, with no punctuation. The Accept-Language header sets the language of every label, as explained in Response format.

Lookup CNPJ

GET /v2/establishments/37335118000180 HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
ParameterLocationValuesDefault
taxIdPathCNPJ with 14 characters and valid check digitsRequired
maxAgeQueryMaximum age accepted for cached data, from 5m to 1y, such as 1d or 30d45d
expandQuerycompany.taxRegime, stateRegistry, suframa and address.coordinates, separated by commasNone

The expand resources and the parameters of each one are listed in Optional resources. A request without an API key is accepted only with no query parameters at all, so it always uses maxAge=45d without expand.

Lookup company

GET /v2/companies/37335118 HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
ParameterLocationValues
idPathCNPJ root, with exactly 8 characters

The operation has no query parameters: it accepts neither maxAge nor expand, and unrecognized names are ignored. It always requires an API key.

Response fields

Lookup CNPJ response, trimmed:

{
  "updatedAt": "2026-01-27T03:00:00.000Z",
  "taxId": "37335118000180",
  "incorporationDate": "2020-06-05",
  "type": { "code": "HEAD", "label": "Matriz" },
  "tradeName": "Cnpja",
  "status": { "code": "ACTIVE", "label": "Ativa" },
  "statusDate": "2020-06-05",
  "address": {
    "street": "Avenida Brigadeiro Faria Lima",
    "number": "2369",
    "district": "Jardim Paulistano",
    "city": "São Paulo",
    "state": "SP",
    "postalCode": "01452922",
    "municipality": "3550308",
    "country": { "code": "BR", "label": "Brasil" }
  },
  "phones": [{ "number": "+5511971564144", "type": { "code": "MOBILE", "label": "Celular" } }],
  "emails": [{ "address": "contato@cnpja.com", "type": { "code": "CORPORATE", "label": "Corporativo" } }],
  "primaryActivity": {
    "code": "6311900",
    "label": "Tratamento de dados, provedores de serviços de aplicação e serviços de hospedagem na internet"
  },
  "company": {
    "id": "37335118",
    "legalName": "CNPJA TECNOLOGIA LTDA",
    "shareCapital": 99999.99,
    "legalNature": { "code": "2062", "label": "Sociedade Empresária Limitada" },
    "size": { "code": "SMALL", "label": "Empresa de Pequeno Porte" }
  }
}
FieldContent
updatedAtDate and time of the last registration update from the Receita Federal
taxIdThe establishment’s CNPJ, with no punctuation
incorporationDateOpening date of the establishment
typeHead office (HEAD) or branch (BRANCH)
tradeNameTrade name or title of the establishment, or null
status, statusDateRegistration status and its date, described in Registration status
statusReasonReason for the status, present when the establishment is not active
specialStatus, specialStatusDateSpecial status and its date, present when the active establishment falls under a specific legal regime
addressStreet (street), number, details (details), district (district), city (city), state (state), CEP (postalCode), municipality IBGE code (municipality) and country. With expand=address.coordinates, it also includes coordinates
phonesPhone numbers in the international E.164 format, such as +5511971564144, with a landline or mobile type
emailsEmail addresses, with the type of each one
primaryActivity, secondaryActivitiesPrimary economic activity and secondary activities, with the 7-digit CNAE code and description
companyCompany data, in the following table
stateRegistry, suframaState registrations and SUFRAMA registrations, present only when requested in expand, described in Optional resources
company fieldContent
idCNPJ root
legalNameLegal name
shareCapitalShare capital, in reais
legalNatureLegal nature, with its official 4-digit code
sizeCompany size
federativeEntityResponsible federative entity, present when the legal nature is public administration
partnersBoard of partners and administrators, covered in Partners and people in the API
taxRegimeTax regime, present only with expand=company.taxRegime

Fields with no value in the registry, such as tradeName and parts of the address, come as null, and lists with no items, such as secondaryActivities, come empty. statusReason, specialStatus, specialStatusDate and federativeEntity, in turn, are absent when they do not apply. The general rules are in Response format.

The Lookup company response carries the company fields at the top level, with taxRegime always present, plus updatedAt, the last update from the Receita Federal, and establishments, described in Establishments of a company.

Registration status

The registration status of each establishment comes in status, with its date in statusDate. The meaning of each status, of the reason and of the special status is in Registration status.

status.codeStatus
ACTIVEActive (ativa)
SUSPENDEDSuspended (suspensa)
NONCOMPLIANTNoncompliant (inapta)
CLOSEDClosed (baixada)
VOIDVoid (nula)
  • When the establishment is not active, statusReason gives the reason, such as 01, extinction after voluntary liquidation.
  • An active establishment under a specific legal regime also has specialStatus and specialStatusDate, such as 418, start of judicial recovery. For that reason, check specialStatus together with status.code, as explained in Active is not enough.
  • When every establishment of the company is CLOSED or VOID, the tax regime becomes NOT_APPLICABLE, as described in Tax regime in the API.
  • A CNPJ that is not registered returns 404 ESTABLISHMENT_NOT_FOUND, once a live query at the Receita Federal confirms it. Without an API key, a CNPJ that is not in cached data yet is not queried live and also returns this 404, as explained in Public access.

Optional resources

Some data is left out of the default response, which keeps it faster and cheaper, because each resource comes from its own source, is charged separately and may need a live query. To include it, request each resource in the expand parameter. Each value is also the path of the field it adds to the response.

expand valueContentOwn parametersGuide
company.taxRegimeThe company’s tax regime, such as presumed profit, Simples Nacional, Simples Nacional hybrid or SIMEI, and, at the DETAILED level, the IBS and CBS regular regime start dates and the historycompany.taxRegime.view, company.taxRegime.maxAgeTax regime in the API
stateRegistryState registrations, by default only in the establishment’s own state, and blocks on interstate tax documentsstateRegistry.states, stateRegistry.view, stateRegistry.maxAgeState registrations in the API
suframaSUFRAMA registrations, with number, status and approved projectsuframa.maxAgeSUFRAMA in the API
address.coordinatesLatitude and longitude of the addressNoneLocation and maps in the API
GET /v2/establishments/37335118000180?expand=company.taxRegime,stateRegistry HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
  • Send several values separated by commas, as above, or by repeating the parameter: expand=company.taxRegime&expand=stateRegistry.
  • A requested resource is always present in the response, even with no data, for example as an empty list. A resource that is not requested is absent.
  • Each resource parameter is accepted only with the matching resource in expand. Without it, the request is rejected with 400 REQUEST_VALIDATION_FAILED, and errors has an item with the code DEPENDENCIES.
  • Resource-specific limits, such as stateRegistry.maxAge, replace maxAge for that resource only, which lets you keep the registration data at the default and require a more recent resource. address.coordinates does not follow maxAge.
  • Requests without an API key do not accept expand and return 401 API_KEY_MISSING, as explained in Public access.

The general rules are in Response expansion.

Tip: request only the resources you will use, with the narrowest options, such as the lower level of detail and only the states you need. Each extra resource adds to the cost and, when it needs a live query, to the response time.

Establishments of a company

Lookup company takes the CNPJ root and returns the company data with a summary of each of its establishments, in establishments. Trimmed response:

{
  "updatedAt": "2026-01-27T03:00:00.000Z",
  "id": "37335118",
  "legalName": "CNPJA TECNOLOGIA LTDA",
  "taxRegime": {
    "updatedAt": "2026-01-27T03:00:00.000Z",
    "type": { "code": "PRESUMED_PROFIT", "label": "Lucro Presumido" }
  },
  "establishments": [
    {
      "id": "e41db98e-2bd2-43ef-8729-7a3152caaa08",
      "taxId": "37335118000180",
      "type": { "code": "HEAD", "label": "Matriz" },
      "tradeName": "Cnpja",
      "status": { "code": "ACTIVE", "label": "Ativa" },
      "statusDate": "2020-06-05"
    }
  ]
}
  • Each item of establishments summarizes one establishment of the root: last update (updatedAt), internal identifier (id), CNPJ, opening date, type, trade name, registration status with reason and special status, address and primary activity. For phones, emails and secondary activities, look up the item’s taxId with Lookup CNPJ.
  • The response always includes the tax regime in taxRegime, without the IBS and CBS regular regime start dates or its history, and the board of partners in partners.
  • The operation uses cached data only. To refresh the company, or add it to cached data when it is not there yet, look up one of its CNPJs with Lookup CNPJ.
  • To filter the establishments, for example to active ones only, search for the root in CNPJ search.

Important: send exactly the first 8 characters of the CNPJ, with no punctuation and uppercase letters. The full CNPJ and an 8-character ID with lowercase letters or punctuation are rejected with 400 REQUEST_VALIDATION_FAILED, with no charge.

Codes and values

Base your logic on code. The label next to it is for display only and changes with the language, as explained in Response format. Besides the registration status, these fields have fixed codes:

FieldCodes
type.codeHEAD head office, BRANCH branch
company.size.codeMICRO microenterprise, SMALL small company, OTHER others
company.taxRegime.type.codeACTUAL_PROFIT actual profit, PRESUMED_PROFIT presumed profit, ARBITRATED_PROFIT arbitrated profit, SIMPLES_NACIONAL, SIMPLES_NACIONAL_HYBRID Simples Nacional hybrid, SIMPLES_NACIONAL_SIMEI SIMEI, NOT_APPLICABLE not applicable. See Tax regime in the API
phones[].type.codeLANDLINE landline, MOBILE mobile
emails[].type.codeACADEMIC academic, ACCOUNTING accounting, CORPORATE corporate, CONSUMER consumer, GOVERNMENT government
company.federativeEntity.codeBR for the Union, the state abbreviation for states and the Federal District, or the 7-digit IBGE code for municipalities

Other fields follow large official tables, also with code and label:

FieldCode formatExample
company.legalNature.code4 digits2062, Sociedade Empresária Limitada (limited liability company)
primaryActivity.code, secondaryActivities[].codeCNAE, 7 digits6311900
statusReason.code2 digits01, extinction after voluntary liquidation
specialStatus.code3 digits418, start of judicial recovery

What company size, legal nature, CNAE and federative entity mean is in Company profile; how CNPJá arrives at the phone and e-mail types, in Phones and e-mails. The partner role and type codes are listed in Partners and people in the API.

Sources and updates

The establishment registration, the company data and the partners come from the Receita Federal, and each optional resource comes from its own source, as shown in Data sources. Each part of the response follows an age limit:

DataAge limit
Establishment registration, company data and partnersmaxAge
company.taxRegimecompany.taxRegime.maxAge
stateRegistrystateRegistry.maxAge
suframasuframa.maxAge
address.coordinatesDoes not follow maxAge

In Lookup CNPJ, the age of the registration data counts from its most recent update, whether from open data or from a live query. Within maxAge, the registration data comes from cached data; if it is older, or if the CNPJ is not in cached data yet, it is queried live at the Receita Federal before the response. Each optional resource is checked the same way, against its own limit, and outdated resources are queried in parallel. Resources with rules of their own, such as state registrations and coordinates, are covered in Resources with their own rules.

  • A live query of the CNPJ also updates the company’s registration data and partners, which Lookup company and Search CNPJ then return.
  • Compare updatedAt with the requested limit to know the age of the registration data returned. The tax regime, the state registrations and the SUFRAMA registrations have their own updatedAt; address.coordinates does not.

The maxAge rules, including its syntax, are in Max age and partial success.

Partial success

Each live query has up to 30 seconds to complete. If the query of the registration data or of an optional resource fails or exceeds that time, the request continues and the response comes with status 206, a partial success:

  • The affected resource keeps its cached data, possibly older than the requested limit, and is not charged. The other resources are returned and charged normally.
  • The response does not say which resource failed: compare the updatedAt of the registration data and of each resource with the limit that applies to it and retry the request later. Coordinates that were never calculated come with latitude and longitude set to null.
  • On the first lookup of a CNPJ, with no cached data to fall back on, a failure at the Receita Federal makes the request fail instead of returning 206. Try again later.

Treat 206 as a success, as explained in Partial success (206).

Certificate

Two certificates put the Receita Federal registration on this page into a PDF, as of the date of the query, and are issued by Issue CNPJ dossier. They are not certidões and are not attested by CNPJá, as explained in What a certificate is not.

CodeCertificateContent
RFB_REGISTRATIONComprovante de Inscrição no CNPJ, known as the cartão CNPJThe establishment’s registration at the Receita Federal
RFB_PARTNERSQuadro de Sócios e Administradores (QSA)The company’s partners and administrators
GET /v2/establishments/37335118000180/dossier?certificates=RFB_REGISTRATION,RFB_PARTNERS HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
  • Both come from the same live query at the Receita Federal CNPJ registry and are updated together, including by the live queries of Lookup CNPJ. Open data does not update them, so they may need a live query even when Lookup CNPJ would respond from cache.
  • Each certificate follows the dossier’s maxAge, and the usage of each one is in the metering rules.

The other certificates and the dossier rules are in Certificates in the API.

Billing

Lookup CNPJ consumes queries for the registration data and for each resource requested in expand, each one live or cached depending on where the data comes from in the request, and Lookup company consumes cached queries only. The amounts, what is charged even without a result and what is not charged are in the metering rules, under Lookup CNPJ and Lookup company.

Frequent errors

StatusCodeCauseAction
400REQUEST_VALIDATION_FAILEDCNPJ in the wrong format or with invalid check digits, root with a length other than 8 characters, lowercase letters or punctuation in Lookup company, resource parameter without the resource in expand, or maxAge in the wrong formatFix what errors points to
401API_KEY_MISSINGRequest without a key with query parameters, such as expand or maxAge, or Lookup company without a keySend an API key or, in Lookup CNPJ, remove the parameters
401API_KEY_INVALIDIncomplete key or key sent with a prefix, such as BearerSend the key with no prefix in the Authorization header
402CACHED_QUERY_QUOTA_EXCEEDED, LIVE_QUERY_QUOTA_EXCEEDED or OVERAGE_BUDGET_EXCEEDEDThe organization’s quota or overage budget is used up. What each code means is in Error codesFollow one of the ways out in Quota used up
404ESTABLISHMENT_NOT_FOUNDThe CNPJ is not in the Receita Federal registry or, without a key, is not in cached data yetCheck the CNPJ and do not retry right away; without a key, send a key
404COMPANY_NOT_FOUNDThe company is not in cached data yetCheck the ID or look up one of the company’s CNPJs with Lookup CNPJ and retry
429RATE_LIMIT_EXCEEDED, CONCURRENCY_LIMIT_EXCEEDEDRequests per second or concurrent requests limit reachedLower the pace or the parallelism, as described in Limits and errors

The other errors and the error body format are in Limits and errors.

Use cases

  • Customer and supplier onboarding: fill in legal name, address and contacts from the CNPJ provided. At low volume, a lookup without a key is enough, as explained in Public access.
  • Support for customer and supplier checks: read status.code and specialStatus with a short maxAge when you need recent data. The API delivers the data and does not recommend decisions; what the registration status does not tell is in Active is not enough.
  • Support for invoicing: check the state registration with expand=stateRegistry and a short stateRegistry.maxAge, as described in State registrations in the API.
  • Data enrichment: segment customers by CNAE, company size, share capital and tax regime, keeping the default maxAge to lower cost and response time.
  • Group view: list a customer’s head office and branches with Lookup company and track the status of each establishment.
  • Partners: identify the partners and the other companies they take part in, in Partners and people in the API.
  • Maps: place establishments on a map with expand=address.coordinates, as described in Location and maps in the API.
  • Registration on file: keep the cartão CNPJ and the QSA as a PDF, which show the registration on the date of the query, as described in Certificate.

In the app

On the platform, the record page shows the same registration as Lookup CNPJ, with the source and age of each piece of data, and anyone can open it without an account. How to open a record is in Look up a CNPJ, and what each section shows, in The company record.

Notes

  • The CNPJ looked up defines the establishment: address, contacts, activities and status are its own, not the head office’s. For the head office data, look up its CNPJ, as explained in What belongs to the company and what to the establishment.
  • Address, contacts and activities come from the Receita Federal and may differ from those registered at the CCC or SUFRAMA, returned in the optional resources. Divergences between sources are covered in Data sources.
  • Lookup company does not return state registrations, SUFRAMA registrations or coordinates: use Lookup CNPJ with expand for each establishment.
  • The complete technical specification of each field is in the Reference, under Lookup CNPJ and Lookup company.

Informational content that may change without notice. It is not tax, accounting or legal advice, and CNPJá's terms and policies prevail over this page.