...ing Eikon API ?
For ticker (RIC) EFIV.N , I want to pull DERIVED HOLDINGS (Full Holdings). How can I pull that using Eikon API ? Below is the screenshot from Eikon.
anonymous user ,
Below is the Python code I tried to get the holdings for that ETF via Eikon API (my app key is removed) from the Codebook:
import refinitiv.dataplatform.eikon as ek# import eikon as ekimport pandas as pdek.set_app_key('xxxxxxxxxxxxxxxxxxxxxxxxxxxx')fund_holdings = ek.get_data('EFIV.N', ['TR.FundHoldingRIC','TR.FundHoldingName', 'TR.FundPercentageOfFundAssets', 'TR.FundNumberOfShares', 'TR.FundNumberOfSharesChanged'], {'Endnum':'5000'})print(fund_holdings)
I got the results below.
( Instrument Holding RIC Holding Name \0 EFIV.N AAPL.OQ APPLE INC ORD 1 EFIV.N MSFT.OQ MICROSOFT CORP ORD 2 EFIV.N AMZN.OQ AMAZON.COM INC ORD 3 EFIV.N NVDA.OQ NVIDIA CORP ORD 4 EFIV.N GOOGL.OQ ALPHABET INC CLASS A ORD .. ... ... ... 320 EFIV.N LNC.N LINCOLN NATIONAL CORP ORD 321 EFIV.N NWL.OQ NEWELL BRANDS INC ORD 322 EFIV.N NWS.OQ NEWS CORP ORD 323 EFIV.N USD CASH 324 EFIV.N OTHER ASSETS LESS LIABILITIES Percentage of Fund Assets Number of Shares Number of Shares Changed 0 9.7322 505385.0 39760.0 1 8.5397 254189.0 20020.0 2 4.3167 305148.0 24717.0 3 4.2761 84525.0 6650.0 4 2.8356 203155.0 15960.0 .. ... ... ... 320 0.0139 5298.0 420.0 321 0.0139 12840.0 980.0 322 0.0092 4075.0 350.0 323 0.0033 32454.75 23945.6 324 -0.0093 <NA> <NA> [325 rows x 6 columns], None)