## OCR / Nota Fiscal de Serviço / PE / Recife</h3>
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).

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



| Parameter     | Description                                                                        |
| ------------- | ---------------------------------------------------------------------------------- |
| token*        | The token that will authenticate and authorize the request.                        |
| image_base64* | Arquivo de imagem ou PDF da NFS-e 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
"Houve um problema ao carregar este exemplo de resposta. Entre em contato com suporte@infosimples.com.br."
````

### 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/nfse/pe/recife'
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.
