Retrieve historical time series using refinitiv.data library

Hi,
I understand that Eikon will be withdrawn in June 2025. Hence I am trying to migrate my code from Eikon library to the new refinitiv.data library. Using the old Eikon api, I deployed the following code to download exchange rates between MYR and VND
df= eikon.get_timeseries(['MYRVND=R'],['Close'],start_date='2022-12-27',end_date='2023-04-24')
I tried the following code:
import refinitiv.data as rd
rd.open_session()
df = rd.get_history(universe='SGDVND=R',fields='CLOSE',interval='daily',start='2022-12-27', end='2023-04-24')
print(df)
The following error message was displayed.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "\get_history_func.py", line 206, in get_history
raise RDError(-1, except_msg)
refinitiv.data._errors.RDError: Error code -1 | No data to return, please check errors: ERROR: No successful response.
(403, <html>
<head>
<title>Forbidden</title>
<style type="text/css">
body {
background-color: #242424;
color: #c8c7c7;
font-family: Calibri, Helvetica, Arial, sans-serif;
font-size: 16px;
}
</style>
</head>
<!-- Response
Server: SGWP-ERPA07
Date: Wed, 12 Feb 2025 08:35:47 GMT
HTTP Code: 403
HTTP Response: Forbidden
X-Varnish: 148014339
Backend: default
-->
<body>
<h1>Forbidden</h1>
<p>Invalid token</p>
</body>
</html>)
Can anyone help?
Thanks
Answers
-
@yaoyang.teo Thanks for your question. So whilst Eikon is being retired - its replacement Workspace will still support Eikon Data API codebase from the Refinitiv-Data Library. Its there already as follows:
import refinitiv.data.eikon as ek
import datetime ek.set_app_key('YOUR APP KEY HERE')df= ek.get_timeseries(['MYRVND=R'],['Close'],start_date='2022-12-27',end_date='2023-04-24') df
or you can use our newest LSEG Data Library (pip install lseg-data).
import lseg.data as ld ld.open_session()
df = ld.get_history("MYRVND=R",fields='BID',start='2022-12-27',end='2023-04-24') df
I hope this can help.
0 -
Hi @yaoyang.teo ,
You can also use ld.get_history without fields parameter specified, this way you will be able to see all available fields of historical data of each instrument then you can pick the one you're interested in.
Regarding the library upgrade, here's the related articles
0 -
Hi,
The LSEG.DATA library does not seem to allow me to get the 'CLOSE' field. Is there anyway for me to get the 'CLOSE' field and not the 'BID' field?
Thanks
0 -
As far as I know, the BID field from the get_history method represents the BID CLOSE while the ASK field respresents the ASK CLOSE.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