getQuote API

The getQuote API is used to request price data, either real-time, delayed or end-of-day, by symbol. In addition to Last Price or Settlement, other fields such as Open, High, Low, Close, Bid, Ask, 52-week high and low, and more are available.

All APIs

Contact Us to Get Access

Inputs

symbols required

A 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.

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

fields optional

The fields requested.

Type
list (A comma or semi-colon delimited string.) 
Example
fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate 

mode required

Parameter to change quote type to real-time ("R"), delayed ("I") or end-of-day ("D") if available.

Type
list (A comma or semi-colon delimited string.) 
Example
Default

jerq optional

Whether to merge with JERQ data.

Type
boolean (A logical type representing the truth of a value as 'true' or 'false'.) 
Example
false 
Default

exchangeFilter optional

Returns all quotes for specified exchanges (symbols are ignored).

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

only optional

Returns only specified fields

Type
list (A comma or semi-colon delimited string.) 
Example
symbol,name 

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)
dayCode
always returned
The day code for the session. Day codes are "1-9" for days 1 through 9, "0" (zero) for the 10th of the month, and "A - U" for days 11 through 31.
string
A sequence of characters. (example: GOOG)
serverTimestamp
always returned
The time the message was generated on the server.
dateTime
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
mode
always returned
An indicator representing if the quote is real-time ("R"), delayed ("I") or end-of-day ("D").
string
A sequence of characters. (example: GOOG)
lastPrice
always returned
The last price the instrument traded.
double
A numeric type defining a number with fractional parts. (example: 2.14)
tradeSize
as requested
The size of the last traded price / transaction.
int
A numeric type defining a whole number. (example: 2)
tradeTimestamp
always returned
The exchange timestamp for the last traded price.
dateTime
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
netChange
always returned
The difference between the last traded price and the previous close.
double
A numeric type defining a number with fractional parts. (example: 2.14)
percentChange
always returned
The percent difference between the last traded price and the previous close.
double
A numeric type defining a number with fractional parts. (example: 2.14)
tick
as requested
An indicator representing whether the last traded price was up ("+"), the same (".") or below ("-") the previous last price.
string
A sequence of characters. (example: GOOG)
previousLastPrice
as requested
The price previous to the current last price.
double
A numeric type defining a number with fractional parts. (example: 2.14)
previousTimestamp
as requested
The exchange timestamp of the previous last price.
date
A date in the format of YYYY-MM-DD.
bid
as requested
The current bid price.
double
A numeric type defining a number with fractional parts. (example: 2.14)
bidSize
as requested
The size (quantity) of the current bid price.
int
A numeric type defining a whole number. (example: 2)
ask
as requested
The current ask price.
double
A numeric type defining a number with fractional parts. (example: 2.14)
askSize
as requested
The size (quantity) of the current ask price.
int
A numeric type defining a whole number. (example: 2)
unitCode
always returned
string
A sequence of characters. (example: GOOG)
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)
numTrades
always returned
The number of individual transactions over the course of a trading session.
int
A numeric type defining a whole number. (example: 2)
dollarVolume
always returned
double
A numeric type defining a number with fractional parts. (example: 2.14)
flag
always returned
If present, can be one of the following: "c" meaning that the market is closed for this instrument. "p" meaning that the market is in a pre-open state. This occurs when there are bids and offers being placed, but no trade has occurred yet. This is normally seen shortly before the official opening time for busy markets, but can also be seen throughout the day for lightly traded markets. "s" meaning that the instrument has settled, and that this is the final, settlement price.
string
A sequence of characters. (example: GOOG)
previousClose
as requested
The last traded price for the previous session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
settlement
as requested
The settlement price determined by the exchange.
double
A numeric type defining a number with fractional parts. (example: 2.14)
previousSettlement
as requested
The settlement price for the previous 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)
previousVolume
always returned
The quantity of shares or contracts traded from the previous day.
int
A numeric type defining a whole number. (example: 2)
openInterest
as requested
The quantity of open interest for futures.
double
A numeric type defining a number with fractional parts. (example: 2.14)
fiftyTwoWkHigh
as requested
The highest price over the past 52 weeks.
double
A numeric type defining a number with fractional parts. (example: 2.14)
fiftyTwoWkHighDate
as requested
The date in which the high price was reached over the past 52 weeks.
date
A date in the format of YYYY-MM-DD.
fiftyTwoWkLow
as requested
The low price over the past 52 weeks.
double
A numeric type defining a number with fractional parts. (example: 2.14)
fiftyTwoWkLowDate
as requested
The date in which the low price was reached over the past 52 weeks.
date
A date in the format of YYYY-MM-DD.
avgVolume
as requested
The average year-to-date daily volume.
int
A numeric type defining a whole number. (example: 2)
sharesOutstanding
as requested
The total number of shares outstanding. In thousands
int
A numeric type defining a whole number. (example: 2)
dividendRateAnnual
as requested
The total dividend payout over one year.
float
A numeric type defining a number with fractional parts. (example: 2.14)
dividendYieldAnnual
as requested
The annual dividend divided by the current share price.
float
A numeric type defining a number with fractional parts. (example: 2.14)
exDividendDate
as requested
The last possible date to have owned shares of a stock and still be entitled to the associated dividend.
date
A date in the format of YYYY-MM-DD.
impliedVolatility
as requested
double
A numeric type defining a number with fractional parts. (example: 2.14)
twentyDayAvgVol
as requested
double
A numeric type defining a number with fractional parts. (example: 2.14)
month
as requested
Contract month returned for futures.
string
A sequence of characters. (example: GOOG)
year
as requested
Contract year returned for futures.
string
A sequence of characters. (example: GOOG)
expirationDate
as requested
The expiration date for the futures contract. Only returns a value for futures.
date
A date in the format of YYYY-MM-DD.
lastTradingDay
as requested
The last trading day of the futures contract. Only returns a value for futures.
string
A sequence of characters. (example: GOOG)
twelveMnthPct
as requested
double
A numeric type defining a number with fractional parts. (example: 2.14)
twelveMnthPctDate
as requested
date
A date in the format of YYYY-MM-DD.
preMarketPrice
as requested
The pre market price for the instrument
double
A numeric type defining a number with fractional parts. (example: 2.14)
preMarketNetChange
as requested
The pre market net change for the instrument
double
A numeric type defining a number with fractional parts. (example: 2.14)
preMarketPercentChange
as requested
The pre market percent change for the instrument
double
A numeric type defining a number with fractional parts. (example: 2.14)
preMarketTimestamp
as requested
The pre market price for the instrument
dateTime
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
afterHoursPrice
as requested
The after hour price for the instrument
double
A numeric type defining a number with fractional parts. (example: 2.14)
afterHoursNetChange
as requested
The after hour net change for the instrument
double
A numeric type defining a number with fractional parts. (example: 2.14)
afterHoursPercentChange
as requested
The after hour percent change for the instrument
double
A numeric type defining a number with fractional parts. (example: 2.14)
afterHoursTimestamp
as requested
The after hour price for the instrument
dateTime
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
averageWeeklyVolume
as requested
The average volume for the last five trading days.
int
A numeric type defining a whole number. (example: 2)
averageMonthlyVolume
as requested
The average one month volume.
int
A numeric type defining a whole number. (example: 2)
averageQuarterlyVolume
as requested
The average 3 month volume.
int
A numeric type defining a whole number. (example: 2)
exchangeMargin
as requested
The margin maintenance required for the future.
string
A sequence of characters. (example: GOOG)
oneMonthHigh
as requested
The highest price over the last month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
oneMonthHighDate
as requested
The date when the high price was reached over the last month.
date
A date in the format of YYYY-MM-DD.
oneMonthLow
as requested
The lowest price over the last month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
oneMonthLowDate
as requested
The date when the low price was reached over the last month.
date
A date in the format of YYYY-MM-DD.
threeMonthHigh
as requested
The highest price over the last 3 month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
threeMonthHighDate
as requested
The date when the high price was reached over the last 3 month.
date
A date in the format of YYYY-MM-DD.
threeMonthLow
as requested
The lowest price over the last 3 month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
threeMonthLowDate
as requested
The date when the low price was reached over the last 3 month.
date
A date in the format of YYYY-MM-DD.
sixMonthHigh
as requested
The highest price over the last 6 month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
sixMonthHighDate
as requested
The date when the high price was reached over the last 6 month.
date
A date in the format of YYYY-MM-DD.
sixMonthLow
as requested
The lowest price over the last 6 month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
sixMonthLowDate
as requested
The date when the low price was reached over the last 6 month.
date
A date in the format of YYYY-MM-DD.

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/getQuote.json?apikey=<YOUR API KEY>&symbols=AAPL%2CGOOG&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&mode=I&jerq=false
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&symbols=AAPL%2CGOOG&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&mode=I&jerq=false

