Migrate from CNPJá v1 to v2
How to replace each CNPJá API v1 operation with v2, using the same key: new paths, resources in expand, certificates in one PDF and cursor pagination.
The v1 API organizes lookups by source, with one operation for the Receita Federal, another for the Simples Nacional, another for the CCC and another for SUFRAMA, plus CNPJ lookup and search. In v2, a CNPJ’s data comes from Lookup CNPJ, with optional resources requested in expand, and the certificates come from a single operation. Every v2 detail is in the Reference.
Overview
- Paths gain the
/v2prefix and new names:/officebecomes/v2/,establishments /personbecomes/v2/andpeople /zipbecomes/v2/, on the same host and with the same API key.postal-codes - The standalone lookups
/rfb,/simples,/cccand/suframabecome resources of Lookup CNPJ, or of Lookup CPF when the document is a CPF. - The boolean parameters
simples,suframaandgeocodingand theregistrationslist becomeexpandvalues. maxAgenow takes a unit, such as45d, andstrategy,maxStaleandsyncare gone.- Fields are renamed:
idandtextbecomecodeandlabel, numeric codes become fixed-length strings, and booleans such asheadbecome codes, such asHEAD. - The four certificates become a single PDF from Issue CNPJ dossier, or from Issue CPF dossier for a CPF, with the documents chosen in
certificates. - Pagination replaces
token,nextandcountwithcursor,nextCursorandtotal.
Effort: medium. There is no new account, key or quota; the work is rewriting the calls and the field parsing, operation by operation.
Prerequisites
- Account and key: v1 and v2 use the same API keys, from the same organization. If you don’t have one yet, see First request.
- Authentication: same as v1. Send the key as the entire value of the
Authorizationheader, with no prefix:Authorization: YOUR_. WithAPI_ KEY Bearer, the request is rejected with401API_. See Authentication.KEY_ INVALID - Base URL:
https:/. v1 answers on the same host, without the version prefix./ api. cnpja. com/ v2 - What carries over: keys, organization, plan quotas and request limits. Both versions consume the same live and cached query quotas.
- Existing data: the list, person and company IDs from v1 are valid in v2. Lists created in v1 are the same ones Search lists returns.
- What changes: the paths, the parameters, the response format, the codes of classified values and how you track usage.
Matching operations
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
GET / | Lookup CNPJ | See CNPJ lookup. |
GET / | Search CNPJ | Filters renamed. See CNPJ search and lists. |
GET / | Render CNPJ map | See Location and maps. |
GET / | Render CNPJ street view | The path ends in street-view. v1 declared PNG; v2 returns a JPEG. |
GET / | Lookup company | Same CNPJ root, 8 characters. |
GET / | Lookup person | Same ID. See Partners and people. |
GET / | Search people | |
GET / | Lookup CNPJ | No expand. The CNPJ goes in the path, not in the taxId parameter. |
GET / | Issue CNPJ dossier | certificates=RFB_. See Certificates. |
GET / | Lookup CNPJ | expand=company.. See Tax regime. |
GET / | Issue CNPJ dossier | certificates=SIMPLES_. |
GET / with a CNPJ | Lookup CNPJ | expand=stateRegistry and stateRegistry.. |
GET / with a CPF | Lookup CPF | expand=stateRegistry and stateRegistry., required. |
GET / | Issue CNPJ dossier or Issue CPF dossier | certificates=CCC_. |
GET / with a CNPJ | Lookup CNPJ | expand=suframa. |
GET / with a CPF | Lookup CPF | expand=suframa. |
GET / | Issue CNPJ dossier or Issue CPF dossier | certificates=SUFRAMA_. |
GET / | Lookup CEP | See CEP and addresses. |
POST / | Create list | type and items become required. |
GET / | Search lists | |
GET / | Lookup list | |
PATCH / | Update list | |
DELETE / | Delete list | |
POST / and the export lookups | No equivalent | Already deprecated in v1. To read the CNPJs in a list, use Search CNPJ with lists.. |
GET / | No equivalent | Usage is shown in the app, under Usage. |
Request example
The main lookup, with Simples Nacional and state registrations.
CNPJá v1:
GET /office/37335118000180?simples=true®istrations=ORIGIN&maxAge=30 HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY CNPJá v2:
GET /v2/establishments/37335118000180?expand=company.taxRegime,stateRegistry&stateRegistry.states=ORIGIN&maxAge=30d HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY Parameters
Lookup CNPJ
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
taxId (path) | taxId (path) | 14-character CNPJ, without punctuation. |
maxAge | maxAge | An integer in days in v1, a string with a unit in v2: maxAge=45 becomes maxAge=45d. The default is still 45 days. v2 accepts 5m to 1y. |
strategy=CACHE_ or CACHE_ | maxAge | This is v2’s default behavior: cached data within maxAge, a live query beyond it, and 206 with the cached data if the live query fails. |
strategy=ONLINE | A small maxAge | v1 itself suggested maxAge=1. In v2, the smallest value is 5m. |
strategy=CACHE | No equivalent | Lookup CNPJ always queries live the resources older than maxAge, which goes up to 1y. |
maxStale | No equivalent | In v2, the 206 response carries the cached data of the resource whose live query failed. |
sync | No equivalent | v2 has no cost headers. |
simples=true | expand=company. | Simples Nacional and MEI opt-in, and the tax regime. |
simplesHistory=true | expand=company. and company. | The history comes in company.. |
registrations | expand=stateRegistry and stateRegistry. | Same values: ORIGIN, ALL or UF abbreviations. stateRegistry. defaults to ORIGIN. |
registrationsSource | No equivalent | v2 uses the CCC only. |
suframa=true | expand=suframa | |
geocoding=true | expand=address. | |
links | No equivalent | Call the certificate, map and street view operations directly, with a key. |
| No equivalent | stateRegistry. | Activity, address, sublimit and authorized tax documents of each registration. See State registrations. |
| No equivalent | company., stateRegistry., suframa. | A separate age limit for each resource. See Max age and partial success. |
Send multiple expand values comma-separated or by repeating the parameter. The rules are in Response expansion.
Standalone lookups and certificates
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
taxId (URL) in /rfb, /simples, /ccc, /suframa and the certificates | taxId (path) | In v2, the document is part of the path. CNPJs go in /v2/ and CPFs in /v2/. |
maxAge in /simples | company. | With a unit, such as 45d. Without it, maxAge applies. |
history in /simples | company. | |
states in /ccc | stateRegistry. | In Lookup CPF, the parameter is required and accepts ALL or state abbreviations, with no ORIGIN. |
maxAge in /ccc | stateRegistry. | With a unit. |
source in /ccc | No equivalent | v2 uses the CCC only. |
maxAge in /suframa | suframa. | With a unit. |
pages in /rfb/ | certificates | REGISTRATION becomes RFB_ and MEMBERS becomes RFB_. In v1 both pages were the default; in v2 certificates is required. |
state in /ccc/ | No equivalent | A CNPJ’s CCC certificate covers only the establishment’s own UF; a CPF’s covers a single UF with a known registration, which can’t be chosen. |
type in /office/ | type | Uppercase values: roadmap becomes ROADMAP, and likewise TERRAIN, SATELLITE and HYBRID. |
width, height, scale, zoom and fov | No equivalent | v2 images are 640 by 640 pixels, with fixed size and zoom. |
Search CNPJ
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
token | cursor | Sent alone, with no other parameter. |
limit | limit | 1 to 1000, default 10. |
names., names. | names., names. | Legal name or trade name. |
company., company. | company., company. | |
alias., alias. | tradeName., tradeName. | |
company., company. | company., company. | |
company., company. | company., company. | 4-character codes. |
company. | company. | 1 becomes MICRO, 3 becomes SMALL and 5 becomes OTHER. |
company. | company. | |
company. | company. with the other regimes | ACTUAL_, PRESUMED_, ARBITRATED_ and NOT_. |
company., company. | company., company. | |
company. | company. | |
company. | company. with the other regimes | ACTUAL_, PRESUMED_, ARBITRATED_, SIMPLES_, SIMPLES_ and NOT_. |
company., company. | company., company. | |
| No equivalent | company., company., company., company. | Start of the current period in the IBS and CBS regular regime. |
taxId. | lists. | List IDs. v2 also has lists., which restricts the search to the CNPJs in the lists. |
founded., founded. | incorporationDate., incorporationDate. | |
head. | type. | |
head. | type. | |
statusDate., statusDate. | statusDate., statusDate. | |
status. | status. | 1 becomes VOID, 2 becomes ACTIVE, 3 becomes SUSPENDED, 4 becomes NONCOMPLIANT and 8 becomes CLOSED. |
reason. | statusReason. | 2-character string: 1 becomes 01. |
specialDate., specialDate. | specialStatusDate., specialStatusDate. | |
special. | specialStatus. | 3-character string. |
address., address. | address., address. | |
address., address. | address., address. | |
address., address. | address., address. | |
address., address. | address., address. | |
address., address. | address., address. | 7-digit IBGE code. |
address. | address. | |
address., address., address. | address., address., address. | 8-digit CEP. |
address., address. | address., address. | Numeric M49 code in v1, 2-letter code in v2: 76 becomes BR. |
phones. | phones. | |
phones. | phones. | |
phones. | phones. | LANDLINE or MOBILE. |
phones., phones. | phones., phones. | 2-digit area code (DDD). |
phones., phones. | No equivalent | List the area codes in phones.. |
phones., phones. | phones., phones. | Number without the area code in v1, E.164 in v2, such as +5511971564144. |
emails. | emails. | |
emails. | emails. | |
emails. | emails. | ACCOUNTING and CORPORATE stay, and PERSONAL becomes CONSUMER. In v1, CORPORATE included the emails v2 classifies as ACADEMIC and GOVERNMENT; send CORPORATE,ACADEMIC,GOVERNMENT to keep the same results. |
emails., emails. | emails., emails. | |
emails., emails. | emails., emails. | |
activities., activities. | economicActivities., economicActivities. | 7-digit CNAE: 111301 becomes 0111301. |
mainActivity., mainActivity. | primaryActivity., primaryActivity. | |
sideActivities., sideActivities. | secondaryActivities., secondaryActivities. | |
| No equivalent | search | Free text across CNPJ, names, phones, emails and address. |
| No equivalent | sort, order | relevance, taxId, incorporationDate, company. or company., in ASC or DESC order. Without them, the order is the same as in v1. See Sorting. |
To combine company. and company., send a single company. with only the codes in both lists, such as SIMPLES_ for Simples Nacional optants that aren’t MEIs.
All filters are in Search filters.
Search people
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
token | cursor | |
limit | limit | |
type. | type. | LEGAL becomes ESTABLISHMENT, NATURAL becomes INDIVIDUAL, FOREIGN becomes FOREIGNER. UNKNOWN is never returned by the search. |
name. | search or legalName. | A full name goes in legalName., which compares the whole name; search requires every word. |
name. | legalName. | |
taxId. | taxId. | A CPF is still matched on its 4th to 9th digits. |
age. | ageGroup. | Same values, such as 31-40. |
country., country. | domicileCountry., domicileCountry. | M49 code in v1, 2-letter code in v2. |
| No equivalent | participations., participations. | Number of participations in companies. v1 returned only people with at least one participation; send participations. to keep that. |
| No equivalent | sort, order | relevance, legalName or participations. Without them, the order is the same as in v1. |
Lists
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
title | name | |
description | No equivalent | |
items in Create list | items | Required in v2, along with type=ESTABLISHMENT. |
query and limit in Create list | No equivalent | v2 doesn’t create lists from filters. Search with Search CNPJ and send the CNPJs in items. |
items in Update list | items with operation=REPLACE | In v1, items replaced the list’s CNPJs. v2 also accepts ADD and REMOVE. |
token, limit and search in Search lists | cursor, limit and search | In v2, search looks at the name only. |
| No equivalent | sort and order in Search lists | createdAt, updatedAt, name or size. Without them, the order is the same as in v1. |
Response fields
Paths with [] refer to each item of a list. The company., stateRegistry, suframa and address. fields appear only when the resource is requested in expand.
Identification and status
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
taxId | taxId | |
updated | updatedAt | Last update from the Receita Federal. |
alias | tradeName | |
founded | incorporationDate | |
head | type. | true becomes HEAD and false becomes BRANCH. |
statusDate | statusDate | |
status. | status. | 1 becomes VOID, 2 becomes ACTIVE, 3 becomes SUSPENDED, 4 becomes NONCOMPLIANT and 8 becomes CLOSED. |
status. | status. | |
reason. | statusReason. | A number in v1, a 2-character string in v2, such as 01. |
reason. | statusReason. | |
specialDate | specialStatusDate | |
special. | specialStatus. | 3-character string. |
special. | specialStatus. |
Address and contacts
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
address. | address. | |
address. | address. | |
address. | address. | |
address. | address. | |
address. | address. | |
address. | address. | |
address. | address. | |
address. | address. | A number in v1, a 7-digit string in v2. |
address. | address. | M49 code in v1, 2-letter code in v2: 76 becomes BR. |
address. | address. | |
address., address. | address., address. | With expand=address.. null when the address can’t be located. |
phones[]. | phones[]. | |
phones[]., phones[]. | phones[]. | Area code and number become a single E.164 string: 11 and 971564144 become +5511971564144. |
emails[]. | emails[]. | |
emails[]. | emails[]. | v2 also distinguishes ACADEMIC and GOVERNMENT, which v1 returned as CORPORATE. |
emails[]. | No equivalent | Extract the domain from emails[].. |
Activities
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
mainActivity. | primaryActivity. | A number in v1, a 7-digit string in v2. |
mainActivity. | primaryActivity. | |
sideActivities[]. | secondaryActivities[]. | 7-digit string. |
sideActivities[]. | secondaryActivities[]. |
Company and partners
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
company. | company. | CNPJ root, 8 characters. |
company. | company. | |
company. | company. | |
company. | company. | A number in v1, a 4-digit string in v2. |
company. | company. | |
company. | company. | 1 becomes MICRO, 3 becomes SMALL and 5 becomes OTHER. |
company. | No equivalent | Derive it from company.. |
company. | company. | |
company. | company. | company. holds BR for the União, the UF abbreviation or the municipality’s IBGE code. |
company. | company. | See Partners and people. |
company. | company. | |
company. | company. | 2-character string, such as 49. |
company. | company. | |
company. | company. | Same ID, used in Lookup person. |
company. | company. | LEGAL becomes ESTABLISHMENT, NATURAL becomes INDIVIDUAL, FOREIGN becomes FOREIGNER and UNKNOWN stays. |
company. | company. | |
company. | company. | Masked CPF or CNPJ. Absent in v1, null in v2 for FOREIGNER and UNKNOWN. |
company. | company. | Same values, such as 31-40. |
company. | company. | 2-letter code and the country name in label. Only for FOREIGN in v1; always present in v2. |
company. | company. | Same shape as person. |
company. | company. | code and label. |
Tax data
With expand=company.:
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
company. | company. | true matches SIMPLES_, SIMPLES_ or SIMPLES_. The other values are ACTUAL_, PRESUMED_, ARBITRATED_ and NOT_. |
company. | company. | Present only when type. is SIMPLES_, SIMPLES_ or SIMPLES_; v1 returned null in the other cases. |
company. | company. | true matches SIMPLES_. |
company. | company. | Present only when type. is SIMPLES_; v1 returned null in the other cases. |
| No equivalent | company., company. | Start of the current period in the IBS and CBS regular regime. Present only with company. and when type. is SIMPLES_, which marks Simples Nacional optants that also opted into the IBS or CBS regular regime. Either can be null. |
company. | company. with type. equal to SIMPLES_ | With company.. |
company. | company. with type. equal to SIMEI_ | With company.. The timeline also holds future events and periods under other regimes. |
history[]. | timeline[]. | |
history[]. | timeline[]. | |
history[]. | timeline[]. |
With expand=stateRegistry:
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
registrations[] | stateRegistry. | |
registrations[]. | stateRegistry. | |
registrations[]. | stateRegistry. | |
registrations[]. | stateRegistry. | |
registrations[]. | stateRegistry. | |
registrations[]. | stateRegistry. | 1, no restriction, becomes false; 2, blocked as recipient in the UF, becomes true. Interstate blocks are in stateRegistry.. |
registrations[]. | stateRegistry. | 1 becomes STATE_, 2 becomes TAX_, 3 becomes NON_, 4 becomes INTERSTATE_ and 5 becomes RURAL_. |
registrations[]. | stateRegistry. |
With expand=suframa:
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
suframa[] | suframa. | |
suframa[]. | suframa. | |
suframa[]. | suframa. | |
suframa[]. | suframa. | |
suframa[]. | suframa. | |
suframa[]. | suframa. | 1 becomes ACTIVE, 2 becomes INACTIVE, 3 becomes BLOCKED and 4 becomes CANCELLED. |
suframa[]. | suframa. | |
suframa[]. | Mapa dos Incentivos Fiscais | SUFRAMA stopped publishing each registration’s incentives in its public registry lookup and now points to this official spreadsheet, so v2 doesn’t return them. The criteria SUFRAMA applied are in Estimate incentives. |
Standalone lookups
The /rfb, /simples, /ccc and /suframa responses use the fields above in a different layout. In v2, everything is in the Lookup CNPJ or Lookup CPF response:
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
/rfb: name, equity, nature, size, jurisdiction | company., company., company., company., company. | The other /rfb fields follow the tables above. |
/rfb: members[] | company. | |
/simples: updated | company. | |
/simples: simples, simei | company. | As in the tax data table. |
/ccc: updated | stateRegistry. | |
/ccc: name | company. or, in Lookup CPF, legalName | |
/ccc: originState | address. | Lookup CNPJ only. |
/suframa: updated | suframa. | v1 returned one registration; v2 returns all of them. |
/suframa: number, since, approved, approvalDate, status | suframa. | As in the expand=suframa table. |
/suframa: incentives | Mapa dos Incentivos Fiscais | Like suframa[]. in the expand=suframa table. |
/suframa: name | company. or, in Lookup CPF, legalName | |
/suframa: head | type. | Lookup CNPJ only. |
/suframa: nature | company. | Lookup CNPJ only. |
/suframa: address, phones, emails | suframa., suframa., suframa. | Same v2 address, phone and email formats. |
/suframa: mainActivity, sideActivities | suframa., suframa. | |
/suframa: mainActivity., sideActivities[]. | No equivalent | Always true in the source. |
Company, person and CEP
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
/company: simples, simei | taxRegime | Always present in Lookup company, without regularIbsStartDate, regularCbsStartDate and timeline. |
/company: members[] | partners[] | |
/company: offices[] | establishments[] | Same identification and status fields, renamed as in the tables above. v2 also brings address and updatedAt. |
/company: offices[]. | establishments[]. | |
/person: type, name, age, country | type., legalName, ageGroup, domicileCountry | Same codes as partners. |
/person: membership[] | participations[] | |
/person: membership[]. | participations[]. | |
/person: membership[]., membership[]. | participations[]., participations[]. | |
/person: membership[]. | participations[]. | name becomes legalName, equity becomes shareCapital, nature becomes legalNature, size. becomes size. and jurisdiction becomes federativeEntity. |
/zip: updated | updatedAt | |
/zip: code, street, number, district, city, state | code, street, number, district, city, state | |
/zip: municipality | municipality | A number in v1, a 7-digit string in v2. |
| No equivalent | type, status, name, details | CEP type and status, and recipient data. See CEP and addresses. |
Lists and pagination
| CNPJá v1 | CNPJá v2 | Notes |
|---|---|---|
id | id | Same ID. |
title | name | |
created, updated | createdAt, updatedAt | |
size | size | |
description, query, limit | No equivalent | |
items in Lookup list | No equivalent | Lookup list doesn’t return the CNPJs. Use Search CNPJ with lists.. |
| No equivalent | type | Always ESTABLISHMENT. |
next | nextCursor | null on the last page. |
count | total | |
limit, records | limit, records |
Formats
- Codes become strings: CNAE, legal nature, partner role, status reason, special status and IBGE code come as fixed-length strings with leading zeros, never as numbers.
idandtextbecomecodeandlabel. Usecodein your logic;labelis for display only, follows the response language and may change without notice.- Countries drop the numeric M49 code and use the 2-letter code.
- Phones become a single E.164 string.
- A resource requested in
expandis always present, even when empty, and a resource you don’t request is absent.null, an empty list and a missing field mean different things.
See Response format.
Behavior differences
Freshness and caching
In v2, 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. Optional resources accept a limit of their own, such as stateRegistry.. v1 certificates used data up to 1 day old; in Issue CNPJ dossier and Issue CPF dossier the default is 45d, so send maxAge=1d to keep that behavior. 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.
Resources with no record
In v1, /suframa answered 404 when the document had no SUFRAMA registration. In v2, in Lookup CNPJ, expand=suframa returns an empty suframa., and expand=stateRegistry with no registrations returns an empty stateRegistry.. In Lookup CPF, a CPF with no registration in the queried sources returns 404 INDIVIDUAL_, as explained in SUFRAMA.
Errors
The v1 Reference doesn’t document the error format. In v2, every error body carries status, code, message and traceId. Handle errors by code, which is stable, and use message for display only. See Limits and errors.
Important: remove the v1 parameters that have no equivalent, such as
strategy,maxStale,sync,linksandregistrationsSource. In v2, an unknown parameter is rejected with400in operations that take query parameters.
Limits
Limits are the same in both versions. 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
v1 described usage in credits, with the balance at /credit and the cost in the cnpja-request-cost header. 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. Responses carry no cost headers: track usage under Usage. See Queries and quota, what each operation consumes in the Metering Rules and Pricing.
Pagination
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 client must send the first request again to get a new cursor. See Pagination.
Search terms
In v1, words separated by spaces had to appear together in the same establishment or person, and comma-separated terms were alternatives. In v2, some and none treat each word separately, and search requires every word, in any order. See CNPJ search and lists.
Public access
As in v1, Lookup CNPJ and Lookup CEP accept requests without a key, as long as the URL has no query parameters at all; any parameter results in 401 API_. These requests use the default values, such as maxAge=45d with no expand, are not billed and follow limits of their own, counted per source IP. See Public access.
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
- The credit balance (
/credit) and thecnpja-request-costheader. - List exports (
/list/), already deprecated in v1.{listId}/ export - Public file links (
links). strategy=CACHE,maxStale,sync,registrationsSourceandsource.- Image size, scale, zoom and field of view.
- The company size acronym (
size.) and the email domain (acronym emails[].).domain - State registration statuses
3and10and type9, and SUFRAMA status5. - List description, creation filters (
query) and limit (limit), and reading the CNPJs in Lookup list. - Area code ranges (
phones.andarea. gte phones.) in the CNPJ search.area. lte
Step by step
- List your integration’s v1 calls and find each one’s equivalent in the matching operations table.
- Keep the key and the
Authorizationheader; switch the path tohttps:/and the new names./ api. cnpja. com/ v2 - Merge the standalone lookups made for the same CNPJ into a single Lookup CNPJ call, requesting the resources in
expand. - Rewrite the parameters: add the unit to
maxAge, replace the booleans withexpandand remove the parameters with no equivalent. - Rewrite the field parsing with the tables above, converting numeric codes into
codeand phones into E.164. - Switch pagination to
cursorandnextCursor, and error handling tocode, with206treated as success. - Validate: with a key, compare both versions’ responses for a few CNPJs and check usage under Requests.
- Switch traffic and watch errors and usage over the first few days.