Are you sure the code below is the one which is causing the error?
If you place the entire code, might be helpfull
response = requests.get("http://www.testecliente.com.br/ApiTeste/GetDadosCartaoCliente?CL_COD=1" ) retorno = response.content retorno = retorno.decode("utf-8") json_data = json.loads(retorno) CL_NOME = json_data['CL_NOME'] print ("NOME=" + CL_NOME)I'm asking because in your GET request you are sending CL_COD=1, but when you say you print json_data it shows CL_COD = 40
If you place the entire code, might be helpfull