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

Best Answer

  • chavalit-jintamalit
    Answer ✓

    Hi @yuyang

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

    image


    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)

    image


Answers