## OCR / CRLV (Certificado de Registro e Licenciamento do Veículo)</h3>
Extrai dados via OCR de uma imagem de um CRLV.

### Request</h4>
URL for POST: `https://api.infosimples.com/api/v2/imagens/ocr/crlv`



| Parameter     | Description                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------------- |
| token*        | The token that will authenticate and authorize the request.                                       |
| image_base64* | Arquivo (foto ou documento digitalizado) do CRLV convertida para uma string codificada em Base64. |

> * Required parameter.

> ** Optional parameter. Sometimes it is necessary to set at least one of the optional parameters for the service to work properly.


### Response examples (OK)
```json
{
  "code": 200,
  "code_message": "A requisição foi processada com sucesso.",
  "errors": [],
  "header": {
    "api_version": "v2",
    "product": "Imagens",
    "service": "ocr/crlv",
    "parameters": {
      "image_base64_md5": "bf12fd72075cf2eb64c38dd6c7453cd9"
    },
    "client_name": "Minha Empresa",
    "token_name": "Token de Produção",
    "billable": true,
    "price": "0.1",
    "requested_at": "2022-03-31T16:46:06.000-03:00",
    "elapsed_time_in_milliseconds": 128,
    "remote_ip": "111.111.111.111",
    "signature": "U2FsdGVkX1+qq7xF7GWyF1JUu5riRCWQOI+7UkKPUTxrNlQPgUUE/h1lAFv2ssGo8Wxt2Dx835CrQfEImtxlUw=="
  },
  "data_count": 1,
  "data": [
    {
      "campos": {
        "renavam": {
          "tipo": "texto",
          "titulo": "Renavam",
          "score": 0.9,
          "valor": "1111111111"
        },
        "placa": {
          "tipo": "texto",
          "titulo": "Placa",
          "score": 0.9,
          "valor": "AAA1111"
        },
        "ano_exercicio": {
          "tipo": "texto",
          "titulo": "Ano exercício do CRLV",
          "score": 0.9,
          "valor": "2022"
        },
        "ano_fabricacao": {
          "tipo": "texto",
          "titulo": "Ano de fabricação do veículo",
          "score": 0.9,
          "valor": "2021"
        },
        "ano_modelo": {
          "tipo": "texto",
          "titulo": "Ano modelo do veículo",
          "score": 0.0,
          "valor": "2020"
        },
        "crv": {
          "tipo": "texto",
          "titulo": "Certificado de Registro do Veículo (CRV)",
          "score": 0.9,
          "valor": "111111111111"
        },
        "cla": {
          "tipo": "texto",
          "titulo": "Código de segurança do Certificado de Licenciamento Anual (CLA)",
          "score": 0.9,
          "valor": "111111111111"
        },
        "cat": {
          "tipo": "texto",
          "titulo": "Certificado de Adequação a Legislação de Trânsito (CAT)",
          "score": 0.9,
          "valor": "***"
        },
        "especie_tipo": {
          "tipo": "texto",
          "titulo": "Espécie/Tipo do veículo",
          "score": 0.9,
          "valor": "CARGA SEMI-REBOQUE"
        },
        "marca_modelo_versao": {
          "tipo": "texto",
          "titulo": "Marca/Modelo/Versão do veículo",
          "score": 0.9,
          "valor": "FYM/CRUISE"
        },
        "placa_anterior_uf": {
          "tipo": "texto",
          "titulo": "Placa Anterior/UF",
          "score": 0.9,
          "valor": "*******/**"
        },
        "chassi": {
          "tipo": "texto",
          "titulo": "Número do Chassi",
          "score": 0.9,
          "valor": "1AA11111AA1111111"
        },
        "cor_predominante": {
          "tipo": "texto",
          "titulo": "Cor predominante",
          "score": 0.9,
          "valor": "MARROM"
        },
        "combustivel": {
          "tipo": "texto",
          "titulo": "Combustível",
          "score": 0.9,
          "valor": "ALCOOL/GASOLINA"
        },
        "qr_code": {
          "tipo": "imagem",
          "titulo": "QR Code",
          "score": 0.9,
          "valor_base64": "imagem_codificada_em_base64"
        }
      },
      "image_base64": "imagem_codificada_em_base64",
      "keypoints": [
        [
          51.8434371948242,
          -1.75339531898499
        ],
        [
          56.048095703125,
          507.951690673828
        ],
        [
          723.224243164062,
          506.119781494141
        ],
        [
          723.92822265625,
          -0.669853150844574
        ]
      ],
      "tipo": "superior_esquerdo"
    }
  ],
  "site_receipts": []
}
````

### Code examples for API integration

#### Python
```python
# Tested with: Python 3.10.19, Python 3.14.0
import requests
import base64

url = 'https://api.infosimples.com/api/v2/imagens/ocr/crlv'
args = {
  "image_base64": base64.b64encode(open("path/to/file", "rb").read()).decode("ascii"),
  "token":        "INFORME_AQUI_O_TOKEN_DA_CHAVE_DE_ACESSO"
}

response = requests.post(url, args)
response_json = response.json()
response.close()

if response_json['code'] == 200:
  print("Successful result: ", response_json['data'])
elif response_json['code'] in range(600, 799):
  mensagem = "Unsuccessful result. Read on to learn more: \n"
  mensagem += "Code: {} ({})\n".format(response_json['code'], response_json['code_message'])
  mensagem += "; ".join(response_json['errors'])
  print(mensagem)

print("Response headers: ", response_json['header'])
```


## We are ready to help
Still have questions or need help with your integration? Contact us at <a href="mailto:suporte@infosimples.com.br">suporte@infosimples.com.br</a> and receive help from our highly qualified technical team.
