Migrate from CNPJ.ws
How to replace the CNPJ.ws commercial API with the CNPJá API: CNPJ and CNPJ root lookups, company search, SUFRAMA and the equivalent of each field.
This guide moves an integration with the CNPJ.ws commercial API to the CNPJá API. It covers the CNPJ lookup, the CNPJ root lookup, the company search and the SUFRAMA registration check, with the equivalent of each parameter and each response field.
Overview
- Authentication: the key goes alone in the
Authorizationheader, with noBearer. Thex_header and theapi_ token tokenURL parameter no longer exist. - Response format: fields have English names, the establishment sits at the root of the response and the company under
company. Classified values come as a stablecodeplus a displaylabel, including the registration status, the establishment type and the partner type, which CNPJ.ws returns as text only. - Tax data on demand: tax regime, state registrations and SUFRAMA registrations are optional resources, requested in
expandand billed separately. - Data age under your control: the
maxAgeparameter sets the maximum accepted age; older data is queried live at the official source during the request. - CNPJ root: Lookup company returns every establishment of the root in a single response, with a summary of each, without pagination.
- Search: results carry each establishment’s registration data, not just CNPJs, with operator-based filters and forward-only cursor pagination.
- SUFRAMA: checking a registration becomes
expand=suframaon Lookup CNPJ.
Effort: medium. Switching authentication and URLs is straightforward; most of the work is in mapping the response fields and the search filters.
Prerequisites
- Account and key: sign up and create a key in API keys. The walkthrough is in First request.
- Authentication: send the key as the entire value of the
Authorizationheader, with no prefix:Authorization: YOUR_. WithAPI_ KEY Bearer, the request is rejected with401API_. The key never goes in the URL. See Authentication.KEY_ INVALID - Base URL:
https:/./ api. cnpja. com/ v2 - What carries over: the 14-character CNPJ without punctuation, the 8-character root, dates as
YYYY-MM-DD, the 7-digit CNAE, the municipality’s 7-digit IBGE code, the partners’ masked CPF in the same format (***650245**) and the 4-digit legal nature code. - What changes: the CNPJ.ws token, the field names, page-number pagination, the state, city and country
idfields, the BACEN country code and text-only classified values.
Matching operations
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
GET / | Lookup CNPJ | Tax regime, state registrations and SUFRAMA are requested in expand. |
GET / | Lookup company | Every establishment in one response, with a summary of each in establishments[]. |
GET / | Search CNPJ | Each establishment’s registration data in records[]; operator-based filters. |
GET / with socio_ or socio_ | Search people | The person found lists the companies in participations[]. See Partners and people. |
POST / | Lookup CNPJ with expand=suframa | Compare the registration number in suframa.. |
GET / | No equivalent in the API | Track usage in Usage. |
GET / | No equivalent in the API | Create a key in API keys and revoke the old one. |
Request example
CNPJ.ws:
GET /cnpj/37335118000180 HTTP/1.1
Host: comercial.cnpj.ws
x_api_token: YOUR_TOKEN CNPJá:
GET /v2/establishments/37335118000180?expand=company.taxRegime,stateRegistry&stateRegistry.states=ALL HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY Without expand, the CNPJá response carries the registration, the company data and the partners. Request in expand only the resources your integration read from the CNPJ.ws response, as the tables below show. See CNPJ lookup.
Parameters
Authentication
| CNPJ.ws | CNPJá |
|---|---|
x_ header | Authorization header, with the key only |
Authorization: Bearer header | Authorization header, without Bearer |
token URL parameter | No equivalent |
CNPJ and root lookups
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
cnpj in the path | taxId in the Lookup CNPJ path | 14 characters; CNPJá also accepts the alphanumeric CNPJ, in uppercase. |
cnpj-raiz in the path | id in the Lookup company path | 8 characters. |
page on /cnpj-raiz | No equivalent | Lookup company returns every establishment at once. |
/cnpj-raiz filters named in filtros_ and filtros_: nome_, pais_, estado_, cidade_, atividade_, tipo | No equivalent | Filter establishments[] by tradeName, address., address., address., primaryActivity. and type.. |
| No equivalent | maxAge | Maximum data age, default 45d. See Max age and partial success. |
| No equivalent | expand | company., stateRegistry, suframa and address.. |
Search
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
cursor | cursor | Send nextCursor alone, with no other parameter. |
limite or limit | limit | From 1 to 1000, default 10. |
atividade_ | primaryActivity. | 7-digit CNAE. |
atividade_ | secondaryActivities. | 7-digit CNAE. |
atividade_ | economicActivities. | Primary or secondary activity. |
natureza_ | company. | 4 digits. |
razao_ | company. | Each word counts on its own; to require every word, use search. |
nome_ | tradeName. | names. searches the legal name or the trade name. |
pais_ | address. | Alpha-2 code, such as BR, instead of the BACEN code. |
estado_ | address. | UF abbreviation, such as SP, instead of the state’s IBGE code. |
cidade_ | address. | 7-digit IBGE code. |
cep | address. | 8 digits; address. and .lte form a range. |
situacao_ | status. | ACTIVE, CLOSED, NONCOMPLIANT, VOID, SUSPENDED. |
data_ and _ate | statusDate. and statusDate. | Closed range. |
porte_ | company. | 01 becomes MICRO and 03 becomes SMALL; 00 and 05 fall under OTHER. |
socio_ | No equivalent in Search CNPJ | Use search or legalName. in Search people. |
socio_ | No equivalent in Search CNPJ | Use taxId. in Search people. A CPF is matched on its fourth to ninth digits and can match other people with the same digits. |
data_ and _ate | incorporationDate. and incorporationDate. | Closed range. |
token | No equivalent | The key goes in the header. |
| No equivalent | sort and order | relevance by default, or taxId, incorporationDate, company. or company., in ASC or DESC order. See Sorting. |
CNPJá has more filters, such as share capital, tax regime, phones, emails and CNPJ lists. See CNPJ search and lists and Search filters.
SUFRAMA check
| CNPJ.ws | CNPJá |
|---|---|
cnpj in the body | taxId in the Lookup CNPJ path, with expand=suframa |
inscricao in the body | No equivalent: look for the number in suframa. |
Response fields
CNPJ.ws paths starting with estabelecimento. come from inside the estabelecimento object. In CNPJá, the establishment sits at the root of the Lookup CNPJ response.
Identification and status
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
estabelecimento. | taxId | |
cnpj_, estabelecimento. | company. | |
estabelecimento. | No equivalent | Characters 9 to 12 of taxId. |
estabelecimento. | No equivalent | Characters 13 and 14 of taxId. |
estabelecimento. | type. and type. | HEAD head office, BRANCH branch. |
estabelecimento. | tradeName | |
estabelecimento. | incorporationDate | |
estabelecimento. | status. and status. | Ativa becomes ACTIVE, Baixada becomes CLOSED, Inapta becomes NONCOMPLIANT, Nula becomes VOID, Suspensa becomes SUSPENDED. |
estabelecimento. | statusDate | |
estabelecimento. | statusReason. and statusReason. | 2-digit code; present only when not active. |
estabelecimento. | specialStatus. and specialStatus. | 3-digit code; present only for active establishments with a special status. |
estabelecimento. | specialStatusDate | Same condition as specialStatus. |
estabelecimento. | updatedAt | Last update from the Receita Federal. |
Address and contacts
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
estabelecimento. and estabelecimento. | address. | The street type comes with the name, as in Avenida Brigadeiro Faria Lima. |
estabelecimento. | address. | |
estabelecimento. | address. | |
estabelecimento. | address. | |
estabelecimento. | address. | 8 digits. |
estabelecimento. | address. | |
estabelecimento. | address. | 7-digit string, not a number. |
estabelecimento., estabelecimento. | No equivalent | |
estabelecimento. | address. | For establishments abroad. |
estabelecimento. | address. | |
estabelecimento., estabelecimento., estabelecimento. | No equivalent | |
estabelecimento. | address. | |
estabelecimento. | address. | |
estabelecimento., estabelecimento., estabelecimento. | No equivalent | |
estabelecimento. and estabelecimento., estabelecimento. and estabelecimento. | phones[]. | One item per phone, in E.164 with the area code: +5511900000000. The type is in phones[].: LANDLINE or MOBILE. |
estabelecimento. and estabelecimento. | No equivalent | |
estabelecimento. | emails[]. | A list of emails, each with its type in emails[].. |
| No equivalent | address. | Latitude and longitude with expand=address.. See Location and maps. |
Activities
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
estabelecimento. | primaryActivity. | 7-digit CNAE. |
estabelecimento. | primaryActivity. | |
estabelecimento. | secondaryActivities[]. | |
estabelecimento. | secondaryActivities[]. | |
Activity secao, divisao, grupo, classe and subclasse | No equivalent |
Company and partners
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
razao_ | company. | |
capital_ | company. | A number, not a string: 99999.. |
porte. and porte. | company. and company. | 01 becomes MICRO, 03 becomes SMALL, the rest become OTHER. |
natureza_ and natureza_ | company. and company. | Same 4-digit code. |
responsavel_ | company. and company. | Object present only for public-administration legal natures: BR for the federal government, the UF abbreviation or the municipality’s IBGE code. |
qualificacao_ | No equivalent | |
atualizado_ | updatedAt | CNPJá has an update date for the establishment, not for the company. |
socios[] | company. | Details in Partners and people. |
socios[]. | company. | |
socios[]. | company. | Masked CPF or CNPJ; null for foreigners and for partners known only by name. |
socios[]. | company. and .label | Pessoa Física becomes INDIVIDUAL; also ESTABLISHMENT, FOREIGNER and UNKNOWN. |
socios[]. | company. | |
socios[]. | company. | 41 a 50 anos becomes 41-50; no label. |
socios[]. | company. | A 2-digit string, not a number: 5 becomes 05. |
socios[]. | company. | |
socios[]. | company. | |
socios[]. | company. | |
socios[]., socios[]., socios[]., socios[]. | No equivalent | |
socios[]. | company. | In CNPJá, legalRepresentative appears only when there is a representative. |
socios[]. | company. | |
socios[]. | company. and .label | |
socios[]. | No equivalent | |
| No equivalent | company. | The person’s CNPJá ID, used in Lookup person. |
Tax data
These fields require expand. The tax regime comes with expand=company., state registrations with expand=stateRegistry and SUFRAMA registrations with expand=suframa. See Tax regime, State registrations and SUFRAMA.
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
simples. | company. | Simples Nacional optants come as SIMPLES_, as SIMPLES_ when they also opt into the IBS or CBS regular regime or, for MEIs, as SIMPLES_. |
simples. | company. | Start of the current Simples Nacional period. Present only when type. is SIMPLES_, SIMPLES_ or SIMPLES_, and may be null. |
simples. | company. | MEIs come as SIMPLES_. |
simples. | company. | Start of the current SIMEI period. Present only when type. is SIMPLES_, and may be null. |
simples., simples. | company. | With company., in the SIMPLES_ and SIMEI_ items. An exclusion with a future date comes in startDate, in the SIMPLES_ and SIMEI_ items. |
simples. | company. | |
estabelecimento. | company. | With company. on Lookup CNPJ. CNPJ.ws returns one row per year; CNPJá returns periods with a start and an end. Actual, presumed and arbitrated profit have one period per calendar year declared in the ECF, and Simples Nacional, SIMEI and the IBS and CBS regular regime have periods of any length. See Regime history. |
estabelecimento. | company. and company. | In ECF periods, from January 1 to December 31 of the calendar year. |
estabelecimento. | company. | LUCRO REAL becomes ACTUAL_; also PRESUMED_, ARBITRATED_, SIMPLES_, SIMEI_, REGULAR_ and REGULAR_. IMUNES E ISENTAS has no equivalent. The current regime is in company.: ACTUAL_, PRESUMED_, ARBITRATED_, SIMPLES_, SIMPLES_, SIMPLES_ or NOT_. |
estabelecimento. | company. | The period type already states the taxation method, with no separate field. |
estabelecimento. | company. | One date for the whole tax regime, not per year. |
estabelecimento. | stateRegistry. | By default only the establishment’s UF; for every UF, send stateRegistry.. |
estabelecimento. | stateRegistry. | |
estabelecimento. | stateRegistry. | Registration enabled as a taxpayer. |
estabelecimento. | stateRegistry. | |
estabelecimento. | stateRegistry. | |
estabelecimento. | suframa. | The registration’s number, status, dates, address and activities. |
When company. is SIMPLES_, company. also returns company. and company., the start of the current IBS and CBS regular regime periods, which come only from live queries at the Simples Nacional. Either may be null when the company opts into only one of the two.
CNPJá also returns in stateRegistry each registration’s type, the recipient restriction and the interstate blocks, and with stateRegistry. the activity, the address and the authorized tax documents.
CNPJ root
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
data[] | establishments[]. | Each establishments[] item also carries type, trade name, status, address and primary activity. |
paginacao | No equivalent | No pagination. |
ordenacao, filtros_, filtros_ | No equivalent |
Lookup company also returns the company data, the partners in partners[] and the tax regime in taxRegime, always present and without the history or the IBS and CBS regular regime dates.
Search
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
data[] | records[]. | Each record carries the establishment’s registration data, the company, the partners and the tax regime without the history or the IBS and CBS regular regime dates. |
paginacao. | limit | |
paginacao. | total | May vary between pages. |
paginacao. | nextCursor | null on the last page. |
paginacao. | nextCursor other than null | |
paginacao., paginacao., paginacao., paginacao. | No equivalent | Pagination only moves forward. |
filtros_, filtros_ | No equivalent |
SUFRAMA check
| CNPJ.ws | CNPJá | Notes |
|---|---|---|
cnpj_ | company. | |
cnpj | taxId | |
inscricao_ | suframa. | |
ativo | suframa. | ACTIVE, INACTIVE, BLOCKED or CANCELLED. |
atualizado_ | suframa. |
Formats
- Classified values come as
codeandlabel. Use thecodein logic and thelabelonly for display, since it changes with the language. See Response format. - Numbers are numbers:
company.is not a string. Codes are strings without punctuation, including the municipality’s IBGE code and the partner role.shareCapital - Phones come in E.164, with
+55and the area code in the same value. - A resource requested in
expandis always present, even when empty; a resource you don’t request is absent.
Behavior differences
Freshness and caching
The CNPJ.ws documentation states that its lookup and search use the service’s own database, which can lag up to 45 days behind the Receita Federal. In CNPJá, each resource comes from the cache while it is within maxAge and is queried live, before the response, when it is older or was never fetched. maxAge ranges from 5m to 1y, with a 45d default, and each resource reports its last update in its own updatedAt. Lookup company and Search CNPJ don’t accept maxAge and serve cached data only. See Max age and partial success.
Partial success
When a live query fails or runs past its time limit, the response is 206, with the same shape as 200: the affected resource keeps its cached data, or comes back empty if it was never fetched, and is not billed. With no cached data to fall back on, such as on a CNPJ’s first lookup, the request fails instead of returning 206. Treat 206 as success and compare each resource’s updatedAt with the limit you asked for. See Partial success.
Errors
The CNPJ.ws documentation lists the 401, 404 and 429 statuses on the lookups and the SUFRAMA check, and 400, 401, 403 and 429 on the search. In CNPJá, every error body carries status, code, message and traceId. Handle errors by code, which is stable, such as ESTABLISHMENT_ or COMPANY_, and use message for display only. See Limits and errors.
Limits
The CNPJ.ws commercial API serves up to 500 requests per minute per subscription. In CNPJá, with a key, the requests-per-second and concurrent-request limits apply to the whole organization, across all of its keys, and follow its plan; without a key, they apply to each source IP. The values are in Usage limits. Above them, the response is 429, not billed. Each request has a maximum duration, and the client timeout must stay above it, as shown in Timeout and size.
Billing
Each resource in the response is billed separately, as a live query, which costs more, or a cached query, and each unit has its own quota in the plan, renewed every month. On Pro, the quota of each unit can grow with packs, and the organization can set a budget to pay for each query beyond the quota at the per-query overage price, so an exhausted quota does not have to stop the integration. When a quota runs out with no overage budget, or the month’s budget runs out, every request made with one of the organization’s keys gets 402, as explained in Quota used up; on Free, which has no packs or budget, this happens as soon as the quota runs out. Requests without a key, rejected requests and server failures are not billed, as listed in What is not charged. On Lookup CNPJ, the registration and each resource requested in expand count separately, and Search CNPJ and Lookup company consume cached queries. Responses carry no cost headers: track usage under Usage. See Queries and quota, what each operation consumes in the Metering Rules and Pricing.
Pagination
Search CNPJ uses a cursor like CNPJ.ws, but forward only. Send each page’s nextCursor as cursor, on its own, without repeating filters or limit, until nextCursor comes back null. The cursor keeps the filters, sort, order and limit of the first request and is valid for a set time between one page and the next, given in Timeout and size; once expired, the response is 400 PAGE_ and the search starts over. Drop duplicates by taxId. See Pagination.
Important:
cursormust be the request’s only parameter. With any other, includinglimit, CNPJá returns400REQUEST_.VALIDATION_ FAILED
Language and labels
label values and error messages come in Portuguese by default; send Accept-Language: en-US to get them in English. Codes, field names and official source data are never translated. Use code in your logic and label for display only. See Language.
No equivalent
- Checking monthly request usage through the API. Track usage in Usage and Requests.
- Renewing the token through the API. Create and revoke keys in API keys.
- A dedicated SUFRAMA check call, with the registration number in the body.
- Page-number pagination on the CNPJ root and the previous page on the search.
- Partner filters inside the company search.
- The list of available and applied filters in the response.
- The state, city and country
idfields, the SIAFI code, the BACEN code and the country’s ISO alpha-3. - The CNAE hierarchy in section, division, group, class and subclass.
- Years with the
IMUNES E ISENTASregime inregimes_.tributarios - The fax and the responsible person’s role.
Step by step
- Create the account and an API key, as in First request.
- Switch authentication: send the key alone in the
Authorizationheader and removetokenfrom the URLs. - Switch the URLs:
/cnpj/to{cnpj} /v2/,establishments/ {taxId} /cnpj-raiz/to{cnpj-raiz} /v2/andcompanies/ {id} /v2/topesquisa /v2/.establishments - Set each call’s
expandto match the tax fields you use, andmaxAgeto match the data age you accept. - Rewrite the field mapping with the tables above, converting text descriptions into
codevalues. - On the CNPJ root, remove the page loop and filter
establishments[]in your code. - On the search, convert the filters, send
cursoralone and read the data straight fromrecords[]. - For the SUFRAMA check, use
expand=suframaand compare the number insuframa..registrations[]. number - Handle errors by
code, accept206as success and retry429,500and504with backoff. - Validate the integration with the key. Lookup CNPJ also accepts requests without a key and with no parameters in the URL, as in Public access;
expand, searches and Lookup company require the key. - Compare the responses for a sample of CNPJs between both integrations, track usage in Usage and then switch traffic.
Sources for this comparison
What this page says about CNPJ.ws comes from its public documentation:
- Overview: the response structure and the data lag.
- Public API reference: the lookup and the SUFRAMA validation without a token.
- Commercial API reference: authentication, the lookup, the paginated root, the search, the SUFRAMA validation, the monthly usage, the token renewal and the per-minute limit.
- Data models: the company, partner, Simples Nacional and tax regime fields.
- Establishments: the establishment fields.
- Error messages: the errors.
Sources accessed on November 19, 2026.
Third-party trademarks on this page are used only to identify them, with no affiliation or endorsement (Terms of Use).