How to get all constituents of the ETF Index IEAC.L via Python API Script ?

I am currently using the following code to extract the RICs of the ETF index IEAC.L:

indices = ["IEAC.L"]

# ========================= # SECTION 3: GET CONSTITUENTS # =========================def get_constituents(index_rics):

   all_constituents = []

   for index in index_rics:

       print(f'Extracting constituents for {index}')

       result = rd.get_data([index], "TR.FundHoldingName;TR.FundHoldingRIC;TR.FundLatestFilingDate;TR.FundNumberOfShares;""TR.FundNumberOfSharesChanged;TR.FundPercentageOfFundAssets",

                            parameters={'EndNum': 4000})

      

       constituents = result['Holding RIC'][result['Holding RIC'].notna() & (result['Holding RIC'].str.strip() != '')].tolist()

       all_constituents.extend(constituents)

   return list(set(all_constituents))

constituents = get_constituents(indices)print(f'# Securities: {len(constituents)}')

My goal is to extract the RICs for this ETF (IEAC.L) on a monthly basis over a 10-year period. However, when I try to retrieve data for different dates, the API always returns the RICs corresponding to the latest available date (currently 31/05/2025).

Could you please assist me in identifying:

Which Codebook function or data fields allow me to extract the constituents for historical dates,

Or which parameter I should use to filter the holdings by a specific date, rather than always retrieving the latest holdings?

Answers

  • Hello @Huma,

    There used to be a field TR.ETPConstituentRIC, which would use start date as a parameter, but does not seem to exist anymore.

    ['TR.ETPConstituentRIC','TR.ETPConstituentWeightPercent'], parameters={'SDate': '2020-01-01'}

    For this question, it is best to raise a content ticket at LSEG MyAccount.