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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted

How to retrieve the RICs of Index Constituents for NASDAQ and NYSE using the Eikon Python API?

I need to get all the RICs thats are listed on the NASDAQ and the NYSE. I've tried using the API to pull all the RICS associated with the MIC XNAS (NaSDAq) but it's not returning anything.

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonapi
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
39.3k 76 11 27

.NDX in the answer by @chavalit.jintamalit is the RIC for Nasdaq 100 index. To get the list of Nasdaq stocks you want to use Nasdaq Composite index (the RIC is .IXIC).
Alternatively you can use the Screener, which provides a lot of flexibility for what you want and don't want to include in the results. E.g. the following expression returns the most complete NYSE stocks listing including ADRs, prefs etc.

ek.get_data('SCREEN(U(IN(Equity(active,public,' +
            'countryprimaryquote))),' + 
            'IN(TR.ExchangeMarketIdCode,"XNYS"))',
            ['TR.CommonName'])
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
11.7k 57 39 60

Hi @Clifford Marshall.Ablaza,

I'm not sure if there is a way to retrieve the entire set of RICs listed on an exchange. The best way to find out if such a RIC exists or if this is even possible is to direct content questions to the Refinitiv Helpdesk.

What is available is to retrieve constituents for a specific index on an exchange. For example, here are couple of examples of index on the NASDAQ and NYSE:


ahs.png (12.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.

Upvotes
18.1k 21 12 20

Hi @Clifford Marshall.Ablaza

You can try this code:

df1,e1 = ek.get_data('0#.NYA','DSPLY_NAME')
df2,e2 = ek.get_data('0#.NDX','DSPLY_NAME')
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.