question

Upvotes
Accepted
1 0 1 4

Errors while requesting data using eikon and refinitiv-data librairies

Hi, while trying to get data from eikon API , I am getting the followings errors :

#using eikon library :

import eikon as ek

ek.set_app_key('DEFAULT_CODE_BOOK_APP_KEY')

import json

df = ek.get_timeseries(['EUR='],start_date="2023-11-24",end_date="2023-11-27")

print(df)


error : Error code 403 | Client Error: Forbidden by proxy


#using refinitiv.data library

import refinitiv.data as rd

rd.open_session()

df = rd.get_data(universe = ['EUR='],fields = ['CF_CLOSE'] )

print(df)


error : refinitiv.data._errors.RDError: Error code -1 | Cannot load the list of associated URLs from http://localhost:9060/api/rdp/streaming/pricing/v1/ for apis.streaming.pricing.endpoints.main endpoint.


I tried to test the scripts above using Codebook and it works fine.


any help please ? Thanks.

eikon-data-apirefinitiv-dataplatform-eikon#technology
icon clock
10 |1500

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

@malaouiismaili

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

@malaouiismaili

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvote
Accepted
14.2k 30 5 10

Hi @malaouiismaili ,

The log you attached mentioned that 'Your Internet experience is protected by Clearswift' which is blocking the connection to the Data API Proxy. Could you please check with your internal IT team to allow connection to localhost to be able to connect to the API proxy.

[2023-11-30T14:40:33.226458+01:00] - [sessions.desktop.workspace.0] - [DEBUG] - [15616 - MainThread] - [connection] - [debug] - Checking proxy url http://localhost:9005/api/status response : 403 -

To set app key when using RD library,

rd.open_session(app_key = 'YOUR_APP_KEY)

Hope this helps and please let me know in case you have any further questions

icon clock
10 |1500

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

Upvotes
79.2k 251 52 74

@malaouiismaili

Thank you for reaching out to us.

The Eikon Data API uses the 127.0.0.1 address to connect to the API proxy.

According to the error (error : Error code 403 | Client Error: Forbidden by proxy), this address may be blocked by your network settings. You may try to run the following code at the beginning.

import os
os.environ['NO_PROXY'] = 'localhost'
os.environ['NO_PROXY'] = '127.0.0.1'

Regarding the RD library, you can try the following code.

rd.get_history(universe="EUR=",
               count=10, 
               interval='1D',
               fields = ["BID", "BID_HIGH_1", "BID_LOW_1", "OPEN_BID", "NUM_BIDS"])


icon clock
10 |1500

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

Upvotes
1 0 1 4

Thank you @Jirapongse.

I tried your code and I am getting the following error :

refinitiv.data._errors.RDError: Error code -1 | No data to return, please check errors: ERROR: No successful response.

Any suggestions ? Thanks again

icon clock
10 |1500

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

@malaouiismaili

You can enable logging in the RD library to verify the behavior by using the following code.

import refinitiv.data as rd
rd.get_config()["logs.level"] = "debug"
rd.get_config()["logs.transports.file.enabled"] = True
rd.get_config()["logs.transports.file.name"] = "refinitiv-data-lib.log"
rd.open_session()

Then, check the refinitiv-data-lib.log file.

Upvotes
16 0 0 0

Hi @Jirapongse , all scripts are working well for @malaouiismaili in CODEBOOK, but it returns errrors while running via cmd or another IDE. Would you be able to help or is it internall user's issue which should be solved by local IT?

icon clock
10 |1500

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

@lukasz.trzcinski0

They are different environments.

The client can enable the debug log in the library to verify what the problem is.

Hello,

Thanks again for your answer.

I tested the following code like you suggested with debug mode :

import os
import refinitiv.data as rd
os.environ['NO_PROXY'] = 'localhost'
os.environ['NO_PROXY'] = '127.0.0.1'
rd.get_config()["logs.level"] = "debug"
rd.get_config()["logs.transports.file.enabled"] = True
rd.get_config()["logs.transports.file.name"] = "refinitiv-data-lib.log"


rd.open_session()
df = rd.get_history(universe="EUR=",
               count=10, 
               interval='1D',
               fields = ["BID", "BID_HIGH_1", "BID_LOW_1", "OPEN_BID", "NUM_BIDS"])
print(df)

Please find the log file below (I changed the extension to .txt, so it can uploaded)

20231130-1440-8968-refinitiv-data-lib.txt

Also, can I please know if we have to set the APP KEY when using refenitiv-data librairy, like we used to do with the eikon one (ek.set_app_key('DEFAULT_CODE_BOOK_APP_KEY') ?



Upvotes
1 0 1 4

Hi again,

I checked the issue with our local IT team.

They need the list of API adresses, so they can unblock them.

Many thanks,


icon clock
10 |1500

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

Hello @malaouiismaili

The proxy is the local Workspace/Eikon desktop application, so the IP Address is 127.0.0.1 (localhost) like @Jirapongse mentioned in the first comment.

For the IP Address of the RDP endpoint, they are as follows:

  • 75.2.0.254
  • 99.83.242.11
Upvotes
1 0 1 4

Hi again,

Do you have any idea please why I'am getting this error ?

sh.png

And when checking this URL via Chrome :

api.png


Thanks in advance !


sh.png (5.6 KiB)
api.png (8.8 KiB)
icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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