HomeAPIsCNPJ API
CNPJ API🇧🇷 CNPJ · enriched

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.

150 free calls in week one · No credit card · The same API covers 200+ countries
29,320,367
Brazilian businesses
50+
data fields per record
CNAE
official codes on every record
<200 ms
median response time
GET /api/company/search?nationalId=33.000.167/0001-01
Petróleo Brasileiro S.A. (Petrobras)
Rio de Janeiro, Brazil
Active
CNPJ33.000.167/0001-01
Legal formSociedade Anônima
CNAE0600-0 · Petroleum extraction
Employees45,900
Websitepetrobras.com.br
Source: Receita Federal (CNPJ) · example200 OK · 148 ms
The basics

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
Try it live

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
Side by side

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 pointOfficial registerCompanyData API
Businesses in the file28,008,32529,320,367
CNPJ number29,301,67029,319,345
Registered address29,302,26629,320,232
Name and nome fantasia
CNAE activity code
Legal form
Website2,603,837
Phone8,059,4378,062,142
Mobile18,204,712
Business email1,320,4501,320,901
Partners or directorsQSA only, CPF masked19,602,743
Employeesporte is a revenue band✓ Structured fields
Revenue and financialscapital social only✓ Structured fields
International records365m 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.

See the difference

More fields than the dump hands back

Employees, financials and clean contact data, one lookup further. Defaults to Brazil, switch country whenever you like.

Try one:
Best practice

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.

1

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.

2

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.

3

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 key
01

The 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.

02

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.

03

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.

04

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.

05

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.

06

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.

Use cases

What teams use CNPJ data for

KYB and onboarding

Verify Brazilian counterparties on their CNPJ. Status, legal form and address checked automatically against the register.

Lead generation

Build prospect lists filtered on CNAE, state, revenue band or business size.

CRM enrichment

Backfill CNPJ numbers, CNAE codes, contact data and financials across your Brazilian accounts in bulk.

Risk and compliance

Track strike-offs and status changes across your Brazilian supplier base instead of trusting a month-old dump.

Form autofill

Type-ahead on nome fantasia in your signup form, so the CNPJ and address arrive exactly as the register writes them.

Group and ownership mapping

Resolve QSA partners and link establishments back to their root, which the raw dump leaves you to reconstruct.

Beyond Brazil

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
Brazil is one of 200+ countries on the same API

CNPJ API pricing

Transparent, credit-based pricing. Start with a free trial.

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.

Amsterdam HQVijzelgracht 53D · +31 20 705 2360
BerlinFriedrichstraße 123 · +49 30 21480480
DubaiBuilding A1, Dubai Digital Park, Dubai Silicon Oasis

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.

9.2/10 on Kiyoh from verified reviews

★★★★

A reliable partner for years, responsive, efficient, and high-quality.

Ann Sofie Westlake
Ann Sofie Westlake
Head of Marketing, Quartix
★★★★★

The best data company we have worked with.

Helmut Huberti, M.D.
Helmut Huberti, M.D.
World Arthrosis Org., Heidelberg
★★★★★

Great feedback from our team on the data quality.

Stefania Guerra
Stefania Guerra
Dyson, Milan

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

Call us: +31 (0)20 705 2360