How can I use API to authomatically download funds' holdings informations?

Hi everyone, I am a researcher at the Catholic University of Milan, currently working on a project that involves historical holdings data for U.S. actively managed mutual funds. Specifically, I require the full holdings information (not just the top 3 holdings) for all such mutual funds, on a quarterly basis over the past 20 years, if available. I would like to ask whether it is possible to retrieve this data using an API. Given the volume of data involved, I understand that it may not be feasible to extract everything in a single call. I would therefore like to ask if it is possible to build a Python routine to download the data in blocks (e.g., retrieving the full time series for 10 mutual funds at a time) and then append the results automatically—without having to perform the process manually. I have attached a screenshot of the code I have been using so far. Thank you in advance for your support. Best regards, Mema Myftar
Best Answers
-
Thank you for reaching out to us.
You can use the LSEG Data Library for Python to extract data.
However, there are some limitations to its usage, which are outlined on this page.
Sample code demonstrating the library's functionalities is available on GitHub.
Yes, you can split a single large request into smaller ones to avoid server processing timeouts.
1 -
You can see from the Data Item Browser tool that each field supports different parameters.
For example, the TR.FundName field doesn't support the StartNum, EndNum, SDate, EDate, and Frq parameters.
The TR.FundHoldingName field doesn't support the SDate, EDate, and Frq parameters.
If you use those fields in one request, the output will be like that. However, you can use the dataframe feature to fill in the fund name. For example:
df = ld.get_data( universe = ['LP40215045'], fields = [ 'TR.FundName', 'TR.FundHoldingName(StartNum=1,EndNum=200)', 'TR.FundHoldingRIC(StartNum=1,EndNum=200)', 'TR.FdInvestorPctPortfolio(SDate=2021-12-31,EDate=2024-12-31,StartNum=1,EndNum=200,Frq=Q)' ] ) df['Fund Name'] = df['Fund Name'][0] df
Regarding the split request, the sample code is available on the following discussions.
0
Answers
-
Thank you for your reply? Can you please give me an example with a split? and how can I use python to retrieve those data? I have never downloaded python using APIs.
To conclude, I would like also to ask which entry column should I use to obtain informations that I need.
This the code I used so far:import refinitiv.data as rd
rd.open_session()
df = rd.get_data(
universe = ['LP40215045'],
fields = [
'TR.FundName',
'TR.FundHoldingName(StartNum=1,EndNum=200)',
'TR.FundHoldingRIC(StartNum=1,EndNum=200)',
'TR.FdInvestorPctPortfolio(SDate=2021-12-31,EDate=2024-12-31,StartNum=1,EndNum=200,Frq=Q)'
]
)
display(df)
df.to_excel('provats.xlsx')
Best regards,Mema Myftar
0 -
I can run the code. The output looks like this.
You can use the Data Item Browser tool to search for fields and parameters.
Otherwise, you can contact the Helpdesk support team via LSEG Support and ask for the Excel formula, such as =RDP.Data, that can be used to retrieve the required data.
Then, we can use the same fields and parameters with the get_data method.
0 -
Thank you for your support. What software did you use to run the code?
As you can see from the output, the fund name does not appear in every row—it is only shown once and left blank in subsequent rows. Would it be possible to adjust the code or output structure so that the fund name is repeated in each row for easier processing?
Additionally, could you please provide an example of how to build a Python routine that splits a large request into smaller blocks, in order to avoid server-side processing timeouts?
For instance, I would like to retrieve full holdings for multiple mutual funds by querying 10 at a time, and then merge the results programmatically.
Thank you in advance.
Best regards,
Mema Myftar
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 697 Datastream
- 1.5K DSS
- 632 Eikon COM
- 5.2K Eikon Data APIs
- 12 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 4 Trading API
- 2.9K Elektron
- 1.4K EMA
- 256 ETA
- 563 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 281 Open PermID
- 46 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 749 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 123 Open DACS
- 1.1K RFA
- 107 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 96 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