Look up the State Registration (IE)

CNPJAPI looks up a company's Inscrição Estadual (IE, the Brazilian state tax registration) for a CNPJ straight from the official source (the State Revenue offices' registry, over their web service - not scraping). It is a premium feature: it requires an API key on a plan that includes IE quota.

  • Method and path: GET /consulta/ie/{cnpj}
  • Base URL: https://api.cnpjapi.com.br
  • Path parameter: the 14 digits of the CNPJ only, without punctuation.
  • Authentication: API key in the Authorization header (see Authentication). There is no anonymous version; the plan must include IE.

Query parameters

Parameter Description
uf Target state (e.g. SP). Omitted = nationwide sweep across the covered states.
incluir_baixadas true also includes cancelled registrations (nao_habilitado). Defaults to false: returns only the active ones (taxpayer or exempt).

Coverage (16 states): AC, AM, BA, ES, GO, MT, MS, MG, PB, PR, PE, RJ, RN, RS, SC, SP.

On a query with uf, if the CNPJ is not a taxpayer in that state the item is still returned, with indicador: 9 and an empty ie (it is the definitive answer for the state you asked about) - do not read "non-taxpayer" as "empty list". On the nationwide sweep, non-taxpayers are omitted: only states with a registration are listed.

Example (curl)

A single state:

curl "https://api.cnpjapi.com.br/consulta/ie/00776574000156?uf=SP" \
  -H "Authorization: Bearer cnpj_sua_chave"

Nationwide sweep (no uf):

curl "https://api.cnpjapi.com.br/consulta/ie/00776574000156" \
  -H "Authorization: Bearer cnpj_sua_chave"

Response (200 OK, application/json)

{
  "cnpj": "00776574000156",
  "fonte": "sefaz",
  "cache_hit": false,
  "as_of": "2026-09-04T12:00:00Z",
  "resultados": [
    {
      "uf": "SP",
      "ie": "111111111111",
      "indicador": 1,
      "situacao": "habilitado",
      "tipo": "sede",
      "razao_social": "...",
      "nome_fantasia": "...",
      "data_baixa": null
    }
  ]
}

Response fields

Field Description
cnpj The CNPJ you queried (14 digits)
fonte Data source (sefaz)
cache_hit true when served from the 24h cache (does not spend a credit)
as_of Timestamp of the data (ISO-8601)
resultados List of registrations, one per state found

Each resultados item:

Field Description
uf State of the registration
ie State Registration number (empty when non-taxpayer)
indicador 1 ICMS taxpayer, 2 exempt, 9 non-taxpayer
situacao habilitado (active) or nao_habilitado (inactive)
tipo sede (the IE in the head office's state) or outra_uf (a registration in another state)
razao_social Legal name as held in the state registry
nome_fantasia Trade name, when present
data_baixa Cancellation date when nao_habilitado; null otherwise

Credits and quota

  • A nationwide sweep (no uf) costs 3 credits; a single state (?uf=SP) costs 1 credit.
  • Cached responses (cache_hit: true) do not spend a credit.
  • IE has its own monthly quota per plan, separate from the CNPJ lookup quota; some plans also allow top-up credits that never expire. Manage everything in the portal.

Together with the CNPJ data

Need the registration data and the IE in one call? Use GET /{cnpj}?incluir=ie - the CNPJ response gains an inscricoes_estaduais field (same shape as resultados above). See Look up a CNPJ. Native format only (the ReceitaWS compatibility ignores the parameter).

Errors

Status Meaning
401 Missing or invalid API key
403 Your plan does not include State Registration lookups
422 Invalid CNPJ, or uf outside the coverage
429 Monthly IE quota or rate limit exceeded - honor Retry-After
502 Official source (SEFAZ) temporarily unavailable - try again
503 Service temporarily unavailable - try again

See every code in Errors.

Next steps

Create your account at https://app.cnpjapi.com.br and subscribe to a plan with IE to get started.