Trying to execute code from CODEBOOK to a python file, ERROR "Your request is prohibited because ...

...the request is on loopback from external IP."

Hello, I am playing with the codebook, I am trying to use the same code to a .py file, whenever I execute the file, it gives me an error saying: "

Your request is prohibited because the request is on loopback from external IP.

Here an example of what I am doing.

import refinitiv.dataplatform.eikon as ek
from datetime import datetime, timedelta
ek.set_app_key('My_Key')
#Reinvestment Rate
RRuson=ek.get_timeseries(['USONFFE='],start_date="2020-10-23",end_date="2020-10-23")['CLOSE'].values[0]

ERROR:

<HEAD><TITLE>Request on loopback from external IP</TITLE></HEAD>
<BODY BGCOLOR="white" FGCOLOR="black"><H1>Request on loopback from external IP</H1><HR>
<FONT FACE="Helvetica,Arial"><B>
Description: Your request is prohibited because the request is on loopback from external IP.</B></FONT>
<HR>
<!-- default "Request on loopback from external IP" response (400) -->
</BODY>

Thanks

Best Answer

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    Answer ✓

    @luis.gonzalez

    Thank you for the logs. Now I think I have a reasonably good idea about your case. The fact that you reproduce the same error using Internet browser clearly indicates that the problem is not within your Python environment. It must be due to your proxy settings. What's happening is that, even though the HTTP request is directed to the localhost, your HTTP proxy intercepts it. After intercepting the request the proxy returns the request to your machine, but now to Eikon API Proxy the request appears as coming from a remote machine (as it comes from the IP address of the HTTP proxy). Eikon API Proxy rejects the request with the error message that you've seen because it only allows the requests coming from the same machine.
    You need to configure your proxy settings to allow HTTP requests directed to the localhost to not be intercepted by your HTTP proxy.

Answers