CNPJ Lookup API on the Brazilian Federal Revenue
At CPF.CNPJ, we simplify and streamline access to essential information about individuals and companies.
The Challenge: Validating Companies and Reducing Risk in B2B Operations
Before signing a contract, granting credit or releasing a payment, any company needs to know who it is dealing with. Validating suppliers, partners and corporate customers requires checking the CNPJ registration status at the Federal Revenue, confirming the legal name and address, and understanding the ownership structure. Done manually — opening the Federal Revenue website, solving a captcha and copying data on every lookup — this process is slow, error-prone and impossible to scale to hundreds or thousands of companies.
The KYB (Know Your Business) process is the foundation of compliance, corporate fraud prevention and credit risk management. Dealing with a CNPJ that is Closed, Unfit or Suspended can mean an invalid invoice, a non-existent supplier, or exposure to fraud schemes involving shell companies. Without automation, the onboarding and compliance team becomes a bottleneck and operations stall.
The solution is to query the CNPJ directly from the official source via API: confirm that the company exists, is active and enabled, and enrich the record with complete corporate data — all programmatically, integrated into the ERP, CRM or onboarding platform, with no manual intervention.
How the CPF.CNPJ API Solves It
1. Complete Company Identification
The API returns the company identification data straight from the Federal Revenue database: legal name, trade name, registration status (Active, Closed, Unfit, Suspended), status date, opening date, legal nature and full address (street, number, district, city, state and ZIP code).
With the registration status in hand, the system automatically decides whether to approve or block the operation: only Active CNPJs proceed; other statuses trigger review or rejection, eliminating the risk of transacting with irregular companies.
2. CNAE, Company Size and Tax Regime
For risk analysis and segmentation, the API delivers the primary CNAE and secondary CNAEs (economic activities), the company size (ME, EPP, Other) and the declared share capital.
It also returns the tax regime: whether the company is opted into Simples Nacional and whether it is a MEI (Individual Microentrepreneur). These fields feed scoring engines, credit limit rules and commercial proposal routing.
3. Shareholders and Administrators (QSA)
The lookup includes the ownership structure (QSA) with the list of shareholders and administrators, the qualification of each one and their stake in the company. This data is essential for KYB, due diligence and ultimate beneficial owner identification in compliance and anti-money-laundering processes.
Cross-referencing the QSA with restrictive lists and fraud databases makes it possible to detect front men, shell companies and conflicts of interest before closing a deal.
4. Alphanumeric CNPJ Support (2026)
Starting in 2026, new CNPJs will be issued in alphanumeric format by the Federal Revenue. The CPF.CNPJ API is already prepared to receive and validate both the traditional numeric CNPJ and the new alphanumeric CNPJ, ensuring your integration keeps working with no rework during the transition.
How to Integrate: CNPJ Lookup via API
Integration is a simple HTTP call. Authenticate with your token via Bearer and make a GET passing the CNPJ. The response comes in JSON with all registration and corporate fields:
# CNPJ lookup on the Federal Revenue via API
curl -X GET "https://api.cpfcnpj.com.br/v3/cnpj/27272134000118" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"
# Response (JSON)
{
"cnpj": "27272134000118",
"razao_social": "ALAS TECNOLOGIA LTDA",
"nome_fantasia": "CPF.CNPJ",
"situacao_cadastral": "ATIVA",
"data_abertura": "2017-01-30",
"natureza_juridica": "206-2 - Sociedade Empresária Limitada",
"porte": "DEMAIS",
"capital_social": 100000.00,
"optante_simples": false,
"mei": false,
"cnae_principal": {
"codigo": "6201501",
"descricao": "Custom software development"
},
"cnae_secundarios": [
{ "codigo": "6311900", "descricao": "Data processing and hosting" }
],
"endereco": {
"logradouro": "Avenida Donato Quintino",
"numero": "90",
"bairro": "Cidade Cruzeiro do Sul",
"municipio": "Montes Claros",
"uf": "MG",
"cep": "39401-301"
},
"qsa": [
{
"nome": "Sample Partner",
"qualificacao": "Managing Partner",
"participacao": 100
}
]
}The same fields are available in bulk lookups for validating entire supplier and customer bases. The full documentation, with all endpoints, parameters and code examples, is available at cpfcnpj.com.br/dev/.
Why use the CNPJ API
- Real-time D+0 data: Up-to-the-minute lookup reflecting the registration status of the day
- 99.9% uptime: High availability to integrate into critical onboarding and registration flows
- Official Federal Revenue source: Data pulled directly from the official database, with no intermediaries
- Complete corporate data: Legal name, status, CNAE, share capital, company size and shareholders (QSA)
