For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

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

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonerrorcodebook
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
39.2k 75 11 27

@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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
39.2k 75 11 27

@luis.gonzalez

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Hi, i am just executing the code on vs code and spyder, I am trying to do an automated process to save certain values around 5 PM

Is Eikon desktop application running on the machine where you execute your Python code? Eikon Data APIs have runtime dependency on Eikon desktop application. Note that it has to be Eikon desktop application, not Eikon Web that you can access through a browser.

Yes, Eikon desktop application is running

OK, now that we've covered the basics, could you tell me how you experience the error? Do you see any exceptions raised? If yes, which line of code raises the exception and can you include the traceback? Where does the HTML with the error message in your original post come from? I'm struggling to understand how any error could have manifested as HTML in your scenario. Perhaps you could include a screenshot of the result of your code execution in VS Code? And also try increasing the logging level in RDP Library. Add ek.set_log_level(5) after ek.set_app_key.

Finally, instead of using RDP Library, try using Eikon Data APIs library. Both libraries should work, but Eikon Data APIs library may be better for troubleshooting until we figure out what's wrong. To use Eikon Data APIs library follow the Quick Start Guide on this portal.

Show more comments
Upvotes
39.2k 75 11 27

@luis.gonzalez

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Hello, i run http://127.0.0.1:9060/api/status on my machine and says:

Request on loopback from external IP

here are the log files requested.

logs.zip


logs.zip (3.2 KiB)
Click below to post an Idea Post Idea