get Dividend and Split from blapi via python
<p>I would like to get Dividend and Split from the python module to Bloomberg API (blapi) for some companies in the US (I am using a Screening to extract these companies). I am using the python module blapi : </p>

<pre><code>import blpapi

# Connect the bloomberg platform        
sessionOptions = blpapi.SessionOptions()
sessionOptions.setServerHost(bloomberg_host)
sessionOptions.setServerPort(bloomberg_port)
session = blpapi.Session(sessionOptions)

# Get the dividend and Split
refDataService = session.getService("//blp/refdata")
request = refDataService.createRequest("HistoricalDataRequest")
request.getElement("securities").appendValue("AAPL US Equity")
request.getElement("fields").appendValue("DVD_HIST_ALL")

request.set("periodicityAdjustment", "ACTUAL")
request.set("periodicitySelection", "DAILY")
request.set("startDate", "20140101")
request.set("endDate", "20141231")
request.set("maxDataPoints", 1)
</code></pre>

<p>But I get the following amswer : </p>

<pre><code>HistoricalDataResponse = {
    securityData = {
        security = "AAPL US Equity"
        eidData[] = {
        }
        sequenceNumber = 0
        fieldExceptions[] = {
            fieldExceptions = {
                fieldId = "DVD_HIST_ALL"
                errorInfo = {
                    source = "951::bbdbh5"
                    code = 1
                    category = "BAD_FLD"
                    message = "Not valid historical field"
                    subcategory = "NOT_APPLICABLE_TO_HIST_DATA"
                }
            }
        }
        fieldData[] = {
        }
    }
}
</code></pre>

<p>Looking at the documentation (blpapi-developers-guide) I see multiple request possibility (Reference Data Service, Market Data Service, API Field Information Service) but none of them explain how to get the dividend/split. I don't know which Service and which Request to use. </p>

<p>From the terminal these Dividend and Split and registered under the tag CACT if you use a screening and DVD if you look for the dividend/split of a currently loaded stock (I can loop over the companies I want in my code in worse case).</p>

<p>If someone knows how to do it you will illuminate my day!</p>