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?
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
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?
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:
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
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:
You can find more information about the Search API from the following resources:
Hi @cheyx
The script retrieves funds codes with "RIC" data item.
If these are not the codes you need, please specify.