For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
Hi All, i am currently using the below piece of code to get fx rate using eikon API but it gives me the latest fx rate for the given ric, say I want to know fx rate for a specific timezone and date, how can I retrieve it ?
ek.set_app_key('************') df, err = ek.get_data( ['JPY='],['TR.RIC','BID','ASK'] ) df['Mid']=df.mean(axis=1) print(df)
You can look into get_timeseries API call to get granular timeseries data. The bar data can be rolled up into minutes using:
df = ek.get_timeseries("JPY=", count = 5, start_date = "2022-05-12T15:00:00", interval="minute")
other option for minutes parameter are:
'tick', 'minute', 'hour', 'daily', 'weekly', 'monthly', 'quarterly', 'yearly'
Hi @Atul.Sanwal,
The Eikon API only provides data in UTC. For other timezones, you will have to convert the local timezone into UTC before requesting the data.
To get a data point at a particular point-in-time, use the fields which allow history. This can be seen from the Data Item Browser (DIB).
Here is an example:
df, err = ek.get_data(['JPY='],['TR.ASKPRICE', 'TR.BIDPRICE', 'TR.ASKPRICE.Timestamp'], {'SDate': '2022-05-01'}) display(df)
Response:
df, err = ek.get_data(['JPY='],['TR.ASKPRICE', 'TR.BIDPRICE', 'TR.ASKPRICE.Timestamp'], {'SDate': '2022-05-12T15:00:00'}) i tried the above but getting NAN values