Can I get investor portfolio history report (INVPORTHIST) via Eikon API

I want to pull out data in the snapshot using Eikon API.

Thanks in advance

capture.png

Tagged:

Best Answer

  • raksina.samasiri
    Answer ✓

    hi @wenjun.xia ,

    To retrieve the same data with the Investor Portfolio History Report app, the code below can be used

    import eikon as ek
    ek.set_app_key('#### Your Eikon App key ####')

    df, err = ek.get_data(
    instruments = ['6902.T'],
    fields = ['TR.SecurityOwnedRIC'
    ,'TR.SecurityOwnedName'
    ,'TR.InvestorValueHeld'
    ,'TR.InvestorValueHeld.calcdate'
    ,'TR.InvestorSharesHeld'
    ,'TR.InvestorPctPortfolio'
    ,'TR.PctSecuritySharesOut'
    ,'TR.InvestorFilingDate'],
    parameters = {'Scale':'6', 'Curn':'USD'}
    )

    display(df)

    Here's an output

    1647257949892.png

    To get the value on a specific date, parameter 'SDate' can be used, for example

    df, err = ek.get_data(
    instruments = ['6902.T'],
    fields = ['TR.SecurityOwnedRIC'
    ,'TR.SecurityOwnedName'
    ,'TR.InvestorValueHeld'
    ,'TR.InvestorValueHeld.calcdate'
    ,'TR.InvestorSharesHeld'
    ,'TR.InvestorPctPortfolio'
    ,'TR.PctSecuritySharesOut'
    ,'TR.InvestorFilingDate'],
    parameters = {'Scale':'6', 'Curn':'USD', 'SDate':'2021-09-30'}
    )

    display(df)

    1647258022960.png

    Hope this could help, please let me know in case you have any further question

Answers