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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

Historical Index constituents Python API

Hello, I am looking to build a query that returns an Index constituents for a given date, historically, using the Python API eikon package.

I am using the following code:

df, err = ek.get_data(
    instruments = ['0#.SPX'],
    fields = ['TR.IndexConstituentRIC',
              'TR.IndexConstituentName'],
    parameters = {
        'SDate':'1996-01-02'
    }
)

However, the above works up to year 2000 or so, but returns bad request for, e.g., 1996.

The objective for me is to retrieve the components, yearly, all the way back to 1980's and for the SP500 and FTSE All World Indexes.

How would i do so?


Many thanks

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspace-data-apiindexconstituents
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.

1 Answer

Upvote
Accepted
7.6k 10 6 8

@mihalis.panczyk Thanks for your question - so historical index constituent coverage varies by index - this is a more detailed content question and is best checked with the appropriate content team by raising a ticket on Contact Us marking it a Content Query. Be sure to put all the RICs you want the earliest dates for and they will be able to check those for you. Your code is of course working fine. I hope this can help.

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.