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
| Operation | Path | Input | Updates | Public access |
|---|---|---|---|---|
| Lookup CNPJ | GET / | CNPJ with 14 characters | Live query or cached data, depending on maxAge | Yes, without parameters |
| Lookup company | GET / | CNPJ root with 8 characters | Cached data only | No |
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_; for the root, the warning in Establishments of a company applies. In responses, taxId and company. 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 | Parameter | Location | Values | Default |
|---|---|---|---|
taxId | Path | CNPJ with 14 characters and valid check digits | Required |
maxAge | Query | Maximum age accepted for cached data, from 5m to 1y, such as 1d or 30d | 45d |
expand | Query | company., stateRegistry, suframa and address., separated by commas | None |
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 | Parameter | Location | Values |
|---|---|---|
id | Path | CNPJ 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" }
}
} | Field | Content |
|---|---|
updatedAt | Date and time of the last registration update from the Receita Federal |
taxId | The establishment’s CNPJ, with no punctuation |
incorporationDate | Opening date of the establishment |
type | Head office (HEAD) or branch (BRANCH) |
tradeName | Trade name or title of the establishment, or null |
status, statusDate | Registration status and its date, described in Registration status |
statusReason | Reason for the status, present when the establishment is not active |
specialStatus, specialStatusDate | Special status and its date, present when the active establishment falls under a specific legal regime |
address | Street (street), number, details (details), district (district), city (city), state (state), CEP (postalCode), municipality IBGE code (municipality) and country. With expand=address., it also includes coordinates |
phones | Phone numbers in the international E.164 format, such as +5511971564144, with a landline or mobile type |
emails | Email addresses, with the type of each one |
primaryActivity, secondaryActivities | Primary economic activity and secondary activities, with the 7-digit CNAE code and description |
company | Company data, in the following table |
stateRegistry, suframa | State registrations and SUFRAMA registrations, present only when requested in expand, described in Optional resources |
company field | Content |
|---|---|
id | CNPJ root |
legalName | Legal name |
shareCapital | Share capital, in reais |
legalNature | Legal nature, with its official 4-digit code |
size | Company size |
federativeEntity | Responsible federative entity, present when the legal nature is public administration |
partners | Board of partners and administrators, covered in Partners and people in the API |
taxRegime | Tax regime, present only with expand=company. |
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. | Status |
|---|---|
ACTIVE | Active (ativa) |
SUSPENDED | Suspended (suspensa) |
NONCOMPLIANT | Noncompliant (inapta) |
CLOSED | Closed (baixada) |
VOID | Void (nula) |
- When the establishment is not active,
statusReasongives the reason, such as01, extinction after voluntary liquidation. - An active establishment under a specific legal regime also has
specialStatusandspecialStatusDate, such as418, start of judicial recovery. For that reason, checkspecialStatustogether withstatus., as explained in Active is not enough.code - When every establishment of the company is
CLOSEDorVOID, the tax regime becomesNOT_, as described in Tax regime in the API.APPLICABLE - A CNPJ that is not registered returns
404ESTABLISHMENT_, 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 thisNOT_ FOUND 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 value | Content | Own parameters | Guide |
|---|---|---|---|
company. | The 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 history | company., company. | Tax regime in the API |
stateRegistry | State registrations, by default only in the establishment’s own state, and blocks on interstate tax documents | stateRegistry., stateRegistry., stateRegistry. | State registrations in the API |
suframa | SUFRAMA registrations, with number, status and approved project | suframa. | SUFRAMA in the API |
address. | Latitude and longitude of the address | None | Location 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 with400REQUEST_, andVALIDATION_ FAILED errorshas an item with the codeDEPENDENCIES. - Resource-specific limits, such as
stateRegistry., replacemaxAge maxAgefor that resource only, which lets you keep the registration data at the default and require a more recent resource.address.does not followcoordinates maxAge. - Requests without an API key do not accept
expandand return401API_, as explained in Public access.KEY_ MISSING
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
establishmentssummarizes 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’staxIdwith 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 inpartners. - 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
400REQUEST_, with no charge.VALIDATION_ FAILED
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:
| Field | Codes |
|---|---|
type. | HEAD head office, BRANCH branch |
company. | MICRO microenterprise, SMALL small company, OTHER others |
company. | ACTUAL_ actual profit, PRESUMED_ presumed profit, ARBITRATED_ arbitrated profit, SIMPLES_, SIMPLES_ Simples Nacional hybrid, SIMPLES_ SIMEI, NOT_ not applicable. See Tax regime in the API |
phones[]. | LANDLINE landline, MOBILE mobile |
emails[]. | ACADEMIC academic, ACCOUNTING accounting, CORPORATE corporate, CONSUMER consumer, GOVERNMENT government |
company. | BR 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:
| Field | Code format | Example |
|---|---|---|
company. | 4 digits | 2062, Sociedade Empresária Limitada (limited liability company) |
primaryActivity., secondaryActivities[]. | CNAE, 7 digits | 6311900 |
statusReason. | 2 digits | 01, extinction after voluntary liquidation |
specialStatus. | 3 digits | 418, 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:
| Data | Age limit |
|---|---|
| Establishment registration, company data and partners | maxAge |
company. | company. |
stateRegistry | stateRegistry. |
suframa | suframa. |
address. | Does 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
updatedAtwith the requested limit to know the age of the registration data returned. The tax regime, the state registrations and the SUFRAMA registrations have their ownupdatedAt;address.does not.coordinates
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
updatedAtof 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 withlatitudeandlongitudeset tonull. - 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.
| Code | Certificate | Content |
|---|---|---|
RFB_ | Comprovante de Inscrição no CNPJ, known as the cartão CNPJ | The establishment’s registration at the Receita Federal |
RFB_ | Quadro 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
| Status | Code | Cause | Action |
|---|---|---|---|
400 | REQUEST_ | CNPJ 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 format | Fix what errors points to |
401 | API_ | Request without a key with query parameters, such as expand or maxAge, or Lookup company without a key | Send an API key or, in Lookup CNPJ, remove the parameters |
401 | API_ | Incomplete key or key sent with a prefix, such as Bearer | Send the key with no prefix in the Authorization header |
402 | CACHED_, LIVE_ or OVERAGE_ | The organization’s quota or overage budget is used up. What each code means is in Error codes | Follow one of the ways out in Quota used up |
404 | ESTABLISHMENT_ | The CNPJ is not in the Receita Federal registry or, without a key, is not in cached data yet | Check the CNPJ and do not retry right away; without a key, send a key |
404 | COMPANY_ | The company is not in cached data yet | Check the ID or look up one of the company’s CNPJs with Lookup CNPJ and retry |
429 | RATE_, CONCURRENCY_ | Requests per second or concurrent requests limit reached | Lower 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.andcode specialStatuswith a shortmaxAgewhen 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=stateRegistryand a shortstateRegistry., as described in State registrations in the API.maxAge - Data enrichment: segment customers by CNAE, company size, share capital and tax regime, keeping the default
maxAgeto 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., as described in Location and maps in the API.coordinates - 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
expandfor each establishment. - The complete technical specification of each field is in the Reference, under Lookup CNPJ and Lookup company.