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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

component of indexes like the S&P 500 or the Sub Index

How can I find the component of indexes like the S&P 500 or the Sub Index and access them in Python through the jupyter notebook?

How can I write a define a screener and have the results returned in a jupyter notebook?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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.

Upvotes
Accepted
6.7k 8 6 7

Hi @nikolas - Thank for your question. Refinitiv maintains a number of chain RICs which provide the constituents of many indices as well as options and futures chains. Please use the following code to get the constituents of the SPX.

df,err = ek.get_data(['0#.SPX'], ['CF_NAME'])
df

To find the chain RICs for subsectors you can just add a 0# infront of say .SPLRCTELP which is the Integrated Telecommunications Services sub index.

I hope this can help.


1602173434722.png (91.8 KiB)
1602174065404.png (40.6 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.

Upvotes
1 0 0 1
Thanks for that. What if you want to add market cap or some other values available in a screener?
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.

@nikolas just add the fields in as you want - you can see a full list of fields available using the Data Item Browser App (type DIB into Eikon search bar):

df,err = ek.get_data(['0#.SPLRCTELP'], ['CF_NAME','TR.CompanyMarketCap'])
df

1602174928257.png (29.5 KiB)
Upvote
6.7k 8 6 7

@nikolas and if you want to do more complicated screenings based on multiple criteria please see this article on how to use the screener to generate a universe and then pass that as an instrument list to the get_data API call.

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.

Click below to post an Idea Post Idea