Skip to content
Public access: free CNPJ and CEP API, no key
API

Public access: free CNPJ and CEP API, no key

Look up CNPJs and CEPs in the API for free, with no key: accepted operations, request rules, default values, per-IP limits and when to use a key.

Tip: Concepts on this page: Data freshness: live and cached and Public access.

Public access allows two API operations to be used without an API key: Lookup CNPJ and Lookup CEP. Requests made this way are called public requests. They require no account or authentication header and are not charged, but they accept no query parameters and have usage limits of their own, counted per IP address.

Public access is a free courtesy, limited and revocable at any time, with no service level. It suits low-volume or low-criticality integrations, such as filling in an address from a CEP in a form, and its use is subject to the Terms of Use, including the acceptable use rules. The full technical specification is in Public access, in the Reference.

Operations with public access

OperationPathWhat it returnsSource
Lookup CNPJGET /v2/establishments/:taxIdThe registration of a CNPJ with its company dataReceita Federal
Lookup CEPGET /v2/postal-codes/:codeThe address, type and status of a CEPCorreios DNE

Every other operation, such as Lookup company, Search CNPJ, Search CEP, Lookup CPF, certificates, people and lists, requires an API key and gets 401 API_KEY_MISSING without one.

Request

A request is treated as public when it meets two conditions:

  • No key in the Authorization header. The header must be absent or empty. When it holds a key, the key is always validated, and the request follows the rules of a request with a key.
  • No query parameters. The URL holds only the operation path. Any parameter, including an unknown one or one added automatically by another tool, makes the request get 401 API_KEY_MISSING.
RequestResult
GET /v2/postal-codes/01310100Accepted
GET /v2/establishments/37335118000180?maxAge=1d401 API_KEY_MISSING
GET /v2/postal-codes/01310100?utm_source=site401 API_KEY_MISSING

On rejection, the error message names the rejected parameter; with several parameters, it names the first one. Headers are not query parameters: Accept-Language, which sets the language of label fields, and Accept-Encoding, which requests compression, are accepted as usual.

Lookup CNPJ

Send the CNPJ with 14 characters and no punctuation:

GET /v2/establishments/37335118000180 HTTP/1.1
Host: api.cnpja.com

The same request can be made from the browser’s address bar or from a terminal:

curl https://api.cnpja.com/v2/establishments/37335118000180

Response, abridged:

{
  "updatedAt": "2026-01-27T03:00:00.000Z",
  "taxId": "37335118000180",
  "tradeName": "Cnpja",
  "type": { "code": "HEAD", "label": "Matriz" },
  "status": { "code": "ACTIVE", "label": "Ativa" },
  "incorporationDate": "2020-06-05",
  "company": {
    "id": "37335118",
    "legalName": "CNPJA TECNOLOGIA LTDA"
  },
  "address": {
    "street": "Avenida Brigadeiro Faria Lima",
    "number": "2369",
    "district": "Jardim Paulistano",
    "city": "São Paulo",
    "state": "SP",
    "postalCode": "01452922"
  }
}
FieldContent
updatedAtDate and time of the last update of the registration data from the Receita Federal
taxIdThe CNPJ looked up
typeEstablishment type: head office or branch
status and statusDateRegistration status and its date
incorporationDateOpening date
companyData shared by all of the company’s establishments: legal name, share capital, legal nature, company size and the board of partners and administrators (partners)
addressRegistered address, with the municipality IBGE code
phones and emailsRegistered phones and e-mails
primaryActivity and secondaryActivitiesPrimary and secondary economic activities, identified by their CNAE code

The other fields and their codes are in CNPJ lookup in the API.

Lookup CEP

Send the CEP with 8 digits and no hyphen:

GET /v2/postal-codes/01452922 HTTP/1.1
Host: api.cnpja.com

Response, abridged:

{
  "updatedAt": "2026-01-27T03:00:00.000Z",
  "code": "01452922",
  "type": { "code": "LARGE_RECIPIENT", "label": "Grande Usuário" },
  "status": { "code": "ACTIVE", "label": "Ativo" },
  "name": "Edifício Barão de Iguatemi",
  "street": "Avenida Brigadeiro Faria Lima",
  "number": "2369",
  "district": "Jardim Paulistano",
  "city": "São Paulo",
  "state": "SP",
  "municipality": "3550308"
}
FieldContent
updatedAtDate and time of the last update from the Correios
codeThe CEP looked up
typeCEP type: a street, a whole locality or a single recipient, such as a building
statusCEP status: ACTIVE or DEACTIVATED
nameRecipient name, present in CEPs of a single recipient
street, number, details and districtStreet, number, address details and district, according to the CEP type
city, state and municipalityMunicipality, state and municipality IBGE code

CEP types and the rules of each field are in CEPs and addresses in the API.

In both operations, label fields hold display text that changes with the language. Base your logic on the code next to them, as explained in Codes and labels.

Default values

Since a public request accepts no parameters, it always uses each operation’s default values. On Lookup CNPJ:

