getCorporateActionsByExchange API
getCorporateActionsByExchange
The getCorporateActions API from Barchart OnDemand provides splits or dividends data for US equities, mutual funds and Canadian equities by exchange.
View All APIsContact Us to Get Access
Inputs
typerequired
Type of action for which data is being requested.
Type
enum (A type which includes a list of valid possible values.)
Example
dividend
Valid Values
dividend, split
exchangesrequired
A valid exchange code.
Type
list-enum (A comma or semi-colon delimited string that must match a list of valid possible values.)
Example
NYSE
Valid Values
NYSE, NASDAQ, AMEX, OTC-BB, LSE, TSX, TSX-V, ASX, CNSX, FUND, CADFUNDS
intervaloptional
Set period in days for which the event data should be returned.
Type
enum (A type which includes a list of valid possible values.)
Example
7
Default
7
Valid Values
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
eventDatesoptional
A comma separated list of dates for which event data should be returned. Dates need to be in [YYYYMMDD] format.
Type
list (A comma or semi-colon delimited string.)
Example
20241221,20241130
Outputs
symbol
always returned
always returned
A symbol or code that identifies a financial instrument.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
exchange
always returned
always returned
Exchange code for the marketplace where the financial instruments are listed.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
eventDate
always returned
always returned
The date in which the event occurred.
date
A date in the format of YYYY-MM-DD.
A date in the format of YYYY-MM-DD.
eventType
always returned
always returned
The type of event.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
value
always returned
always returned
The split ratio, dividend amount or earnings amount.
double
A numeric type defining a number with fractional parts. (example: 2.14)
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/getCorporateActionsByExchange.json?apikey=YOUR_API_KEY&type=dividend&exchanges=NYSE&interval=7&eventDates=20241221%2C20241130
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCorporateActionsByExchange.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&type=dividend&exchanges=NYSE&interval=7&eventDates=20241221%2C20241130
Response
{
"status": {
"code": 204,
"message": "Success, but no content to return."
},
"results": []
}
XML
GET
GET https://ondemand.websol.barchart.com/getCorporateActionsByExchange.xml?apikey=YOUR_API_KEY&type=dividend&exchanges=NYSE&interval=7&eventDates=20241221%2C20241130
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCorporateActionsByExchange.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&type=dividend&exchanges=NYSE&interval=7&eventDates=20241221%2C20241130
Response
<?xml version="1.0" encoding="utf-8"?>
<getCorporateActionsByExchange>
<status>
<code>204</code>
<message>Success, but no content to return.</message>
</status>
</getCorporateActionsByExchange>
CSV
GET
GET https://ondemand.websol.barchart.com/getCorporateActionsByExchange.csv?apikey=YOUR_API_KEY&type=dividend&exchanges=NYSE&interval=7&eventDates=20241221%2C20241130
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getCorporateActionsByExchange.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&type=dividend&exchanges=NYSE&interval=7&eventDates=20241221%2C20241130
Response
PHP
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'type' => 'dividend',
'exchanges' => 'NYSE',
'interval' => '7',
'eventDates' => '20241221,20241130',
];
$result = $ondemand->getCorporateActionsByExchange($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.getCorporateActionsByExchange("YOUR_API_KEY", "dividend", "NYSE", "7", "20241221,20241130")
Perl
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getCorporateActionsByExchange('YOUR_API_KEY', 'dividend', 'NYSE', '7', '20241221,20241130');
print $result;
Python
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getCorporateActionsByExchange('YOUR_API_KEY', 'dividend', 'NYSE', '7', '20241221,20241130')
print(result)
Ruby
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getCorporateActionsByExchange,
message: {
apikey: 'YOUR_API_KEY',
type: 'dividend',
exchanges: 'NYSE',
interval: '7',
eventDates: '20241221,20241130',
}
)
response.body