question

Upvotes
Accepted
3 0 1 2

Get ETF Holdings using RDP Python Library

Hi, I am trying to get the holdings for an ETF using the RDP Python Library but I keep getting a `None` response. Here is my code:


import refinitiv.dataplatform as rdp
import pandas as pd


rdp.open_platform_session(
    'APP_KEY', 
    rdp.GrantPassword(
        'MY_USERNAME', 
        'MY_PASSWORD'
    )
)

x = rdp.get_data(universe='IWM',fields= ['TR.FundHoldingRIC','TR.FundHoldingName',
'TR.FundPercentageOfFundAssets',
'TR.FundNumberOfShares',
'TR.FundNumberOfSharesChanged'])#, {'SDate': '2021-01-01'})
print(x)

In this case, `x=None`. Could not find any documentation for how to retrieve this data using the RDP library. I know it can be pulled using Eikon, but I don't want to have to have it open in the background. I would like direct api access to the holdings using nothing but the key

pythonrdp-apirefinitiv-data-platformrefinitiv-data-platform-libraries
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

Upvotes
Accepted
762 2 1 1

Hi @youssef.ishak, Your code sample is what I typically called "Eikon API", and I doubt Eikon API can allow you access these funds data without Eikon/Workspace running at the background. There is a separate service called RDP Funds API that allows you do that. It is a REST API that you just send queries to the external server and get the responses (results back) via the HTTPS protocol. But that is a sperate services requires separate license.

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 @b.lee, I have access to the RDP Funds API, but can only find an endpoint for the top holdings in the API Developer Guide. Is there any way to get all holdings?

Hi @youssef.ishak , the API endpoint is the same, just that you need to use a different property in the request query. If your license supports the full-holdings data, you should able to get it. I tried the query below and it successfully returned the full-holdings of that ETF. Due to the file upload limit, I can only attach the historical data for 2 months.


https://api.refinitiv.com/data/funds/v1/assets?symbols=IWM&properties=holdings[start:2021-06-01]
Thanks @b.lee that did it for me