Settlement Price API
getClosePrice
The getClosePrice API provides the close price for given instruments for the given date.
View All APIssymbolsrequired
A symbol or code that identifies a financial instrument. Multiple symbols separated by a comma may be used.
IBM,AAPL,GOOG
dateoptional
The date of the historical data query. The value should conform to the format yyyymmdd.
2010-01-01
splitsoptional
An adjustment of stock value due to corporate action. This parameter only applies to stocks and specifies whether the data returned should be adjusted for splits or not. Set to true to query for adjusted the data, or to false for non-adjusted data.
true
dividendsoptional
A distribution of a portion of a company's earnings. This parameter only applies to stocks and specifies whether the data returned should be adjusted for dividends or not. Set to true to query for adjusted the data, or to false for non-adjusted data.
true
always returned
A sequence of characters. (example: GOOG)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A date in the format of YYYY-MM-DD.
GET
GET https://ondemand.websol.barchart.com/getClosePrice.json?apikey=YOUR_API_KEY&symbols=IBM%2CAAPL%2CGOOG&date=2010-01-01&splits=true÷nds=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getClosePrice.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbols=IBM%2CAAPL%2CGOOG&date=2010-01-01&splits=true÷nds=true
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"symbol": "IBM",
"closePrice": 73.8232,
"date": "2009-12-31"
},
{
"symbol": "AAPL",
"closePrice": 6.3492,
"date": "2009-12-31"
}
]
}
GET
GET https://ondemand.websol.barchart.com/getClosePrice.xml?apikey=YOUR_API_KEY&symbols=IBM%2CAAPL%2CGOOG&date=2010-01-01&splits=true÷nds=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getClosePrice.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbols=IBM%2CAAPL%2CGOOG&date=2010-01-01&splits=true÷nds=true
Response
<?xml version="1.0" encoding="utf-8"?>
<getClosePrice>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<symbol>IBM</symbol>
<closePrice>73.8232</closePrice>
<date>2009-12-31</date>
</item>
<item>
<symbol>AAPL</symbol>
<closePrice>6.3492</closePrice>
<date>2009-12-31</date>
</item>
</getClosePrice>
GET
GET https://ondemand.websol.barchart.com/getClosePrice.csv?apikey=YOUR_API_KEY&symbols=IBM%2CAAPL%2CGOOG&date=2010-01-01&splits=true÷nds=true
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getClosePrice.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbols=IBM%2CAAPL%2CGOOG&date=2010-01-01&splits=true÷nds=true
Response
symbol,closePrice,date
"IBM","73.8232","2009-12-31"
"AAPL","6.3492","2009-12-31"
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'symbols' => 'IBM,AAPL,GOOG',
'date' => '2010-01-01',
'splits' => 'true',
'dividends' => 'true',
];
$result = $ondemand->getClosePrice($params);
var_dump($result);
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.getClosePrice("YOUR_API_KEY", "IBM,AAPL,GOOG", "2010-01-01", "true", "true")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getClosePrice('YOUR_API_KEY', 'IBM,AAPL,GOOG', '2010-01-01', 'true', 'true');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getClosePrice('YOUR_API_KEY', 'IBM,AAPL,GOOG', '2010-01-01', 'true', 'true')
print(result)
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getClosePrice,
message: {
apikey: 'YOUR_API_KEY',
symbols: 'IBM,AAPL,GOOG',
date: '2010-01-01',
splits: 'true',
dividends: 'true',
}
)
response.body