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.
Best Answer
-
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,
- you can either set it in Configuration file by set parameter 'Default' in line 15 to desktop.workspace, then put your app key on line 36
- or use the code below - More information regarding RD library sessions can be found here
rd.open_session(app_key = 'YOUR_APP_KEY)
Hope this helps and please let me know in case you have any further questions
1
Answers
-
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"])0 -
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
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?
0 -
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.
0 -
@lukasz.trzcinski0
They are different environments.
The client can enable the debug log in the library to verify what the problem is.
0 -
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') ?
0 -
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,
0 -
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
0 -
Hi again,
Do you have any idea please why I'am getting this error ?
And when checking this URL via Chrome :
Thanks in advance !
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