Response

{
    "status": {
        "code": 200,
        "message": "Success."
    },
    "results": [
        {
            "symbol": "AAPL",
            "name": "Apple Inc",
            "dayCode": "L",
            "serverTimestamp": "2017-11-22T21:27:48-06:00",
            "mode": null,
            "lastPrice": 174.96,
            "tradeTimestamp": "2017-11-22T21:12:48-06:00",
            "netChange": 1.82,
            "percentChange": 1.05,
            "unitCode": "2",
            "open": 173.36,
            "high": 175,
            "low": 173.05,
            "close": 174.96,
            "numTrades": 82228,
            "dollarVolume": 3656812752.72,
            "flag": "s",
            "volume": 25588900,
            "previousVolume": 25131199,
            "fiftyTwoWkHigh": 176.24,
            "fiftyTwoWkHighDate": "2017-11-08",
            "fiftyTwoWkLow": 108.25,
            "fiftyTwoWkLowDate": "2016-12-05"
        },
        {
            "symbol": "GOOG",
            "name": "Alphabet Class C",
            "dayCode": "L",
            "serverTimestamp": "2017-11-22T21:28:04-06:00",
            "mode": null,
            "lastPrice": 1035.96,
            "tradeTimestamp": "2017-11-22T21:13:04-06:00",
            "netChange": 1.47,
            "percentChange": 0.14,
            "unitCode": "2",
            "open": 1035,
            "high": 1039.71,
            "low": 1031.43,
            "close": 1035.96,
            "numTrades": 2365,
            "dollarVolume": 509171912.219,
            "flag": "s",
            "volume": 746800,
            "previousVolume": 1096900,
            "fiftyTwoWkHigh": 1048.39,
            "fiftyTwoWkHighDate": "2017-10-27",
            "fiftyTwoWkLow": 737.02,
            "fiftyTwoWkLowDate": "2016-12-01"
        }
    ]
}

