Company Data API (CNPJ)
Integrate the CNPJ Data API using authentication via X-API-Key.
This documentation is intended for authenticated integrations and API credit usage. For a free individual lookup without login, use the Public CNPJ Lookup.
Step 1 — Buy credits
Open the CNPJ Data dashboard, go to the API section and purchase API credits.
Step 2 — Generate an API key
In the authenticated dashboard, open the My API tab, generate your key and send it in the X-API-Key.
X-API-Key: <id>.<secret>Look up a company by CNPJ
curl -X GET "https://api.cnpjdata.com.br/api/companies/01234567000189" \
-H "X-API-Key: <id>.<secret>"Send the CNPJ without formatting, using numbers only. Cost: 1 credit.
The paid API also returns the company partner list and the data available to authenticated access. In the public lookup, partner identification fields are masked.
Public lookup example (masked data):
{
"socios": [
{
"nomeSocio": "S***** M****** A****",
"cnpjCpfSocio": "***00******",
"entrada": "13/06/2001",
"descricaoQualificacao": "Sócio",
"descricaoFaixaEtaria": "51 A 60"
}
]
}Paid API example (available data):
{
"socios": [
{
"nomeSocio": "SHEILA MARTINS ALVES",
"cnpjCpfSocio": "***008208**",
"entrada": "13/06/2001",
"descricaoQualificacao": "Sócio",
"descricaoFaixaEtaria": "51 A 60"
}
]
}200 response (example):
{
"searchId": "uuid-da-busca",
"cnpjCompleto": "01.234.567/0001-89",
"razaoSocial": "EMPRESA EXEMPLO COMERCIO LTDA",
"situacaoCadastralCodigo": "02",
"uf": "SP"
}The full response includes the other available registration data.
View full response
{
"searchId": "uuid-da-busca",
"cnpjCompleto": "01.234.567/0001-89",
"razaoSocial": "EMPRESA EXEMPLO COMERCIO LTDA",
"nomeFantasia": "LOJA EXEMPLO",
"naturezaJuridicaCodigo": "2135",
"porteEmpresaCodigo": "01",
"situacaoCadastralCodigo": "02",
"cnaeFiscalPrincipalCodigo": "4781400",
"cnaeFiscalSecundariaCodigo": "4755502,4772500,4782201,4761003",
"codMunicipio": "4729",
"matrizFilialCodigo": "1",
"logradouro": "RUA EXEMPLO 1",
"numero": "100",
"complemento": "LOJA 01",
"bairro": "CENTRO",
"cep": "01000000",
"uf": "SP",
"telefone1": null,
"telefone2": null,
"email": null,
"dataInicioAtividade": "1997-01-21T00:00:00.000Z",
"dataSituacaoCadastral": "2005-11-03T00:00:00.000Z",
"anoInicio": 1997,
"naturezaJuridicaRef": {
"codigo": "2135",
"descricao": "Empresário (Individual)"
},
"porteEmpresaRef": {
"codigo": "01",
"descricao": "{copy.microCompany}"
},
"situacaoCadastralRef": {
"codigo": "02",
"descricao": "{copy.activeStatus}"
},
"cnaeRef": {
"codigo": "4781400",
"descricao": "Comércio Varejista De Artigos Do Vestuário E Acessórios"
},
"municipioRef": {
"codigo": "4729",
"descricao": "Jordania"
},
"matrizFilialRef": {
"codigo": "1",
"descricao": "Matriz"
},
"cnaesSecundarios": [
{
"codigo": "4755502",
"descricao": "Comercio Varejista De Artigos De Armarinho"
}
],
"socios": [
{
"nomeSocio": "SHEILA MARTINS ALVES",
"cnpjCpfSocio": "***008208**",
"entrada": "13/06/2001",
"descricaoQualificacao": "Sócio",
"descricaoFaixaEtaria": "51 A 60"
}
]
}Look up two or more companies using a CNPJ list
curl -X POST "https://api.cnpjdata.com.br/api/companies/list" \
-H "X-API-Key: <id>.<secret>" \
-H "Content-Type: application/json" \
-d '{"cnpjs":["01234567000189","00987654000110"],"page":1,"limit":20}'200 response (example):
{
"searchId": "uuid-da-busca",
"data": [{ "cnpjCompleto": "01.234.567/0001-89", "razaoSocial": "EMPRESA EXEMPLO LTDA" }],
"page": 1,
"limit": 20,
"total": 2,
"totalPages": 1
}With page, only returned records are charged. Without page, all records are charged and a complete file is generated.
View full company model
{
"cnpjCompleto": "01.234.567/0001-89",
"razaoSocial": "EMPRESA EXEMPLO COMERCIO LTDA",
"nomeFantasia": "LOJA EXEMPLO",
"naturezaJuridicaCodigo": "2135",
"porteEmpresaCodigo": "01",
"situacaoCadastralCodigo": "02",
"cnaeFiscalPrincipalCodigo": "4781400",
"cnaeFiscalSecundariaCodigo": "4755502,4772500,4782201,4761003",
"codMunicipio": "4729",
"matrizFilialCodigo": "1",
"logradouro": "RUA EXEMPLO 1",
"numero": "100",
"complemento": "LOJA 01",
"bairro": "CENTRO",
"cep": "01000000",
"uf": "SP",
"telefone1": null,
"telefone2": null,
"email": null,
"dataInicioAtividade": "1997-01-21T00:00:00.000Z",
"dataSituacaoCadastral": "2005-11-03T00:00:00.000Z",
"anoInicio": 1997,
"naturezaJuridicaRef": {
"codigo": "2135",
"descricao": "Empresário (Individual)"
},
"porteEmpresaRef": {
"codigo": "01",
"descricao": "{copy.microCompany}"
},
"situacaoCadastralRef": {
"codigo": "02",
"descricao": "{copy.activeStatus}"
},
"cnaeRef": {
"codigo": "4781400",
"descricao": "Comércio Varejista De Artigos Do Vestuário E Acessórios"
},
"municipioRef": {
"codigo": "4729",
"descricao": "Jordania"
},
"matrizFilialRef": {
"codigo": "1",
"descricao": "Matriz"
},
"cnaesSecundarios": [
{
"codigo": "4755502",
"descricao": "Comercio Varejista De Artigos De Armarinho"
}
],
"socios": [
{
"nomeSocio": "SHEILA MARTINS ALVES",
"cnpjCpfSocio": "***008208**",
"entrada": "13/06/2001",
"descricaoQualificacao": "Sócio",
"descricaoFaixaEtaria": "51 A 60"
}
]
}Check the company count before a filtered query
Before running a large filtered query, check how many companies match the selected criteria. This lets you assess the volume before requesting the data.
curl -X GET "https://api.cnpjdata.com.br/api/companies/count?uf=SP&cidadeNome=Campinas&cnae=6201500&porte=05&status=02&anoInicio=2016" \
-H "X-API-Key: <id>.<secret>"200 response:
{ "count": 123456 }page and limit are not used. This route does not return companies, create a searchId or consume credits.
Filter examples
Filters can be combined in the URL. Accepted parameters: uf, codMunicipio, cidadeNome, cnae, porte, status, anoInicio, anoInicioMin e anoInicioMax.
Location and period
Use uf=SP and cidadeNome=Campinas to filter by location. For a specific year, use anoInicio=2016. For a range, use anoInicioMin=2015&anoInicioMax=2020.
CNAE
Enter the complete CNAE code using numbers only. Do not use dots, hyphens or slashes. Example: cnae=6201500.
Status
Enter the code in the status parameter. Example: status=02 for active companies.
Company size
| Code | Description |
|---|---|
| 00 | Not informed |
| 01 | Micro company |
| 03 | Small company |
| 05 | Other |
Registration status
| Code | Description |
|---|---|
| 01 | Null |
| 02 | Active |
| 03 | Suspended |
| 04 | Unfit |
| 08 | Closed |
Search by filters — full export
Run the query without sending page to generate a file with all matching records.
curl -X GET "https://api.cnpjdata.com.br/api/companies?uf=SP&cidadeNome=Campinas&cnae=6201500&porte=05&status=02&anoInicio=2016" \
-H "X-API-Key: <id>.<secret>"200 response (summary):
{
"searchId": "uuid-da-busca",
"data": [{ "cnpjCompleto": "01.234.567/0001-89", "razaoSocial": "EMPRESA EXEMPLO LTDA" }],
"total": 58,
"totalPages": 3
}Up to 10,000 records: the response comes complete and synchronous, in the same paginated format, with the total result file available via the searchId.
Above 10,000 records: the file is generated asynchronously. The response comes with "status": "processing" and empty data, and the file becomes available via the searchId once processing completes (usually within a few minutes, proportional to the volume).
Response when the export is asynchronous (above 10,000 records):
{
"searchId": "uuid-da-busca",
"status": "processing",
"data": []
}The full response contains the available registration data. Billing is based on the total records found; the file is associated with the searchId.
View full company model
{
"cnpjCompleto": "01.234.567/0001-89",
"razaoSocial": "EMPRESA EXEMPLO COMERCIO LTDA",
"nomeFantasia": "LOJA EXEMPLO",
"naturezaJuridicaCodigo": "2135",
"porteEmpresaCodigo": "01",
"situacaoCadastralCodigo": "02",
"cnaeFiscalPrincipalCodigo": "4781400",
"cnaeFiscalSecundariaCodigo": "4755502,4772500,4782201,4761003",
"codMunicipio": "4729",
"matrizFilialCodigo": "1",
"logradouro": "RUA EXEMPLO 1",
"numero": "100",
"complemento": "LOJA 01",
"bairro": "CENTRO",
"cep": "01000000",
"uf": "SP",
"telefone1": null,
"telefone2": null,
"email": null,
"dataInicioAtividade": "1997-01-21T00:00:00.000Z",
"dataSituacaoCadastral": "2005-11-03T00:00:00.000Z",
"anoInicio": 1997,
"naturezaJuridicaRef": {
"codigo": "2135",
"descricao": "Empresário (Individual)"
},
"porteEmpresaRef": {
"codigo": "01",
"descricao": "{copy.microCompany}"
},
"situacaoCadastralRef": {
"codigo": "02",
"descricao": "{copy.activeStatus}"
},
"cnaeRef": {
"codigo": "4781400",
"descricao": "Comércio Varejista De Artigos Do Vestuário E Acessórios"
},
"municipioRef": {
"codigo": "4729",
"descricao": "Jordania"
},
"matrizFilialRef": {
"codigo": "1",
"descricao": "Matriz"
},
"cnaesSecundarios": [
{
"codigo": "4755502",
"descricao": "Comercio Varejista De Artigos De Armarinho"
}
],
"socios": [
{
"nomeSocio": "SHEILA MARTINS ALVES",
"cnpjCpfSocio": "***008208**",
"entrada": "13/06/2001",
"descricaoQualificacao": "Sócio",
"descricaoFaixaEtaria": "51 A 60"
}
]
}Track an asynchronous export
After an asynchronous export, track the processing by its searchId:
curl -X GET "https://api.cnpjdata.com.br/api/companies/exports/<searchId>/status" \
-H "X-API-Key: <id>.<secret>"200 response (example):
{
"searchId": "uuid-da-busca",
"status": "processing",
"total": 123456,
"error": null,
"createdAt": "2026-08-31T14:30:00.000Z"
}| Status | Meaning |
|---|---|
| processing | File being generated |
| ready | Ready for download |
| failed | Processing failed; contact support |
Search by filters — pagination with page
Send page and limit to request only one page.
The limit parameter accepts a maximum of 100 records per page.
curl -X GET "https://api.cnpjdata.com.br/api/companies?uf=SP&cidadeNome=Campinas&cnae=6201500&porte=05&status=02&anoInicioMin=2015&anoInicioMax=2020&page=2&limit=20" \
-H "X-API-Key: <id>.<secret>"200 response (summary):
{
"searchId": "uuid-da-busca-da-pagina",
"data": [{ "cnpjCompleto": "12.345.678/0001-99", "uf": "SP" }],
"page": 2,
"limit": 20,
"total": 58,
"totalPages": 3
}Billing is based only on the number of records returned on the page.
View full company model
{
"cnpjCompleto": "01.234.567/0001-89",
"razaoSocial": "EMPRESA EXEMPLO COMERCIO LTDA",
"nomeFantasia": "LOJA EXEMPLO",
"naturezaJuridicaCodigo": "2135",
"porteEmpresaCodigo": "01",
"situacaoCadastralCodigo": "02",
"cnaeFiscalPrincipalCodigo": "4781400",
"cnaeFiscalSecundariaCodigo": "4755502,4772500,4782201,4761003",
"codMunicipio": "4729",
"matrizFilialCodigo": "1",
"logradouro": "RUA EXEMPLO 1",
"numero": "100",
"complemento": "LOJA 01",
"bairro": "CENTRO",
"cep": "01000000",
"uf": "SP",
"telefone1": null,
"telefone2": null,
"email": null,
"dataInicioAtividade": "1997-01-21T00:00:00.000Z",
"dataSituacaoCadastral": "2005-11-03T00:00:00.000Z",
"anoInicio": 1997,
"naturezaJuridicaRef": {
"codigo": "2135",
"descricao": "Empresário (Individual)"
},
"porteEmpresaRef": {
"codigo": "01",
"descricao": "{copy.microCompany}"
},
"situacaoCadastralRef": {
"codigo": "02",
"descricao": "{copy.activeStatus}"
},
"cnaeRef": {
"codigo": "4781400",
"descricao": "Comércio Varejista De Artigos Do Vestuário E Acessórios"
},
"municipioRef": {
"codigo": "4729",
"descricao": "Jordania"
},
"matrizFilialRef": {
"codigo": "1",
"descricao": "Matriz"
},
"cnaesSecundarios": [
{
"codigo": "4755502",
"descricao": "Comercio Varejista De Artigos De Armarinho"
}
],
"socios": [
{
"nomeSocio": "SHEILA MARTINS ALVES",
"cnpjCpfSocio": "***008208**",
"entrada": "13/06/2001",
"descricaoQualificacao": "Sócio",
"descricaoFaixaEtaria": "51 A 60"
}
]
}Download the result file from the dashboard
Open the authenticated dashboard, go to My API searches, find the search by its label and click Download.
The link is valid for 2 minutes, and the same result can be downloaded up to 5 times per day.
Searches still in processing become available for download as soon as the status changes to ready.
The dashboard listing shows the status and the total number of records for each search.