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

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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiindex
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 @romerson.gadil21

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


1 Answer

· Write an Answer
Upvotes
Accepted
10.2k 18 6 9

@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 512.0 KiB each and 1.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.

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.