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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 0

Constituent list and weight for .SPX using Python API

Raising this query in behalf of the external client Giang Le (User ID giang.le@tgm-au.com) from Tactical Global Management Ltd. He is seeking assistance on how to retrieve constituent list and weight for .SPX using Python API

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonindex
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
6.7k 8 6 7

@romerson.gadil21 please see the code below:

For current constituents/weightings:

df, err = ek.get_data('0#.SPX', ['TR.IndexConstituentWeightPercent.date','TR.IndexConstituentWeightPercent'])
df

For historical constituents/weightings you need to add a Sdate parameter:

df, err = ek.get_data('0#.SPX', ['TR.IndexConstituentWeightPercent.date','TR.IndexConstituentWeightPercent'],{'Sdate':'2020-03-12'})   
df

I hope this can help. NB Historical constituents are not available for all indices.


1599818106043.png (108.9 KiB)
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.

Thank you Jayson. My apologies. I missed to add. The client only has delayed access for this RIC. Would it matter?

@romerson.gadil21 I'm not sure - I don't think it should matter as the information is coming from a non-realtime source. Ask the client to try it and see.

Click below to post an Idea Post Idea