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