How to get historical times series for Central Bank of Russia key rate with Eikon API in Python?
Good afternoon!
I need to download historical values of Central Bank of Russia key rate from 2014 till today with Eikon Data API in Python. How can I do this?
I have found three rics for this key rate:
- RUKEYRATE=CBRF
- RUCBIR=ECI
- RUCBIR=ECIX
I decided to use the first, because I can not find any fields for the other two in Data Item Browser.
My code in Python:
today_str = datetime.strftime(datetime.today(), format="%Y-%m-%d")
keyRate, err = ek.get_data(instruments=['RUKEYRATE=CBRF'],
fields={'CF_CLOSE':{'SDate':'2014-01-01',
'EDate':today_str}})
keyRate
When I use 'CF_CLOSE' in fields parameter, NaN is returned; 'CF_LAST' returns only last value of the key rate, and I need historical time series.
Any help is appreciated.
@Alex Putkov. would be great if you could give some advice.
Best Answer
-
The CF_LAST and CF_CLOSE fields are real-time fields that don't provide time-series data with the get_data method.
You need to use fields that support time-series such as TR.ClosePrice. From my checking, the TR.ClosePrice field is not available for those RICs. You can re-verify it by using the Data Item Browser. Otherwise, you can directly contact the content support team via MyRefinitiv to verify it.
However, I can retrieve time-series data of those RICs via the get_timeseries method.
df = ek.get_timeseries(['RUKEYRATE=CBRF'],
start_date = "2014-01-01",
end_date=today_str,
interval="daily")RUCBIR=ECI and RUCBIR=ECIX don't support the daily interval so I change the interval to monthly.
df = ek.get_timeseries(['RUCBIR=ECI','RUCBIR=ECIX'],
start_date = "2014-01-01",
end_date=today_str,
interval="monthly")The get_timeseries method has data limitations, as mentioned in the Eikon Data API Usage and Limits Guideline.
2
Answers
-
Hi @lozovoy.hse ,
I would advise searching for fields on the DIB that do not have blank values by ticking the 'Blank Values' box in the settings on the top right:
You can also filter through time series fields only. Doing this, I found that this instrument does not lend itself well to the Python EDAPI, it is more meant for real time analysis; I'm guessing that this is not the kind of analysis you have in mind.
May I advise using Datastream? Or is that not an option?
On Datastream, you can have such historical data-sets0 -
@jonathan.legrand Thank you for immediate response, but I have no access to Datastream.
@jirapongse.phuriphanvichai Thank you very much! The code works fine, I can download what I needed.
0
Categories
- All Categories
- 6 AHS
- 39 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
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