How can I use the python API interface to find the codes and names of all ETFs listed on a certai...

...n 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?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @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


Answers