Consulting by CNPJ Root

In the commercial API, you can also query using the CNPJ root, which are the first 8 digits of the CNPJ and, in this case, will return all CNPJs of the company in question. In this endpoint, you must send the x_api_token header with the token that was sent to you via email.

You can also pass the token as a parameter in the URL, example:

https://comercial.cnpj.ws/cnpj-raiz/27865757?token=YOUR_TOKEN

Method: GET

Endpoint: https://comercial.cnpj.ws/cnpj-raiz/CNPJ_ROOT

Request Example

Recupera dados de uma empresa pelo CNPJ raiz

get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
cnpj-raizintegerRequired
Responses
200

Sucesso

application/json
get
/cnpj-raiz/{cnpj-raiz}

Mais informações do pacote

Paginação

Caso a empresa possua mais de 20 filiais a API irá dividir a resposta em páginas. Você pode verificar isso no JSON de retono da API, na propriedade "paginacao", que exibe a página atual, o total de páginas e o total de filiais:

Para buscar uma página específica basta informar o número da página na requisição:

Exemplo de Retorno

Abaixo um exemplo do JSON retornado ao se buscar pela raiz do CNPJ 27865757:

Last updated

Was this helpful?