Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 3 4 5

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

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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.

Hello @yuyang

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

@yuyang

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvotes
Accepted
18.2k 21 13 21

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 512.0 KiB each and 1.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
1.6k 3 2 3

@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 512.0 KiB each and 1.0 MiB total.

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.