getQuoteEod API

The getQuoteEod API is used to request end-of-day price data, by combined exchange & symbol, for every equity, future, and fund in the world.

All APIs

Contact Us to Get Access

Inputs

symbols required

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 <root_symbol*0> for the active contract or <root_symbol*1> for the first nearby is supported, as is <root_symbol^F> for all futures contracts for a given root symbol, as is <root_symbol^O> for all options contracts for a given underlying futures symbol. If no country code or MIC is passed then the API will behave the same as the getQuote API.

Type
list (A comma or semi-colon delimited string.) 
Example
XASE:SPY,US:IBM 

exchange optional

The list of valid exchange codes to limit symbol search.

Type
list (A comma or semi-colon delimited string.) 
Example
NYSE,AMEX 

Outputs

Name / Requirement
Description
Type
symbol
always returned
A symbol or code that identifies a financial instrument.
string
A sequence of characters. (example: GOOG)
name
always returned
The type of symbol used.
string
A sequence of characters. (example: GOOG)
date
always returned
The price date.
date
A date in the format of YYYY-MM-DD.
open
always returned
The opening (first) price for the session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
high
always returned
The highest traded price for the session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
low
always returned
The lowest traded price for the session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
close
always returned
The last traded price for the session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
volume
always returned
The quantity of shares or contracts traded.
int
A numeric type defining a whole number. (example: 2)
totaltrades
always returned
int
A numeric type defining a whole number. (example: 2)
datasource
always returned
Where the data is coming from: Exchange Date or Barchart.
string
A sequence of characters. (example: GOOG)

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/getQuoteEod.json?apikey=<YOUR API KEY>&symbols=XASE%3ASPY%2CUS%3AIBM&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&exchange=NYSE%2CAMEX

Response

{
    "status": {
        "code": 200,
        "message": "Success."
    },
    "results": [
        {
            "symbol": "SPY",
            "name": "S&P 500 SPDR",
            "date": "2017-11-17",
            "open": 258.22,
            "high": 258.59,
            "low": 257.77,
            "close": 257.86,
            "volume": 75737203,
            "totaltrades": 156894,
            "datasource": "Barchart"
        },
        {
            "symbol": "IBM",
            "name": "International Business Machines",
            "date": "2017-11-17",
            "open": 149.34,
            "high": 150.15,
            "low": 148.83,
            "close": 148.97,
            "volume": 4916400,
            "totaltrades": 19814,
            "datasource": "Barchart"
        }
    ]
}

XML

GET

GET https://ondemand.websol.barchart.com/getQuoteEod.xml?apikey=<YOUR API KEY>&symbols=XASE%3ASPY%2CUS%3AIBM&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&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>2017-11-17</date>
   <open>258.22</open>
   <high>258.59</high>
   <low>257.77</low>
   <close>257.86</close>
   <volume>75737203</volume>
   <totaltrades>156894</totaltrades>
   <datasource>Barchart</datasource>
  </item>
  <item>
   <symbol>IBM</symbol>
   <name>International Business Machines</name>
   <date>2017-11-17</date>
   <open>149.34</open>
   <high>150.15</high>
   <low>148.83</low>
   <close>148.97</close>
   <volume>4916400</volume>
   <totaltrades>19814</totaltrades>
   <datasource>Barchart</datasource>
  </item>
 </getQuoteEod>

CSV

GET

GET https://ondemand.websol.barchart.com/getQuoteEod.csv?apikey=<YOUR API KEY>&symbols=XASE%3ASPY%2CUS%3AIBM&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&exchange=NYSE%2CAMEX

Response

symbol,name,date,open,high,low,close,volume,totaltrades,datasource
"SPY","S&P 500 SPDR","2017-11-17","258.22","258.59","257.77","257.86","75737203","156894","Barchart"
"IBM","International Business Machines","2017-11-17","149.34","150.15","148.83","148.97","4916400","19814","Barchart"


PHP

<?php

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

$params = [
    'symbols' => 'XASE:SPY,US:IBM',
    'exchange' => 'NYSE,AMEX',
];

$result = $ondemand->getQuoteEod($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.getQuoteEod("XASE:SPY,US:IBM", "NYSE,AMEX")

Perl

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

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

my $result = $ondemand->getQuoteEod('XASE:SPY,US:IBM', 'NYSE,AMEX');

print $result;

Python

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

result = client.service.getQuoteEod('XASE:SPY,US:IBM', 'NYSE,AMEX')

print result

Ruby

require 'savon'

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

response = ondemand.call(
    :getQuoteEod,
    message: {
        symbols: 'XASE:SPY,US:IBM',
        exchange: 'NYSE,AMEX',
    }
)

response.body