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

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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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.

Upvotes
Accepted
10.1k 18 6 9

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 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 2 3
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 512.0 KiB each and 1.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
10.1k 18 6 9

@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 512.0 KiB each and 1.0 MiB total.

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.