# Images API Documentation (v2)
Versão da API: 2.2.37 (2026-04-13)
We are committed to keeping the API documentation concise. Please read this page before starting your integration.


## Table of Contents
1. [Change history](#historico-mudancas)
2. [Request format](#formato-requisicao)
3. [Configuration parameters](#parametros-configuracao)
4. [Response structure](#estrutura-resposta)
5. [Response codes](#codigos-resposta)
6. [API response interpretation](#campos-resposta)
7. [Specific service documentation](#servicos)


## [Change history](#historico-mudancas)
The API is constantly evolving and new services are added frequently, with the care of introducing only incremental changes to avoid any previous integration from breaking.
You are notified by email whenever a change occurs and you can check the complete change history in the link below:
https://api.infosimples.com/mudancas


## [Request format](#formato-requisicao)
|               |                                                    |
| ------------- | -------------------------------------------------- |
| HTTP Method   | POST                                               |
| Query URL     | https://api.infosimples.com/api/v2/imagens/servico |
| Return format | JSON                                               |

Replace `servico` with the service to be queried, for example `ocr/cnh`. You can find the `servico` in the [specific documentation](#servicos) of the respective API.


## [Configuration parameters](#parametros-configuracao)
These parameters are common to all APIs. An API may request other parameters that will be specified in its [documentation](#servicos).

`*`: Required parameter
| Parameter | Description                                                                                          |
| --------- | ---------------------------------------------------------------------------------------------------- |
| token*    | API access key. It is with the token that the API recognizes and authorizes who is making the query. |


## [Response structure](#estrutura-resposta)
An API response has the following fields:

| Field         | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| code          | number | API response code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| code_message  | string | Message corresponding to the API response code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| data          | array  | Structured and useful data returned from the service processing result. It is always an `array`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| data_count    | number | Number of results returned, that is, the number of elements in the `data` field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| errors        | array  | List of messages (`String`) that can explain in more detail the cause of any error. It is always an `array`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| site_receipts | array  | Empty list. It may be used in the future to return URLs of files associated with the service processing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| header        | object | Header with the following fields:
- **api_version:** API version used in the request. - **product:** Infosimples product name. - **service:** requested service name. - **parameters:** specific service parameters sent in the request. - **client_name:** client name. - **token_name:** name of the token used in the request. - **billable:** indicates whether there was a charge for the request. - **price:** final price of the request processing. - **requested_at:** date and time of the request. - **elapsed_time_in_milliseconds:** total duration of the request, in milliseconds. - **remote_ip:** IP address from which the request originated. - **signature:** value that can be used by Infosimples to guarantee the integrity and authenticity of the API return. |


## [API Response Codes](#codigos-resposta)
<p>All API responses return the `code` field with the response code of the request. The table below shows the possible return codes and their meanings.</p>

| Code | Description                                                                                                                                                                                       | Is there a charge? |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| 200  | The request was processed successfully.                                                                                                                                                           | ✓                  |
| 600  | Unexpected error.                                                                                                                                                                                 | ✗                  |
| 601  | The token could not be authenticated.                                                                                                                                                             | ✗                  |
| 602  | The requested service is invalid.                                                                                                                                                                 | ✗                  |
| 603  | The token is not authorized to use this service. Make sure it is still active and has no usage constraint.                                                                                        | ✗                  |
| 604  | The request failed validation before the automation.                                                                                                                                              | ✗                  |
| 606  | Required parameters are missing. Please, check the API docs.                                                                                                                                      | ✓                  |
| 622  | You seem to be performing the same request too frequently. Please, make sure your integration is correct and contact our support team if you are sure there is nothing wrong on your application. | ✗                  |
| 700  | The given Base64-encoded string is not valid.                                                                                                                                                     | ✓                  |
| 701  | The given Base64-encoded string is not an image.                                                                                                                                                  | ✓                  |
| 702  | The given image does not contain valid documents (IDs).                                                                                                                                           | ✓                  |


## [API Response Interpretation](#campos-resposta)
Image APIs that perform OCR on documents typically return objects in `data` with the fields `tipo`, `image_base64`, `campos` and `keypoints`.

| Field        | Type   | Description                                                                                                                                                                                                                                                                                                                                                                             |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tipo         | String | Document type identified by OCR. Examples: `cnh_frente`, `cnh_verso` and `rg_frente`.                                                                                                                                                                                                                                                                                                   |
| image_base64 | String | Base64 encoded value of the image extracted from the original file, after being cropped, normalized and compressed.                                                                                                                                                                                                                                                                     |
| campos       | Array  | Document fields extracted by OCR. Example:                                                                                                                                                                                                                                                                                                                                              |
| keypoints    | Array  | Coordinates in the original image file where the document was identified. Example:
```json [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]] ```
Below is a representation of how the `keypoints` field coordinates are linked to the original image. Each point `(A, B, C, D)` corresponds to one of the tuples of the `keypoints` field, in the same order in which they are returned. |

```json
{
  "score": 0.9,
  "tipo": "texto",
  "titulo": "Nome",
  "valor": "JOAO DA SILVA"
}
```

- **score:** Accuracy of the value extracted by OCR. The higher, the better. Varies from `0.0` to `1.0`.
- **tipo:** Field type. Examples: `texto` or `valor_base64`.
- **titulo:** Identification of the section of the document that was extracted. Examples: `Nome`, `Sobrenome`, `CPF` or `Data de nascimento`.
- **valor:** Text with the value extracted by OCR.

![Keypoints](https://cdn.infosimples.com/origin/api-infosimples/packs/docs/keypoints-cede711825b2d88b8b02fbd5da1ee9cd083f744ded6a8f159963511e8c3d36c0.svg)


## [Specific service documentation](#servicos)
Below you will find the link to the specific API documentation for each service we provide.

### Leitor / QR Code
- **Description:** Extrai os dados de um QR Code em uma imagem.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/leitor/qr-code.md

### OCR / CNH (Carteira Nacional de Habilitação)
- **Description:** Extrai dados via OCR de uma imagem de CNH. A imagem enviada pode ter apenas a frente, apenas o verso ou os dois lados do documento de identificação.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/cnh.md

### OCR / Contas / CEMIG
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da CEMIG (Companhia Energética de Minas Gerais).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/cemig.md

### OCR / Contas / CPFL
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da CPFL (Companhia Piratininga de Força e Luz).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/cpfl.md

### OCR / Contas / Demonstrativo de Consumo (Neoenergia)
- **Description:** Extrai dados via OCR do PDF de demonstrativo de consumo de energia elétrica da Neoenergia.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/neoenergia-demonst.md

### OCR / Contas / Elektro
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da Elektro.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/elektro.md

### OCR / Contas / Enel
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da Enel (CE, RJ e SP).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/enel.md

### OCR / Contas / Energisa
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da Energisa.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/energisa.md

### OCR / Contas / Light
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da Light.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/light.md

### OCR / Contas / Light (Grupo A4)
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da Light do Grupo A4.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/light/ocr-grupo-a4.md

### OCR / Contas / Neoenergia
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da Neoenergia.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/neoenergia.md

### OCR / Contas / RGE
- **Description:** Extrai dados via OCR do PDF de conta de energia elétrica da RGE.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/contas/rge.md

### OCR / CRLV (Certificado de Registro e Licenciamento do Veículo)
- **Description:** Extrai dados via OCR de uma imagem de um CRLV.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/crlv.md

### OCR / Imposto de Renda / Declaração (Pessoa Física)
- **Description:** Extrai dados via OCR do PDF gerado de Declaração de Imposto de Renda de Pessoa Física que é entregue para a Receita Federal.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/imposto-renda/declaracao.md

### OCR / Nota Fiscal de Serviço / BA / Salvador
- **Description:** Extrai dados via OCR do PDF de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município de Salvador (a confiabilidade dos dados retornados não é 100% por se tratar de um procedimento de OCR em uma imagem).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/ba/salvador.md

### OCR / Nota Fiscal de Serviço / MG / Contagem
- **Description:** Extrai dados via OCR do PDF de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município de Contagem (a confiabilidade dos dados retornados não é 100% por se tratar de um procedimento de OCR em uma imagem).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/mg/contagem.md

### OCR / Nota Fiscal de Serviço / PE / Recife
- **Description:** Extrai dados via OCR do PDF de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município de Recife (a confiabilidade dos dados retornados não é 100% por se tratar de um procedimento de OCR em uma imagem).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/pe/recife.md

### OCR / Nota Fiscal de Serviço / RJ / Rio de Janeiro
- **Description:** Extrai dados via OCR do PDF de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município do Rio de Janeiro (a confiabilidade dos dados retornados não é 100% por se tratar de um procedimento de OCR em uma imagem).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/rj/rio-janeiro.md

### OCR / Nota Fiscal de Serviço / RS / Farroupilha
- **Description:** Extrai dados via OCR do PDF de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município de Farroupilha.
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/rs/farroupilha.md

### OCR / Nota Fiscal de Serviço / SP / Araçariguama
- **Description:** Extrai dados via OCR do PDF de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município de Araçariguama (a confiabilidade dos dados retornados não é 100% por se tratar de um procedimento de OCR em uma imagem).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/sp/aracariguama.md

### OCR / Nota Fiscal de Serviço / SP / Sumaré
- **Description:** Extrai dados via OCR do PDF de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município de Sumaré (a confiabilidade dos dados retornados não é 100% por se tratar de um procedimento de OCR em uma imagem).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/sp/sumare.md

### OCR / Nota Fiscal de Serviço / SP / São Paulo
- **Description:** Extrai dados via OCR do PDF ou da imagem de uma Nota Fiscal Eletrônica de Serviços na Prefeitura do município de São Paulo (a confiabilidade dos dados retornados não é 100% por se tratar de um procedimento de OCR).
- **Documentation URL:** https://api.infosimples.com/imagens/docs/ocr/nfse/sp/sao-paulo.md

