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

How can I use the python API interface to find the codes and names of all ETFs listed on a certain exchange, such as the National Exchange of India?

How can I use the python API interface to find the codes and names of all ETFs listed on a certain exchange, such as the National Exchange of India?

#technologypython 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.

Hello @cheyx

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


Upvote
Accepted
79.2k 251 52 74

@cheyx

Yes, you can use the Search API in the Refinitiv Data Library to search for instruments.

For ETFs in National Stock Exchange of India, the code should look like this:

df = rd.discovery.search(
    view = rd.discovery.Views.FUND_QUOTES,
    filter = "AssetCategory eq 'ETF' and ExchangeName eq 'National Stock Exchange of India'",
    select = "DocumentTitle,AssetCategory,DTSimpleType,ExchangeName,RIC,IssueISIN,AssetStateName,IssueCommonName",
    top = 5000)
df

The output is:

1710303200972.png

You can also use the following code to list all available fields in the FUND_QUOTES view.

from refinitiv.data.content import search
response = search.metadata.Definition(
    view = search.Views.FUND_QUOTES  
).get_data()

response.data.df

1710303305543.png



1710303200972.png (40.5 KiB)
1710303305543.png (18.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. But is it possible to use eikon python API to find the codes?


Answered in this discussion.

Upvote
24.7k 54 17 14

Hello @cheyx

There is the Search API of the Data Library for Python. Is it what you need?

Example Code:

rd.discovery.search(
    view = rd.discovery.Views.EQUITY_QUOTES,
    top = 100,
    filter = "(SearchAllCategoryv2 eq 'Equities' and ExchangeName eq 'National Exchange of India')",
    select = "DTSubjectName,ExchangeName,RIC",
    order_by = "AvgVol5D desc"
)

Result:

result.png

You can find more information about the Search API from the following resources:


result.png (46.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
51 0 0 2

Hi @cheyx

The script retrieves funds codes with "RIC" data item.

If these are not the codes you need, please specify.

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.