Look up CNPJs in batch

Need to look up several CNPJs at once? The POST /consulta/lote endpoint accepts up to 20 CNPJs per call and returns one response item for each, in the same order they were sent.

  • Method and path: POST /consulta/lote
  • Base URL: https://api.cnpjapi.com.br
  • Authentication: requires an API key from a paid plan (see Authentication) - there is no anonymous or free-plan version.
  • Body: {"cnpjs": [...]}, up to 20 CNPJs (only the 14 digits each, without punctuation).

Example (curl)

curl -X POST https://api.cnpjapi.com.br/consulta/lote \
  -H "Authorization: Bearer cnpj_sua_chave" \
  -H "Content-Type: application/json" \
  -d '{"cnpjs": ["00776574000156", "00000000000000", "abc"]}'

Response (200 OK, application/json)

[
  { "cnpj": "00776574000156", "status": "encontrado", "dados": { "RazaoSocial": "...", "...": "..." } },
  { "cnpj": "00000000000000", "status": "nao_encontrado" },
  { "cnpj": "abc", "status": "invalido" }
]

One item per CNPJ sent, in the same order as the input list - use the position to match request and response.

Field Description
cnpj The CNPJ you sent, echoed in the item
status encontrado, nao_encontrado, invalido or erro (a one-off failure looking up that item)
dados The registration fields (same format as Look up a CNPJ) - present only when status is encontrado

An item with a problem does not bring down the whole batch: the others are processed normally. The same CNPJ repeated in the list is not deduplicated - each occurrence generates a response item and counts separately toward your quota.

ReceitaWS format in batch

?formato=receitaws also works on POST /consulta/lote - the response becomes a list of envelopes in the ReceitaWS format, one per CNPJ, in the same input order:

[
  { "status": "OK", "cnpj": "00.776.574/0001-56", "...": "..." },
  { "status": "ERROR", "message": "CNPJ não encontrado na base de dados" }
]

Note: in the ReceitaWS format, an error item has no cnpj field (only status and message) - unlike the native format, which always echoes the cnpj in every item. In this format, matching a response to an input CNPJ is only reliable by array position.

Quota and limits

  • Rate limit (RPM): a batch call counts as 1 request, not 20 - the same per-minute limit as a single lookup (see Limits and plans).
  • Monthly quota: debits the number of CNPJs resolved (encontrado items; nao_encontrado/invalido/erro do not count). Check your usage at GET /cota.

Errors

Status Meaning
401 API key missing or invalid
403 Your account has no paid plan - batch is not available on the free plan
422 Invalid body: missing/empty cnpjs field, or more than 20 CNPJs in the list
429 Per-minute limit or monthly quota exceeded - respect the Retry-After

See all codes in Errors.

Next steps

Create your free account at https://app.cnpjapi.com.br and subscribe to a paid plan to use batch lookups.