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
| Operation | Path | What it returns | Source |
|---|---|---|---|
| Lookup CNPJ | GET / | The registration of a CNPJ with its company data | Receita Federal |
| Lookup CEP | GET / | The address, type and status of a CEP | Correios 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_ without one.
Request
A request is treated as public when it meets two conditions:
- No key in the
Authorizationheader. 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
401API_.KEY_ MISSING
| Request | Result |
|---|---|
GET / | Accepted |
GET / | 401 API_ |
GET / | 401 API_ |
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"
}
} | Field | Content |
|---|---|
updatedAt | Date and time of the last update of the registration data from the Receita Federal |
taxId | The CNPJ looked up |
type | Establishment type: head office or branch |
status and statusDate | Registration status and its date |
incorporationDate | Opening date |
company | Data shared by all of the company’s establishments: legal name, share capital, legal nature, company size and the board of partners and administrators (partners) |
address | Registered address, with the municipality IBGE code |
phones and emails | Registered phones and e-mails |
primaryActivity and secondaryActivities | Primary 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"
} | Field | Content |
|---|---|
updatedAt | Date and time of the last update from the Correios |
code | The CEP looked up |
type | CEP type: a street, a whole locality or a single recipient, such as a building |
status | CEP status: ACTIVE or DEACTIVATED |
name | Recipient name, present in CEPs of a single recipient |
street, number, details and district | Street, number, address details and district, according to the CEP type |
city, state and municipality | Municipality, 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:
| Parameter | Value applied | Effect |
|---|---|---|
maxAge | 45d | Registration 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 |
expand | None | Tax regime (company.), state registrations (stateRegistry), SUFRAMA registrations (suframa) and address coordinates (address.) are left out of the response |
- The optional resources and the parameters that configure them are in CNPJ lookup in the API. The
maxAgerules 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. CompareupdatedAtwith 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_, 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
| Limit | Without a key | With a key |
|---|---|---|
| Requests per second | 5, per source IP address | The plan’s, per organization |
| Concurrent requests | 5, per source IP address | The 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
429RATE_orLIMIT_ EXCEEDED CONCURRENCY_. Slow down or reduce parallelism, and retry after a short wait.LIMIT_ EXCEEDED
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
| Status | Code | Cause | Action |
|---|---|---|---|
400 | REQUEST_ | Malformed CNPJ: with punctuation, with lowercase letters in an alphanumeric CNPJ or with invalid check digits | Send the 14 characters with no punctuation and uppercase letters |
400 | REQUEST_ | CEP without exactly 8 digits, such as 01310-100 or 1310100 | Send the 8 digits, with no hyphen and with leading zeros |
401 | API_ | URL with a query parameter, including one added by another tool | Remove the parameters or send a key |
401 | API_ | Operation without public access, such as Search CNPJ | Send a key |
401 | API_ or API_ | Authorization 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 access | Remove the header or use an active key |
404 | ESTABLISHMENT_ | CNPJ not registered with the Receita Federal, or outside cached data | Retry with a key to query the Receita Federal live |
404 | POSTAL_ | CEP does not exist | Check the CEP or find it by address in Search CEP, with a key |
429 | RATE_ | More than 5 requests per second from the same IP, those made with a key included | Spread requests over time |
429 | CONCURRENCY_ | More than 5 requests in progress from the same IP, those made with a key included | Reduce 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
Authorizationheader.
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 key | With a key | |
|---|---|---|
| Operations | Lookup CNPJ and Lookup CEP | All |
| Query parameters | None | All, such as maxAge and expand |
| CNPJs outside cached data | 404 ESTABLISHMENT_ | Live query at the Receita Federal |
| Usage limits | 5 per second and 5 concurrent, per IP | Those of the plan, per organization |
| Billing | None | According 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 - Create an account, as described in Sign up.
- Create a key in Settings > API keys, as described in Create a key.
- 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.