Could you please help me with modifying the Python code so that we can pass multiple RICs at once and retrieve data for all of them in a single function execution? We would like to avoid looping through each RIC individually, so any guidance on how to handle multiple RICs in one call would be appreciated.
import refinitiv.data as rd
rd.open_session()
ricName = "actv.n"
exchangeName = "New York Stock Exchange"
DB1 = rd.discovery.search(
view = rd.discovery.Views.EQUITY_QUOTES,
top = 10,
filter = "( SearchAllCategoryv2 eq 'Equities' and ((RIC eq 'actv.n') and ExchangeName xeq 'New York Stock Exchange'))",
select = "DTSubjectName,ExchangeName,RIC,IssueISIN,Gics,AssetState,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,RCSTRBC2012Leaf,RCSAssetCategoryLeaf,RCSCurrencyLeaf,ExDividendDate,CUSIP,CinCUSIP,SEDOL"
)
RICS = DB1['RIC'].tolist()
rd.get_data(
universe = RICS,
fields = ['TR.CommonName','TR.RetireDate']
)
—-
To give you an idea, we are trying to do the same function from Workspace Excel to API.
The formula in WS Excel is applied per instrument listed in column B. This setup works seamlessly in Workspace Excel as it allows us to expand the formula across the remaining instruments efficiently.