XML

GET

GET https://ondemand.websol.barchart.com/getQuote.xml?apikey=<YOUR API KEY>&symbols=AAPL%2CGOOG&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&mode=I&jerq=false
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&symbols=AAPL%2CGOOG&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&mode=I&jerq=false

Response


<?xml version="1.0" encoding="utf-8"?>
 <getQuote>
  <status>
   <code>200</code>
   <message>Success.</message>
  </status>
  <item>
   <symbol>AAPL</symbol>
   <name>Apple Inc</name>
   <dayCode>L</dayCode>
   <serverTimestamp>2017-11-23T03:27:48-06:00</serverTimestamp>
   <mode></mode>
   <lastPrice>174.96</lastPrice>
   <tradeTimestamp>2017-11-22T00:00:00-06:00</tradeTimestamp>
   <netChange>1.82</netChange>
   <percentChange>1.05</percentChange>
   <unitCode>2</unitCode>
   <open>173.36</open>
   <high>175</high>
   <low>173.05</low>
   <close>174.96</close>
   <numTrades>82228</numTrades>
   <dollarVolume>3656812752.72</dollarVolume>
   <flag>s</flag>
   <volume>25588900</volume>
   <previousVolume>25131199</previousVolume>
   <fiftyTwoWkHigh>176.24</fiftyTwoWkHigh>
   <fiftyTwoWkHighDate>2017-11-08</fiftyTwoWkHighDate>
   <fiftyTwoWkLow>108.25</fiftyTwoWkLow>
   <fiftyTwoWkLowDate>2016-12-05</fiftyTwoWkLowDate>
  </item>
  <item>
   <symbol>GOOG</symbol>
   <name>Alphabet Class C</name>
   <dayCode>L</dayCode>
   <serverTimestamp>2017-11-23T03:28:04-06:00</serverTimestamp>
   <mode></mode>
   <lastPrice>1035.96</lastPrice>
   <tradeTimestamp>2017-11-22T00:00:00-06:00</tradeTimestamp>
   <netChange>1.47</netChange>
   <percentChange>0.14</percentChange>
   <unitCode>2</unitCode>
   <open>1035</open>
   <high>1039.71</high>
   <low>1031.43</low>
   <close>1035.96</close>
   <numTrades>2365</numTrades>
   <dollarVolume>509171912.219</dollarVolume>
   <flag>s</flag>
   <volume>746800</volume>
   <previousVolume>1096900</previousVolume>
   <fiftyTwoWkHigh>1048.39</fiftyTwoWkHigh>
   <fiftyTwoWkHighDate>2017-10-27</fiftyTwoWkHighDate>
   <fiftyTwoWkLow>737.02</fiftyTwoWkLow>
   <fiftyTwoWkLowDate>2016-12-01</fiftyTwoWkLowDate>
  </item>
 </getQuote>

