Can't get API to work in local script (works in codebook)
Trying to fetch some historical data from Eikon API. I am running the following code:
# Importing libraries
import eikon as ek
import datetime
import pandas as pd
ek.set_app_key('MY APP KEY')
# Defining start time for the data series
start = datetime.datetime.now() - datetime.timedelta(days=1) # 1 day ago
end = datetime.datetime.now()
# Defining lists with RIC's under interest
rics = ['US10YT=RR']
# Fetching intraday time series data with 1-minute intervals
data = ek.get_timeseries(rics, start_date=start, end_date=end, interval='minute', fields="CLOSE")
print(data)
This works in the codebook editor in the application, where I get the wanted output. However, when I try to run this script on my local device I get the following error:
2023-12-13 15:56:01,612 P[33280] [MainThread 26372] HTTP request failed: EikonError-Client Error: <!-- IE friendly error message walkround.
if error message from server is less than
512 bytes IE v5+ will use its own error
message instead of the one returned by
server. -->
... Together with a lot of HTML code. It seems like it somehow connects, since I don't get an error, but I don't get the data either. Is there a solution for this?
Best Answer
-
Ok, next step is to check if how local Eikon API Proxy manages timeseries request.
As @aramyan.h suggested, you can read this article on troubleshooting, especially section 1) Check Desktop Applications. The SxS log file should contains errors.
One common issue could be due to user proxy:
- check your proxy settings to retrieve the ip address
- create HTTP_PROXY and/or HTTPS_PROXY environment variables (https://www.python-httpx.org/environment_variables/#http_proxy-https_proxy-all_proxy)
Note that Eikon Desktop need it in its environment.
0
Answers
-
Hi @aramyan.h, yes I have.
0 -
Hi @jubu ,
This might be a proxy/firewall related issue which you would need to ask your IT team to whitelist. There are two similar questions in the portal, please check this and this. And have a look also at this article on troubleshooting.
Hope this will help you to resolve the issue.
Best regards,
Haykaz
0 -
Hi @jubu ,
Before investigating, can the following code be used to check whether the session has been successfully initialised?
# Importing libraries
import eikon as ek
import datetime
import pandas as pd
ek.set_app_key('MY APP KEY')
print(ek.get_desktop_session().get_open_state())
# Defining start time for the data series
start = datetime.datetime.now() - datetime.timedelta(days=1) # 1 day ago
end = datetime.datetime.now()
# Defining lists with RIC's under interest
rics = ['US10YT=RR']
# Fetching intraday time series data with 1-minute intervals
data = ek.get_timeseries(rics, start_date=start, end_date=end, interval='minute', fields="CLOSE")
print(data)It should display:
State.Open
0 -
Hi pf, your code works and it does indeed print "State.Open".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 中文论坛