question

Upvote
Accepted
30 8 10 14

How to get historical holdings and allocation data for funds?

How to get monthly or quarterly changes in a fund holdings, sector and country allocations? With the below code I'm only able to get the recent holdings and not the historical holdings.


Python

column_fields = [
    "TR.FundHoldingRIC",
    "TR.FundHoldingName",
    "TR.FundPercentageOfFundAssets",
]
refinitiv_data, err = ek.get_data(["SPY"], column_fields, date_paremters)
refinitiv_data


How to get the same historical weights for the below allocations?

Asset allocation -> ["TR.FundAssetAllocation", "TR.FundAllocationName"]

Country allocation -> ["TR.FundCountryAllocation", "TR.FundAllocationName"]

Sector allocation -> ["TR.FundIndustrySectorAllocation", "TR.FundAllocationName"]

eikon-data-api#technologypython apifundseikonapp
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
1.8k 3 3 4

Hi @BlackBird, I do not think the Eikon data API for Lipper (i.e. field name starts with "TR.Fund") can provide historical data currently. Because I do not see date parameters for these fields from Data Item Browser.

I know the RDP Funds API can can provide that.

However, if you only interested in ETFs, I am aware the constituent data is available from the Refinitiv's exchange data (not from Lipper I believe). Below is a sample code you can try. The sample is getting the data as of the month-end date 2 months ago. You can put in the exact date if you want, and I think they got daily data for most of ETFs. I am not sure if you can specify a date range. Also, I do not think the "allocations" data is available from Exchange data set, as allocations is likely only available from Lipper database.


df, err = ek.get_data(
    instruments = ['SPY'],
    fields = [
        'TR.ETPConstituentRIC',
        'TR.ETPConstituentName',
        'TR.ETPConstituentWeightPercent',
        'TR.ETPConstituentWeightPercent.Date'
    ],
    parameters = {'SDate': '-2M'}
)
df
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi, regarding what was written above "I know the RDP Funds API can can provide that." could you please let me know how this could be done? I.e. reproduce the code you provided above with an SDate of -2M but for a non-ETF product, such as the following ID: LP40065886, and using the RDP Funds API? Many thanks in advance

Below is the REST GET query to get the holdings latest data for your sample fund:

https://api.refinitiv.com/data/funds/v1/assets?symbols=LP40065886&properties=holdings

You can add the start and end dates to get historical data like:


https://api.refinitiv.com/data/funds/v1/assets?symbols=LP40065886&properties=holdings[start:2024-03-31;end:2024-07-31]

** The queries above did escape the special characters for URL, you need to escape these characters such as ";", "[" and "]", etc, if you want to try in API Playground.

Notes, the full holdings data is very large, if you try to get historical data, it may be better to do multiple queries for smaller chuck of periods.

Thanks @bob.lee , that's very helpful, I'll test it and come back in case I need more help.
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.