For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

Eikon get_data API not working for ex

I am trying to extract some data using Eikon Data API - the code is as follows, however i am not getting any prices from the below command


df, err = ek.get_data(

instruments = ['LCON1','LCOQ1'],

fields = [

'TR.CLOSEPRICE.date(Frq=D,SDate=-5Y,EDate=1D)',

'TR.CLOSEPRICE(Frq=D,SDate=-5Y,EDate=1D)'

]

)


display(df)

------------------------------------------------------------------------------------

df, err = ek.get_data(

instruments = [

'LCON1',

'LCOK2'

],

fields = [

'TR.CLOSEPRICE.timestamp(Frq=D,SDate=2021-05-04,EDate=2015-01-01)',

'TR.CLOSEPRICE(Frq=D,SDate=2021-05-04,EDate=2015-01-01)'

]

)


display(df)


------------------------------------------------------------


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonfutures
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
1.4k 6 2 2

Hi @chinmayjokhla,


Does the below output results you were expecting?


from datetime import datetime, timedelta

df1, err = ek.get_data(instruments = ['LCON1','LCOQ1'],
                      fields = ['TR.CLOSEPRICE.date',
                                'TR.CLOSEPRICE.timestamp',
                                'TR.CLOSEPRICE'],
                     parameters = {'SDate': '2020-02-01',
                                   'EDate': str(datetime.today())[:10],
                                   'FRQ': 'D'})

df1.dropna()
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea