## Leitor / QR Code</h3>
Extrai os dados de um QR Code em uma imagem.

### Request</h4>
URL for POST: `https://api.infosimples.com/api/v2/imagens/leitor/qr-code`



| Parameter     | Description                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| token*        | The token that will authenticate and authorize the request.                                                   |
| image_base64* | Arquivo (foto ou documento digitalizado) contendo o QR Code, convertido 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",
    "api_version_full": "2.2.21-20241008170350",
    "product": "Imagens",
    "service": "leitor/qr-code",
    "parameters": {
      "image_base64_md5": "bf12fd72075cf2eb64c38dd6c7453cd9"
    },
    "client_name": "Minha Empresa",
    "token_name": "Token de Produção",
    "billable": true,
    "price": "0.02",
    "requested_at": "2024-10-11T16:03:27.000-03:00",
    "elapsed_time_in_milliseconds": 758,
    "remote_ip": "111.111.111.111",
    "signature": "U2FsdGVkX19wGRvw9EqHjShZWaAxuCYIZL8ls+5/BinkDSSRFgMSvuuVDVbYPbkDzMaQskSVfa4cQmfq25fhcw=="
  },
  "data_count": 1,
  "data": [
    {
      "conseguiu_decodificar": true,
      "conteudo": "Exemplo de Texto",
      "keypoints": [
        [
          0.7657,
          0.5906
        ],
        [
          0.8664,
          0.5906
        ],
        [
          0.8585,
          0.6516
        ],
        [
          0.7657,
          0.6516
        ]
      ],
      "score": 0.8028,
      "valor_base64": "imagem_codificada_em_base64"
    }
  ],
  "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/leitor/qr-code'
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.
