CNPJ lookup API, built on Federal Revenue open data
Send a CNPJ and get the legal name, registration status, activity, address and partners as standard JSON. It accepts the number with or without punctuation and already supports the new alphanumeric CNPJ.
Free plan with 20 lookups a month. No credit card.
Lookup result
- CNPJ
- 12.345.678/0001-95
- Legal name
- Empresa Exemplo Tecnologia Ltda
- Status
- Active
- Main activity
- 6201501
What a lookup returns
Public registry data, ready to vet a customer, a supplier or a partner.
- Identification
- CNPJ, legal name, trade name, legal nature and share capital, in the format the Federal Revenue uses.
- Registration status
- Active, closed, unfit or suspended, with the status date and the company opening date.
- Activities and size
- Main and secondary CNAE, company size, headquarters or branch, and the Simples Nacional and MEI enrollment, with dates.
- Address
- Street, number, complement, neighborhood, city, state and ZIP code of the registered headquarters, plus the company’s email and phones.
- Partners
- Name, qualification, type (individual, company or foreign), partially masked tax ID, age range and date of entry into the company for each partner or administrator.
- Data freshness
- The data reflects the Federal Revenue’s latest open data publication, up to 30 days old.
How a lookup works
- 1
Local validation
Before any search we check the format and the check digits. An invalid CNPJ returns a 400 error and costs no credit.
- 2
Fast answers
If the CNPJ was looked up recently, the answer comes back in milliseconds.
- 3
Federal Revenue open data
When needed, we query the CNPJ open data and return the result.
Ready for the alphanumeric CNPJ
Since July 2026 the Federal Revenue issues CNPJs with letters and numbers. BrazID already validates and looks up both formats, with no change to your integration.
12.ABC.345/01DE-35
- What the new format looks like
- 14 characters: the first 12 can be letters (A to Z) or digits, and the last 2 are always check digits. Example: 12.ABC.345/01DE-35.
- Official validation method
- We compute the check digits the way the Federal Revenue defines. The numeric CNPJ remains valid and is checked the same way.
- Flexible input
- With or without punctuation, uppercase or lowercase. The API normalizes before looking up, and the response returns the CNPJ without punctuation.
- Validate for free
- The POST /v1/validate route checks CPF and CNPJ, including the alphanumeric one, without spending a credit.
One call, one JSON
Authenticate with the x-api-key header and pass the CNPJ in the path, with or without punctuation.
Endpoint documentationcURL GET /v1/cnpj/12345678000195
Response
Lookup completed successfully.
CNPJ not found in the Federal Revenue registry.
What it costs
1 credit per successful lookup
Only a 200 response uses a credit. Invalid CNPJ (400), not found (404) and unavailability (503) are free.
Free sandbox
Sandbox keys (brz_test_) answer with test data and never charge your balance. Use them to integrate without spending credits.
Same balance as CPF
Plan credits work for CPF and CNPJ lookups. Past your allowance, overage follows your plan rules.
Where to use it
B2B customer signup
Fill in the legal name and address from the CNPJ and reject closed or unfit companies.
Supplier and partner vetting
Confirm the registration status and the partners before signing a contract.
Data enrichment
Update lead and customer databases with activity and location.
Frequently asked questions
Where does the CNPJ data come from?
From the CNPJ open data published by the Federal Revenue. It is not a real-time query to the Revenue system: the data reflects the latest publication, up to 30 days old.
Does the API accept the alphanumeric CNPJ?
Yes. Since July 2026 the Federal Revenue issues CNPJs with letters and numbers. Check digit validation and lookups work for both formats.
What happens if I send an invalid CNPJ?
The API answers 400 with the INVALID_CNPJ_FORMAT error, without querying any source and without spending a credit. To only check a number, POST /v1/validate is free.
Does the data include partners’ tax IDs, email or phone?
Only in part. We return name, qualification, age range, date of entry and the tax ID already partially masked by the Revenue (e.g. ***345856**). Full tax IDs, emails and phone numbers are not part of the response.
How much does each lookup cost?
Each 200 response uses 1 credit from your plan. The free plan includes 20 credits a month, no card needed. See the plans on the pricing page.
Vet companies without spreadsheets
Create your account, generate a sandbox key and run your first CNPJ lookup in minutes.
Free plan with 20 lookups a month. No credit card.