A reliable partner for years, responsive, efficient, and high-quality.
CNPJ API: Brazilian business register data in one REST call
Brazil publishes no official CNPJ REST API. Developers scrape a captcha page or wrangle 7GB monthly dumps. CompanyData gives you 29 million Brazilian businesses live, deduplicated on active status, with employees and financials, in one REST API.
What is the CNPJ API?
The CNPJ is Brazil's Cadastro Nacional da Pessoa Jurídica, run by the Receita Federal. It identifies every establishment with a 14-character number: an 8-character root, a 4-character branch order where 0001 is the head office, and two mod-11 check digits. The catch is that there is no official public REST API. Receita Federal offers a captcha-gated web lookup, free monthly open-data dumps of roughly 7GB, and a paid Serpro contract that needs an e-CNPJ certificate.
Every 'CNPJ API' most developers reach for is a third party re-serving that monthly dump, so it lags the register by up to a month and still carries the roughly 60% of rows that are struck off. The open data does include phone, email and nome fantasia, but no employees and no financials. CompanyData starts from the same source, filters to active establishments, adds employees and structured financials, and serves it in one API that also covers 200+ other countries.
The official CNPJ, in short
- Free monthly open-data dumps on dados.gov.br, plus a captcha-gated web lookup
- Open data carries phone, email and nome fantasia as first-class fields
- No official public REST API; the dumps are ~7GB, Latin-1 and semicolon-delimited
- Roughly 60% of rows are struck off, so you must filter on situação cadastral
- No employee counts and no financials; porte is a revenue band, not headcount
- One country, and the alphanumeric CNPJ live since 31 July 2026 breaks digit-only checks
Look up any Brazilian business
Register fields plus the enrichment layer, in one response. Pick a business, you need no key for the example.
- Official CNAE codes on every record
- Phone, email and website where available
- The same request in 200+ countries
CNPJ open data and CompanyData, field by field
The CNPJ dumps cover registration well. CompanyData delivers 50+ enriched fields per Brazilian business in one call, filtered to active establishments.
| Data point | Official register | CompanyData API |
|---|---|---|
| Businesses in the file | 28,008,325 | 29,320,367 |
| CNPJ number | 29,301,670 | 29,319,345 |
| Registered address | 29,302,266 | 29,320,232 |
| Name and nome fantasia | ✓ | ✓ |
| CNAE activity code | ✓ | ✓ |
| Legal form | ✓ | ✓ |
| Website | ✗ | 2,603,837 |
| Phone | 8,059,437 | 8,062,142 |
| Mobile | ✗ | 18,204,712 |
| Business email | 1,320,450 | 1,320,901 |
| Partners or directors | ✗ QSA only, CPF masked | 19,602,743 |
| Employees | ✗ porte is a revenue band | ✓ Structured fields |
| Revenue and financials | ✗ capital social only | ✓ Structured fields |
| International records | ✗ | 365m worldwide |
Our column counts every registered entity we hold for this country, active or inactive. Some registers only serve active entities through their API, which we think is a gap: a holding or a trust can be dormant and still matter as an entity, so we keep it. Measured live in our own file, August 2026, and refreshed monthly. Register figure: CNPJ establishments with situação ATIVA, 31 July 2026. Of the 72.6 million on file, 34.2 million are baixada.
Search and filter
The CNPJ dumps are ~7GB Latin-1 CSVs with no header row, and the community APIs re-serve them one record at a time. CompanyData lays segmentation on top: filter on CNAE, revenue, headcount, state or city, and export in bulk with enrichment included.
Price
The dumps are free but you carry the ETL, the Latin-1 decoding and the struck-off rows yourself, or you pay Serpro per contract. CompanyData starts at $0.02 per credit, with 150 free calls in your first week and one API for 200+ countries.
More fields than the dump hands back
Employees, financials and clean contact data, one lookup further. Defaults to Brazil, switch country whenever you like.
Wiring up Brazil's open CNPJ data yourself
There is no REST API, so the honest path is the monthly dump. Here is how to get it in three steps, and the six things that cost small teams the most time, whether you enrich with us or not.
Download the monthly dump
The full CNPJ open data lives on dados.gov.br. It is roughly 7GB zipped, split across establishment, business and partner files, refreshed once a month.
Decode Latin-1 and load
The CSVs are Latin-1 encoded, semicolon-delimited, quoted and carry no header row. Decode before you load or every accented name breaks.
Filter to active establishments
Roughly 60% of rows are struck off. Filter on situação cadastral = 2 (Ativa) before you match anything against your own data.
Honest take: the open CNPJ data is fine if you have the engineering time to decode 7GB of Latin-1 every month and only need what the register self-declares. If you want live data, employees, financials or international coverage, you end up with us.
Get your API keyThe alphanumeric CNPJ is live
Since 31 July 2026, positions 1 to 12 may be A-Z or 0-9. The check digits stay numeric, computed on ASCII minus 48. Any ^\d{14}$ validation is already wrong.
One row per establishment, not per business
The 4-character branch order after the root is the key: 0001 is the head office, higher numbers are branches. Deduplicate on the root if you want one row per business.
Filter on situação cadastral
Roughly 60% of rows are struck off. Situação cadastral = 2 means Ativa. Skip this and your match rate looks fine but your data is full of dead establishments.
porte is a band, not a headcount
The porte field is a revenue band, and capital social is registered capital only. Neither is an employee count and neither is a filed financial statement.
The dumps are Latin-1
The RFB CSVs are Latin-1, semicolon-delimited and unheadered. Community APIs re-serve them as UTF-8, but they lag the register by up to a month.
The download moved in 2026
RFB relocated the files to a Nextcloud host in January 2026, so any path from a pre-2026 tutorial now 404s. Start from the dados.gov.br dataset page.
What teams use CNPJ data for
Verify Brazilian counterparties on their CNPJ. Status, legal form and address checked automatically against the register.
Build prospect lists filtered on CNAE, state, revenue band or business size.
Backfill CNPJ numbers, CNAE codes, contact data and financials across your Brazilian accounts in bulk.
Track strike-offs and status changes across your Brazilian supplier base instead of trusting a month-old dump.
Type-ahead on nome fantasia in your signup form, so the CNPJ and address arrive exactly as the register writes them.
Resolve QSA partners and link establishments back to their root, which the raw dump leaves you to reconstruct.
Brazil is one of 200+ countries on the same API
The same request, the same response schema, from the CNPJ to Companies House, the Handelsregister and Sirene. Build the Brazilian integration once and take it across the border.
Explore the Company Data API
The same API, register by register
What teams build with register data
Onboarding, KYB and supplier checks in production, on the same endpoints you tried above.
Norway's national trust mark verifies businesses against the register in real time, cutting verification time by 99%.
Read the story
Up-to-date business details from around the world, screened straight inside the onboarding flow.
Read the story
Large-scale KYB verification through business lookup, built straight into the signup path.
Read the story350M statutory addresses and registry director records inside Sumsub's global KYB flows, so shell offices and nominee directors get caught at onboarding.
Read the storyRegistry-sourced business and UBO data across Africa, Asia and Latin America, with 80% fewer manual reviews.
Read the storyCNPJ API pricing
Transparent, credit-based pricing. Start with a free trial.
Run your first 150 lookups free
- 150 lookups and 10 exports in week one, key the moment you sign up
- 1 credit per business returned, usage-based after that
- No credit card, no contract, no sales call
Questions? Ask a human.
No ticket queue. Your question lands with our data team and you get an answer within 24 hours.
Mon to Fri 9:00 to 17:30 CET · info@companydata.com
What our customers say
Real feedback from the people using CompanyData every day.
The best data company we have worked with.
Great feedback from our team on the data quality.
Frequently asked questions
Is there an official CNPJ API?
No. Receita Federal publishes free monthly open-data dumps on dados.gov.br and offers a captcha-gated web lookup, plus a paid Serpro API that needs an e-CNPJ certificate. There is no free official public REST API, so every 'CNPJ API' developers reach for is a third party re-serving the monthly dump.
What does the CNPJ open data contain?
Name, CNPJ number, address, legal form, CNAE activity, plus phone, fax, email and nome fantasia as first-class fields, which few registers publish. The contact data is self-declared and often stale or null. There are no employee counts and no filed financials: porte is a revenue band and capital social is registered capital only.
How is a CNPJ number structured?
A CNPJ is 14 characters: an 8-character root, a 4-character branch order where 0001 is the head office, and two mod-11 check digits. There is one row per establishment, not per business. Since 31 July 2026 the alphanumeric CNPJ allows letters in the first 12 positions, so digit-only validation is already broken.
Does the CNPJ data give phone and email?
Yes, the open data carries phone, fax and email, which is unusual among registers. The fill rate is patchy because the values are self-declared and often stale. We keep those fields, clean them, and add website and mobile where available on the records that have them.
Why filter on situação cadastral?
Roughly 60% of the rows in the CNPJ dump are struck off. Filtering on situação cadastral = 2 (Ativa) keeps only active establishments. We do this before matching, so you are not enriching against dead establishments.
How many Brazilian businesses do you cover?
29 million Brazilian records, filtered to active establishments and refreshed monthly from the register and other official sources, with employees and structured financials added on top.
Can I get CNPJ data in bulk?
Yes. Filter on CNAE, state, revenue band or business size and export to Excel, CSV or straight over the API, with enrichment included. That is the part the 7GB Latin-1 dump leaves you to build yourself.
Run 150 free API calls before you spend anything
Tell us which Brazilian businesses you need. You get a trial key with 150 lookups and 10 exports, plus a real sample response for your audience, within 24 hours.
or call +31 (0)20 705 2360