getCorporateActions API

The getCorporateActions API provides corporate actions data on equities including Splits, Dividends and Earnings, based on a symbol.

All APIs

Contact Us to Get Access

Inputs

symbols required

A symbol or code that identifies a financial instrument.

Type
list (A comma or semi-colon delimited string.) 
Example
AMZN,AAPL 

startDate optional

The beginning date for the query.

Type
date (A date in the format of YYYY-MM-DD.) 
Example
2013-01-01 

endDate optional

The end date for the query.

Type
date (A date in the format of YYYY-MM-DD.) 
Example
2013-06-30 

eventType required

The type of event: "split", "dividend", "earnings".

Type
enum (A type which includes a list of valid possible values.) 
Example
dividend 

Valid Values:
split, dividend, earnings

maxRecords optional

The maximum number of records to return.

Type
int (A numeric type defining a whole number. (example: 2)) 
Example
Default
20 

Outputs

Name / Requirement
Description
Type
symbol
always returned
A symbol or code that identifies a financial instrument.
string
A sequence of characters. (example: GOOG)
eventDate
always returned
The date in which the event occurred.
date
A date in the format of YYYY-MM-DD.
eventType
always returned
The type of event.
string
A sequence of characters. (example: GOOG)
value
always returned
The split ratio, dividend amount or earnings amount.
double
A numeric type defining a number with fractional parts. (example: 2.14)

Status Code Responses

200
OK
Success
400
Bad Request
The request was invalid, please see the message for more information.
500
Internal Server Error
Something is not working correctly, please contact support.


JSON

GET

GET https://ondemand.websol.barchart.com/getCorporateActions.json?apikey=<YOUR API KEY>&symbols=AMZN%2CAAPL&startDate=2013-01-01&endDate=2013-06-30&eventType=dividend&maxRecords=5
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getCorporateActions.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=<YOUR API KEY>&symbols=AMZN%2CAAPL&startDate=2013-01-01&endDate=2013-06-30&eventType=dividend&maxRecords=5

Response

{
    "status": {
        "code": 200,
        "message": "Success."
    },
    "results": [
        {
            "symbol": "AAPL",
            "eventDate": "2013-05-09",
            "eventType": "Dividend",
            "value": 3.05
        },
        {
            "symbol": "AAPL",
            "eventDate": "2013-02-07",
            "eventType": "Dividend",
            "value": 2.65
        }
    ]
}

XML

GET

GET https://ondemand.websol.barchart.com/getCorporateActions.xml?apikey=<YOUR API KEY>&symbols=AMZN%2CAAPL&startDate=2013-01-01&endDate=2013-06-30&eventType=dividend&maxRecords=5
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getCorporateActions.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=<YOUR API KEY>&symbols=AMZN%2CAAPL&startDate=2013-01-01&endDate=2013-06-30&eventType=dividend&maxRecords=5

Response


<?xml version="1.0" encoding="utf-8"?>
 <getCorporateActions>
  <status>
   <code>200</code>
   <message>Success.</message>
  </status>
  <item>
   <symbol>AAPL</symbol>
   <eventDate>2013-05-09</eventDate>
   <eventType>Dividend</eventType>
   <value>3.05</value>
  </item>
  <item>
   <symbol>AAPL</symbol>
   <eventDate>2013-02-07</eventDate>
   <eventType>Dividend</eventType>
   <value>2.65</value>
  </item>
 </getCorporateActions>

CSV

GET

GET https://ondemand.websol.barchart.com/getCorporateActions.csv?apikey=<YOUR API KEY>&symbols=AMZN%2CAAPL&startDate=2013-01-01&endDate=2013-06-30&eventType=dividend&maxRecords=5
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getCorporateActions.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=<YOUR API KEY>&symbols=AMZN%2CAAPL&startDate=2013-01-01&endDate=2013-06-30&eventType=dividend&maxRecords=5

Response

symbol,eventDate,eventType,value
"AAPL","2013-05-09","Dividend","3.05"
"AAPL","2013-02-07","Dividend","2.65"


PHP

<?php

$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');

$params = [
    'symbols' => 'AMZN,AAPL',
    'startDate' => '2013-01-01',
    'endDate' => '2013-06-30',
    'eventType' => 'dividend',
    'maxRecords' => '5',
];

$result = $ondemand->getCorporateActions($params);
var_dump($result);

Classic ASP

Dim ondemand
Dim result

Set ondemand = Server.CreateObject("MSSOAP.SoapClient30")
ondemand.ClientProperty("ServerHTTPRequest") = True
ondemand.MSSoapInit("https://ondemand.websol.barchart.com/service?wsdl")

Set result = ondemand.getCorporateActions("AMZN,AAPL", "2013-01-01", "2013-06-30", "dividend", "5")

Perl

use SOAP::Lite;
use SOAP::WSDL;

my $ondemand = SOAP::Lite
    -> service('https://ondemand.websol.barchart.com/service?wsdl');

my $result = $ondemand->getCorporateActions('AMZN,AAPL', '2013-01-01', '2013-06-30', 'dividend', '5');

print $result;

Python

from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')

result = client.service.getCorporateActions('AMZN,AAPL', '2013-01-01', '2013-06-30', 'dividend', '5')

print result

Ruby

require 'savon'

ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')

response = ondemand.call(
    :getCorporateActions,
    message: {
        symbols: 'AMZN,AAPL',
        startDate: '2013-01-01',
        endDate: '2013-06-30',
        eventType: 'dividend',
        maxRecords: '5',
    }
)

response.body