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
<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>
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.
How do you execute your .py file? As as quick test I just created a file named APTest.py in the root of my Codebook directory with the code I copied from your post. Then I opened a Jupyter notebook from the root of my Codebook directory and executed the following code in a Jupyter notebook cell
import APTest as t print(t.RRuson)
The value of the Fed Funds effective rate was printed as expected.
Thank you very much for the screenshots, they are most useful. I'm afraid this is a very puzzling issue. Nothing like I've seen before. To dig a bit deeper, could you try entering the following in the address bar of the Internet browser on the machine where you run your Python code and share the response: http://127.0.0.1:9060/api/status
I will also need a couple of log files from Eikon desktop application. Please see Chapter 3 "Verify that Eikon Desktop is running properly and APIPROXY service is enabled" in this article. It contains instructions for enabling logging in Eikon application. The specific log files I'm interested in are APIProxy.YYYYMMDD.HHMMSS000.pXXXX.txt and SxS.YYYYMMDD.HHMMSS000.pXXXX.txt. You will need to shut down Eikon, configure logging using Configuration Manager application, then start Eikon, run your Python script and then collect the above log files.