Retrieve LAST_QUOTE from Eikon API using python
I need to retrieve LAST_QUOTE data history using python and Eikon API. I want the same output as if using Eikon Excel call:
=RHistory(".IBBEU003D","LAST_QUOTE.Timestamp;LAST_QUOTE.Close","INTERVAL:1D NBROWS:25",,"TSREPEAT:NO")
It would be appreciated if the solution would work for similar data fields.
Best Answer
-
@fgaspar So the get_timeseries api call has a reduced datamodel - Open, High, Low, Close, Volume, Count. The Close field in that model is the same as CF_CLOSE - which you can find the description for in the Data Item Browser app. Unfortunately you cannot use the get_timeseries API to request any other fields as a timeseries history. You can use the get_data api call to retrieve non-realtime field history. Something like this would usually work (it does not with the RIC you wanted - see my note below regarding this instrument):
df, err = ek.get_data('VOD.L', fields = ['TR.PriceClose.date','TR.PriceClose','TR.Volume'],parameters={'SDate':'2019-12-01','Frq':'D','EDate':'2020-12-01'})
dfWe do however, have another route - which is the Refinitv Data Platform (RDP) APIs and their accompanying ease of use RDP Libraries (Python, Typescript and a community supported .NET version). Eikon users have access to many new services there such as Search APIs, Instrument Pricing and Analytics APIs & much more, and importantly in your case Historical Pricing APIs - these have an enhanced realtime data model of about 30 fields instead of the reduced get_timeseries data model. You can see examples of how to get started (pip install refinitiv.dataplatform) in the links above. You could try something as simple as:
import refinitiv.dataplatform as rdp
import pandas as pd
import numpy as np
session = rdp.open_desktop_session('YOUR EIKON APP KEY HERE')
rdp.get_historical_price_summaries('VOD.L')Now unfortunately - the RIC you were initially looking for .IBBEU003D is not yet available via this service, but many others will be - so it may help you in future.
In terms of Data Item Browser usage you should type in an instrument and then you can also get values. The instrument you were looking for is a contributed index which is using illogical Fields or FIDs - so it is slightly more complicated than more standard instruments. If you need more help with that particular instrument and field meanings or where things are located please open a ticket with our content support team using Contact Us in the main Eikon menu and specifying a content query.
I hope this can help.
1
Answers
-
@fgaspar - so if you are looking for just the latest value snapshot you can just us the following python call to our real-time fields (any realtime field - you can use the data item browser (type DIB into eikon search bar) to search for any field you like):
df,err = ek.get_data(".IBBEU003D",['CF_Date','CF_Time',"CF_Last"])
dfIf you want a timeseries history of this you can try:
df1 = ek.get_timeseries(".IBBEU003D",['CLOSE'],count=25,interval='daily') df1
The most recent value available is from 1-Feb so I'm not sure what time this is updated every day - maybe 18:25 each day as this seems to be an index. I hope this can help.
0 -
Could you please share how one can find the item codes needed? I am using Eikon Data Item Browser and I am unable to find "CLOSE"/"close" item and what I find is empty, please see the image:
I have similar issue in obtaining Mid Yield for the same identifier so I would like to know the way to resolve these task myself.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 6 Bot Platform
- 17 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
- 370 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 中文论坛