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

  • Hi @wenjun.xia ,

    According to the answer in this thread, my colleague mentioned that this report can not be retrieved using Eikon Data APIs or Eikon Excel.

    Plus, this forum is more for programming-type queries, rather than content queries. I would recommend you to contact the Eikon support team directly via MyRefinitiv. You can ask for the =TR formula in the Eikon Excel which can be used to retrieve this report and if the formula is available, we can apply it to the get_data method in Eikon Data API. That way a content specialist can work closely with you to find a way to get the required data.

    However, for this case, I've raised ticket number 11035306 to a content specialist team to confirm if it is possible to retrieve the data using Eikon Excel or Eikon Data API. I'll keep you updated

    Hope this could help.

  • Thank you. This is amazing!
  • You're most welcome :)