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
3 0 0 1

Historical data for given data items

I want to extract the historical data for past 20 years through the following code, but still got only 1 row (with recent data). What would be the right way to do so?

import eikon as ek

instrument = 'USAW=ECIX'

parameters = {'SDate': '-20Y', 'EDate': '0Y', 'Frq': 'Y', 'Points': 20}

df, err = ek.get_data(instrument, ['ECON_ACT', 'CTBTR_1'], parameters)

print(df)

eikon-data-apipython#contenthistorical
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.

Hello @chirag.arora

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Hi @chirag.arora,

Please note that the answer below was marked as accepted. Do let us know if that's incorrect.

Upvotes
Accepted
5.8k 21 2 6

Hi @chirag.arora ,

I would suggest updating to the new library. Does this work?

import refinitiv.data as rd
rd.open_session()
rd.get_history(
    universe=['USAW=ECIX'],
    start='2004-01-01')


1709649882299.png


1709649882299.png (42.6 KiB)
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.

Upvotes
3 0 0 1

Thanks a lot, but how can I get the data for particular Data Items?

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.

@jonathan.legrand , I want the data for the data for following Data Item Codes:

['ECON_ACT','CTBTR_1']

Hi @chirag.arora ,

For information on how to field the fields you're after, I would suggest reading this article which refers to the DIB.

Upvotes
3 0 0 1

Thanks @jonathan.legrand. Also, is there any method through which I can get the list of all the fields for which the data can be extracted for a particular instrument?

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.

Hi @chirag.arora,

Yes, you can find such a list on the DIB, for which you can find training here.

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.