Retrieve dividend stock via Python Eikon API

In excel i am able to do the following query:

=TR(stockRIC,"TR.DivExDate;TR.DivType;TR.DivPaymentType;ZAV(TR.DivadjustedGross)","CH=Fd sdate=#1 edate=#2 curn=#3 SORTD=TR.DivExDate DateType=ED",$C$11:$F$92,sdate,edate,currency)

image

Which results in the following:

image

How can I do this in Python for a set of stocks? When I do a similar request in Python the dividend of 125 does not show, it give a 0 value.

Best Answer

  • anass.yazane.1
    anass.yazane.1 Contributor
    Answer ✓

    Hi

    Regarding your issue, you can used the following get_data function to retrieve the desired information

    >>> start='2019-01-01'
    >>> end='2019-03-11'
    >>> ric='PSN.L'
    >>> currency='GBp'

    data, err=ek.get_data(ric,['TR.DivExDate','Tr.DivType','TR.DivPaymentType','ZAV(TR.DivadjustedGross)'],parameters={'Sdate':start,'Edate':end, 'Curn':currency, 'dateType':'ED','SORTD':'TR.DivExDate'})

    Hope it help you.

Answers