What is a CNPJ
The CNPJ (Cadastro Nacional da Pessoa Jurídica) is Brazil's corporate tax registration number, comparable to a company registration ID. Every company registered in Brazil has a 14-digit CNPJ, formatted like 40.673.067/0001-34. The CNPJ is not just a company's ID number — it is also the foundation for issuing NF-e, connecting to SEFAZ and signing contracts.
But the CNPJ is only a number. The real company information behind it (whether it is active, its industry, shareholders, address and tax regime) must be queried from Receita Federal. That is exactly what the Consulta CNPJ API is for: pass in a CNPJ and get back the company's complete official record.
Why You Need the Consulta CNPJ API
- KYC validation before invoicing: avoid issuing invoices to "shell companies" or deregistered companies (which would cause the NF-e to be rejected by the tax authority)
- Auto-fill forms: the user enters a CNPJ and the legal name, address, tax registration number and other fields are populated automatically, reducing manual entry and data-entry errors
- Risk control and anti-fraud: identify suspicious customers (e.g. founded only 3 days ago, extremely low registered capital, registered address not matching the operating address)
- Partner compliance screening: verify a counterparty's credentials before signing a contract
- Periodic customer re-checks: regularly re-verify the registration status of existing customers to avoid being caught out by a counterparty's collapse
Core Capabilities of TF Fiscal's Consulta CNPJ API
1. Data Connected Directly to Receita Federal
The data source is Brazil's Receita Federal official data center (via the SERPRO channel), with 100% authority. It is not scraped and stitched together from the web, nor is it stale cached data.
2. Returned Fields at a Glance (40+ items)
- Basic information: Razão Social (legal name), Nome Fantasia (trade name), CNPJ, Data de Abertura (incorporation date)
- Address: full Endereço, Logradouro (street), Número (number), Bairro (district), CEP (postal code), Município (municipality), UF (state)
- Industry: CNAE Principal (primary 6-digit industry code) + Atividades Secundárias (list of secondary activities) + Descrição (industry description)
- Registration status: Situação Cadastral (Ativa / Suspensa / Baixada / Inapta / Nula) + Data Situação (status effective date) + Motivo (reason for change)
- Capital and size: Capital Social (registered capital), Porte (company size: ME / EPP / Grande)
- Ownership structure: Quadro Societário (QSA, list of shareholders and legal representatives, including CPF / nationality / qualification)
- Tax regime: Opção pelo Simples Nacional / Lucro Real / Lucro Presumido
- Contact details: Telefone (phone), Email
- State-level registration: Inscrições Estaduais (list of state IE numbers)
- Branches: Filiais (if any subsidiaries exist)
3. Real-time + Cache Strategy
Three modes are supported:
- Real-time mode: every call connects directly to Receita Federal (ideal for strict KYC validation scenarios)
- Cache mode: 24–72 hour cache (ideal for auto-fill and list-display scenarios, saving cost)
- Asynchronous batch: submit 1,000+ CNPJs at once with results returned via Webhook (ideal for periodic customer re-checks)
4. Call Logging and Auditing
Every call records the timestamp, the caller, the parameters and the returned fields, retained permanently. This supports internal risk-control auditing and compliance evidence.
Pricing
TF Fiscal offers flexible pricing plans:
- Pay per call: R$ 0.50 per query (deduplicated by CNPJ uniqueness — repeated queries of the same CNPJ within 24h count only once)
- Prepaid packages: 1,000 queries for R$ 450 (R$ 0.45 each); 10,000 queries for R$ 3,800 (R$ 0.38 each)
- Custom enterprise plans: for customers with high call volumes, complex needs or dedicated SLA requirements, we offer one-on-one customization: pricing can be packaged annually, by business line or by industry, including a dedicated account manager, an isolated resource pool, priority technical support and a compliance-audit package. Contact sales for a quote →
Note: actual pricing depends on whether you choose the "Reduced" (Reduzida) or "Complete" (Completa) data set. The complete set includes sensitive fields such as shareholders and tax regime, and carries a higher unit price.
API Example
GET /v1/consulta/cnpj/40673067000134
Response:
{
"cnpj": "40.673.067/0001-34",
"razao_social": "TF SOFTWARE LTDA",
"nome_fantasia": "TF Software",
"situacao": "ATIVA",
"data_abertura": "2020-...",
"endereco": { "uf": "SP", "municipio": "São Paulo", ... },
"cnae_principal": "6202-3/00",
"capital_social": "...",
"socios": [ ... ]
}
Typical Use Cases
- Cross-border ERP onboarding new customers: enter a CNPJ to auto-populate company information
- E-commerce platform seller vetting: validate Shopee / Mercado Livre sellers before onboarding
- Financial risk control: compliance screening of companies for credit approval and factoring
- Account customer re-checks: detect Suspensa / Baixada statuses and trigger timely alerts
- Anti-fraud: cross-validate against NF-e invoicing data to identify suspicious transactions
FAQ
Q: How is this different from querying the Receita Federal website directly?
The official website is rate-limited daily (about 100 queries per IP) and offers no API, only HTML, so it cannot be automated. TF Fiscal provides an API through an officially authorized channel, enabling large-scale, structured queries.
Q: How often is the data updated?
In real-time mode the data comes from the current Receita Federal database, T+0. Cache mode refreshes every 24 hours by default.
Q: Can I look up a deregistered (Baixada) company?
Yes. Information on companies with Baixada status can still be queried, including the deregistration date and reason.
Q: How is privacy compliance handled?
CNPJ data is public information (under Brazilian company law) and is not strictly governed by LGPD. However, if you also query shareholder CPFs, you must comply with LGPD — see the
LGPD Compliance Gateway.
Related Solutions