For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 1

How do I use the Eikon API to get detailed ETF position data?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvotes
Accepted
18k 21 12 20

Hi @yuyang

You can use "CODECR" application in Eikon to check for the available fields.


From your provided screenshot, here is the sample code:

df, err = ek.get_data(
    instruments = ['ARKK.K'],
    fields = [
        'TR.ETPConstituentRIC',
        'TR.ETPConstituentName',
        'TR.ETPConstituentShares',
        'TR.ETPConstituentWeightPercent'
    ],
    parameters = {'SDate': '2021-04-30'}
)
df = df.sort_values('Weight percent', ascending=False)
df.head(10)



ahs.jpg (170.7 KiB)
ahs2.jpg (90.3 KiB)
icon clock
10 |1500

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

Thank you for your reply. When I used this method to obtain ETF positions, I often found that I could not request data but returned NaN. Could you please tell me what happened?

@yuyang

You may verify the data by using Eikon Excel with the formula builder. If the data in the Eikon Excel is also NaN, it could be a content issue. You should directly contact the content support via MyRefinitiv to verify the problem.

Upvotes
707 2 1 1

@yuyang, Firstly, you may need to find the Lipper ID for that ETF, in your sample case, the ARK Innovative ETF is 40209693, hence the ID used for Eikon is "LP40209693". Then the following call will return the latest holdings:

fund_holdings = ek.get_data('LP40209693', ['TR.FundHoldingRIC','TR.FundHoldingName','TR.FundPercentageOfFundAssets','TR.FundNumberOfShares','TR.FundNumberOfSharesChanged'],{'Endnum':'5000'})
icon clock
10 |1500

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

Click below to post an Idea Post Idea