CSV

GET

GET https://ondemand.websol.barchart.com/getQuote.csv?apikey=<YOUR API KEY>&symbols=AAPL%2CGOOG&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&mode=I&jerq=false
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&symbols=AAPL%2CGOOG&fields=fiftyTwoWkHigh%2CfiftyTwoWkHighDate%2CfiftyTwoWkLow%2CfiftyTwoWkLowDate&mode=I&jerq=false

Response

symbol,name,dayCode,serverTimestamp,mode,lastPrice,tradeTimestamp,netChange,percentChange,unitCode,open,high,low,close,numTrades,dollarVolume,flag,volume,previousVolume,fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate
"AAPL","Apple Inc","L","2017-11-23T03:27:48-06:00","","174.96","2017-11-22T00:00:00-06:00","1.82","1.05","2","173.36","175","173.05","174.96","82228","3656812752.72","s","25588900","25131199","176.24","2017-11-08","108.25","2016-12-05"
"GOOG","Alphabet Class C","L","2017-11-23T03:28:04-06:00","","1035.96","2017-11-22T00:00:00-06:00","1.47","0.14","2","1035","1039.71","1031.43","1035.96","2365","509171912.219","s","746800","1096900","1048.39","2017-10-27","737.02","2016-12-01"


PHP

<?php

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

$params = [
    'symbols' => 'AAPL,GOOG',
    'fields' => 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate',
    'mode' => 'I',
    'jerq' => 'false',
];

$result = $ondemand->getQuote($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.getQuote("AAPL,GOOG", "fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate", "I", "false")

Perl

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

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

my $result = $ondemand->getQuote('AAPL,GOOG', 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate', 'I', 'false');

print $result;

Python

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

result = client.service.getQuote('AAPL,GOOG', 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate', 'I', 'false')

print result

Ruby

require 'savon'

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

response = ondemand.call(
    :getQuote,
    message: {
        symbols: 'AAPL,GOOG',
        fields: 'fiftyTwoWkHigh,fiftyTwoWkHighDate,fiftyTwoWkLow,fiftyTwoWkLowDate',
        mode: 'I',
        jerq: 'false',
    }
)

response.body