End of Day Quotes API
getQuoteEod
The getQuoteEod API is used to request end-of-day price data, by combined exchange and symbol, on stocks, indexes, mutual funds, ETFs, futures, foreign exchange, or cryptocurrencies. Historical data is available as tick, minute bars or end-of-day data.
View All APIssymbolsrequired
An MIC code or a Country code plus the symbol or code that identifies a financial instrument. Multiple symbols separated by a comma may be used. For futures, notation such as
XASE:SPY,US:IBM
fieldsoptional
The fields requested.
previousClose
exchangeoptional
The list of valid exchange codes to limit symbol search.
NYSE,AMEX
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A date in the format of YYYY-MM-DD.
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A numeric type defining a whole number. (example: 2)
always returned
A numeric type defining a whole number. (example: 2)
always returned
A sequence of characters. (example: GOOG)
as requested
A numeric type defining a number with fractional parts. (example: 2.14)
as requested
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
GET
GET https://ondemand.websol.barchart.com/getQuoteEod.json?apikey=YOUR_API_KEY&symbols=XASE%3ASPY%2CUS%3AIBM&fields=previousClose&exchange=NYSE%2CAMEX
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getQuoteEod.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbols=XASE%3ASPY%2CUS%3AIBM&fields=previousClose&exchange=NYSE%2CAMEX
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"symbol": "SPY",
"name": "S&P 500 SPDR",
"date": "2024-04-22",
"open": 497.83,
"high": 502.38,
"low": 495.43,
"close": 499.72,
"volume": 67961000,
"totaltrades": null,
"datasource": "Barchart",
"previousClose": null
},
{
"symbol": "IBM",
"name": "International Business Machines",
"date": "2024-04-22",
"open": 182.45,
"high": 183.32,
"low": 180.45,
"close": 181.9,
"volume": 3076400,
"totaltrades": null,
"datasource": "Barchart",
"previousClose": null
}
]
}
GET
GET https://ondemand.websol.barchart.com/getQuoteEod.xml?apikey=YOUR_API_KEY&symbols=XASE%3ASPY%2CUS%3AIBM&fields=previousClose&exchange=NYSE%2CAMEX
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getQuoteEod.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbols=XASE%3ASPY%2CUS%3AIBM&fields=previousClose&exchange=NYSE%2CAMEX
Response
<?xml version="1.0" encoding="utf-8"?>
<getQuoteEod>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<symbol>SPY</symbol>
<name>S&P 500 SPDR</name>
<date>2024-04-22</date>
<open>497.83</open>
<high>502.38</high>
<low>495.43</low>
<close>499.72</close>
<volume>67961000</volume>
<totaltrades/>
<datasource>Barchart</datasource>
<previousClose/>
</item>
<item>
<symbol>IBM</symbol>
<name>International Business Machines</name>
<date>2024-04-22</date>
<open>182.45</open>
<high>183.32</high>
<low>180.45</low>
<close>181.9</close>
<volume>3076400</volume>
<totaltrades/>
<datasource>Barchart</datasource>
<previousClose/>
</item>
</getQuoteEod>
GET
GET https://ondemand.websol.barchart.com/getQuoteEod.csv?apikey=YOUR_API_KEY&symbols=XASE%3ASPY%2CUS%3AIBM&fields=previousClose&exchange=NYSE%2CAMEX
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getQuoteEod.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&symbols=XASE%3ASPY%2CUS%3AIBM&fields=previousClose&exchange=NYSE%2CAMEX
Response
symbol,name,date,open,high,low,close,volume,totaltrades,datasource,previousClose
"SPY","S&P 500 SPDR","2024-04-22","497.83","502.38","495.43","499.72","67961000","","Barchart",""
"IBM","International Business Machines","2024-04-22","182.45","183.32","180.45","181.9","3076400","","Barchart",""
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'symbols' => 'XASE:SPY,US:IBM',
'fields' => 'previousClose',
'exchange' => 'NYSE,AMEX',
];
$result = $ondemand->getQuoteEod($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.getQuoteEod("YOUR_API_KEY", "XASE:SPY,US:IBM", "previousClose", "NYSE,AMEX")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getQuoteEod('YOUR_API_KEY', 'XASE:SPY,US:IBM', 'previousClose', 'NYSE,AMEX');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getQuoteEod('YOUR_API_KEY', 'XASE:SPY,US:IBM', 'previousClose', 'NYSE,AMEX')
print(result)
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getQuoteEod,
message: {
apikey: 'YOUR_API_KEY',
symbols: 'XASE:SPY,US:IBM',
fields: 'previousClose',
exchange: 'NYSE,AMEX',
}
)
response.body