Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

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-apirefinitiv-dataplatform-eikonworkspaceworkspace-data-apifutures
icon clock
10 |1500

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

@chinmayjokhla

Thank you for your participation in the forum. Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply that best answers your question. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

@chinmayjokhla

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
5.8k 21 2 6

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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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