ParameterValue appliedEffect
maxAge45dRegistration data comes from cached data when it is up to 45 days old. If it is older, the API first makes a live query at the Receita Federal, which can take a few seconds
expandNoneTax regime (company.taxRegime), state registrations (stateRegistry), SUFRAMA registrations (suframa) and address coordinates (address.coordinates) are left out of the response
  • The optional resources and the parameters that configure them are in CNPJ lookup in the API. The maxAge rules are in Max age and partial success.
  • If the live query fails and cached data exists, the response carries that data with status 206, a partial success that should be treated as success. Compare updatedAt with the age the integration accepts before using the data.

Lookup CEP has no query parameters and delivers cached data only, updated with each new DNE edition. A public response is the same as one made with a key.

CNPJs outside cached data

Without a key, Lookup CNPJ does not go to the Receita Federal for a CNPJ that is not in cached data yet, such as a CNPJ opened after the latest open data release and never queried live: the response is 404 ESTABLISHMENT_NOT_FOUND, even if the CNPJ exists. With a key, the same CNPJ is queried live at the Receita Federal. What goes into the cache is described in What is in the cache.

If your integration needs to find recently opened CNPJs, such as when registering a customer who has just opened a company, use an API key.

Usage limits

LimitWithout a keyWith a key
Requests per second5, per source IP addressThe plan’s, per organization
Concurrent requests5, per source IP addressThe plan’s, per organization
  • Counting per IP. Public requests do not count toward any organization’s limits. When requests leave from your server, all users of your application share that server IP’s limit, and the requests with a key leaving the same IP count toward it too, as Without a key explains.
  • With a key. The limit is that of the organization’s plan, shared by all of its keys, as shown in Usage limits.
  • Concurrent requests. Each request holds a slot until its response ends. CNPJ lookups that require a live query hold the slot longer.
  • Limit exceeded. The response is 429 RATE_LIMIT_EXCEEDED or CONCURRENCY_LIMIT_EXCEEDED. Slow down or reduce parallelism, and retry after a short wait.

Responses carry no limit headers and no Retry-After. The general rules and the retry strategy are in Limits and errors.

Billing

Public requests are not charged, consume no organization’s quota and do not appear in Settings > Requests or Settings > Usage. With a key, the same operations are charged according to the metering rules, under CNPJ lookup and Company, person and CEP lookup.

Frequent errors

StatusCodeCauseAction
400REQUEST_VALIDATION_FAILEDMalformed CNPJ: with punctuation, with lowercase letters in an alphanumeric CNPJ or with invalid check digitsSend the 14 characters with no punctuation and uppercase letters
400REQUEST_VALIDATION_FAILEDCEP without exactly 8 digits, such as 01310-100 or 1310100Send the 8 digits, with no hyphen and with leading zeros
401API_KEY_MISSINGURL with a query parameter, including one added by another toolRemove the parameters or send a key
401API_KEY_MISSINGOperation without public access, such as Search CNPJSend a key
401API_KEY_INVALID or API_KEY_REVOKEDAuthorization header with an invalid key, including one with a prefix such as Bearer, or a revoked key. The request does not fall back to public accessRemove the header or use an active key
404ESTABLISHMENT_NOT_FOUNDCNPJ not registered with the Receita Federal, or outside cached dataRetry with a key to query the Receita Federal live
404POSTAL_CODE_NOT_FOUNDCEP does not existCheck the CEP or find it by address in Search CEP, with a key
429RATE_LIMIT_EXCEEDEDMore than 5 requests per second from the same IP, those made with a key includedSpread requests over time
429CONCURRENCY_LIMIT_EXCEEDEDMore than 5 requests in progress from the same IP, those made with a key includedReduce parallelism

Important: a valid key in the header makes the request charged, even on operations with public access. To use public access, send the request without the Authorization header.

Other errors are in Limits and errors.

Using an API key

Use an API key when volume grows, when a rejection due to limits is not acceptable, when the integration needs recently opened CNPJs, or when it needs parameters or other operations.

Without a keyWith a key
OperationsLookup CNPJ and Lookup CEPAll
Query parametersNoneAll, such as maxAge and expand
CNPJs outside cached data404 ESTABLISHMENT_NOT_FOUNDLive query at the Receita Federal
Usage limits5 per second and 5 concurrent, per IPThose of the plan, per organization
BillingNoneAccording to the metering rules

The URL and the response format do not change: a request with a key only adds the Authorization header.

GET /v2/establishments/37335118000180 HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
  1. Create an account, as described in Sign up.
  2. Create a key in Settings > API keys, as described in Create a key.
  3. Send the key from your server, never from web pages or mobile apps, as explained in Authentication.

The step-by-step guide is in First request.

In the app

On the platform, anyone can search and open a CNPJ record or a CEP record without an account, with cached data, within the limit on use without an account. Refreshing live, issuing certificates and loading address imagery require belonging to an organization, as explained in Guests, accounts and organizations.

Notes

  • A public request’s response has the same format as a response with a key and can be handled by the same code.
  • Alphanumeric CNPJs are accepted in public requests, under the same format rules.
  • Using another max age, requesting optional resources or listing a company’s branches requires a key, as described in CNPJ lookup in the API.
  • A public request that requires a live query can take a few seconds. Set your HTTP client’s timeout above 60 seconds, the maximum duration of a request in the API.

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.