getHighsLows API

The getHighsLows API provides lists for new 52-week highs or 52-week lows based on exchange and asset type.

All APIs

Contact Us to Get Access

Inputs

exchanges optional

Exchange code for the marketplace where the financial instruments are listed.

Type
list-enum (A comma or semi-colon delimited string that must match a list of valid possible values.) 
Example
NYSE,NASDAQ 

Valid Values:
AMEX, CBOT, CBOTM, CME, COMEX, CRYPTO, FOREX, GBLX, ICE, ICEFI, ICEUS, WCE, CADFUNDS, FUND, INDEX, INDEX-CBOE, INDEX-DOW, INDEX-NQ, INDEX-NY, INDEX-SP, INDEX-TSX, IOM, IMM, KCBT, LCE, MGEX, NASDAQ, OTHER OTC, RATES, RATE, NYMEX, NYMI, NYSE, NLIF, TSX, TSX-V, SECTOR, CNSX, LIFFE, EUIDX, EUREX, BMF, MATIF, CXMI, HKFE, SPECIAL, INDEX-RL, MATBA, NCDEX, ASX, ROFEX, OTC-BB, SIMEX, CZCE, CROSS, BSE, MNTRL, ECONOMY, TOCOM, MEFF, ENDEX, SAFEX, TIFFE, CASH, MCX, NZX, MDEX, DGCX, NSE, CBOE, DME, OMX, CFE, TURK, TFEX, TAIWA, SHFE, DCE, BATS, LSE, LME, EEX, CFFEX, JPX, SFE

assetType required

The type of asset. Includes: equities ("STK"), mutual funds ("FUNDS"), ETFs ("ETF"), futures ("FUT"), forex ("FOREX")

Type
enum (A type which includes a list of valid possible values.) 
Example
STK 

Valid Values:
STK, ETF, FUND, FUT, FOREX, BARCHART

type optional

The type of high/low list to return.

Type
enum (A type which includes a list of valid possible values.) 
Example
low 

Valid Values:
high, low

period required

A value representing the time period.

Type
enum (A type which includes a list of valid possible values.) 
Example
260d 
Default
260d 

Valid Values:
5d, 20d, 65d, 100d, 260d

maxRecords optional

The maximum number of records to show in the return.

Type
int (A numeric type defining a whole number. (example: 2)) 
Example
20 
Default
100 

offset optional

A value denoting where to start results from.

Type
int (A numeric type defining a whole number. (example: 2)) 
Example
20 

Outputs

Name / Requirement
Description
Type
symbol
always returned
A symbol or code that identifies a financial instrument.
string
A sequence of characters. (example: GOOG)
symbolName
always returned
The full name of the instrument.
string
A sequence of characters. (example: GOOG)
exchange
always returned
Exchange code for the marketplace where the financial instruments are listed.
string
A sequence of characters. (example: GOOG)
country
always returned
The instrument's country of origin.
string
A sequence of characters. (example: GOOG)
timestamp
always returned
The exchange time of the last traded priced.
int
A numeric type defining a whole number. (example: 2)
tradeTime
always returned
The exchange time of the last traded priced.
dateTime
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
lastPrice
always returned
The most recent price at which a stock or security traded.
double
A numeric type defining a number with fractional parts. (example: 2.14)
priceNetChange
always returned
The difference between the last price and the previous day's settlement price.
double
A numeric type defining a number with fractional parts. (example: 2.14)
pricePercentChange
always returned
The difference between the last price and the previous day's settlement price, expressed as a percentage.
double
A numeric type defining a number with fractional parts. (example: 2.14)
previousClose
always returned
The closing value of the instrument on the previous day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
volume
always returned
The number of shares or contracts traded.
int
A numeric type defining a whole number. (example: 2)
previousVolume
always returned
The number of shares or contracts traded for the previous day.
int
A numeric type defining a whole number. (example: 2)
selectedPeriodHighPrice
always returned
The high price for the selected period
double
A numeric type defining a number with fractional parts. (example: 2.14)
selectedPeriodHighPercent
always returned
The high percent change for the selected period
double
A numeric type defining a number with fractional parts. (example: 2.14)
selectedPeriodLowPrice
always returned
The low price for the selected period
double
A numeric type defining a number with fractional parts. (example: 2.14)
selectedPeriodLowPercent
always returned
The low percent change for the selected period
double
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/getHighsLows.json?apikey=<YOUR API KEY>&exchanges=NYSE%2CNASDAQ&assetType=STK&type=low&period=260d&maxRecords=20&offset=20
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&exchanges=NYSE%2CNASDAQ&assetType=STK&type=low&period=260d&maxRecords=20&offset=20

Response

{
    "status": {
        "code": 204,
        "message": "Success, but no content to return."
    },
    "results": null
}

XML

GET

GET https://ondemand.websol.barchart.com/getHighsLows.xml?apikey=<YOUR API KEY>&exchanges=NYSE%2CNASDAQ&assetType=STK&type=low&period=260d&maxRecords=20&offset=20
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&exchanges=NYSE%2CNASDAQ&assetType=STK&type=low&period=260d&maxRecords=20&offset=20

Response


<?xml version="1.0" encoding="utf-8"?>
 <getHighsLows>
  <status>
   <code>204</code>
   <message>Success, but no content to return.</message>
  </status>
 </getHighsLows>

CSV

GET

GET https://ondemand.websol.barchart.com/getHighsLows.csv?apikey=<YOUR API KEY>&exchanges=NYSE%2CNASDAQ&assetType=STK&type=low&period=260d&maxRecords=20&offset=20
Host: ondemand.websol.barchart.com

POST

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

apikey=<YOUR API KEY>&exchanges=NYSE%2CNASDAQ&assetType=STK&type=low&period=260d&maxRecords=20&offset=20

Response




PHP

<?php

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

$params = [
    'exchanges' => 'NYSE,NASDAQ',
    'assetType' => 'STK',
    'type' => 'low',
    'period' => '260d',
    'maxRecords' => '20',
    'offset' => '20',
];

$result = $ondemand->getHighsLows($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.getHighsLows("NYSE,NASDAQ", "STK", "low", "260d", "20", "20")

Perl

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

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

my $result = $ondemand->getHighsLows('NYSE,NASDAQ', 'STK', 'low', '260d', '20', '20');

print $result;

Python

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

result = client.service.getHighsLows('NYSE,NASDAQ', 'STK', 'low', '260d', '20', '20')

print result

Ruby

require 'savon'

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

response = ondemand.call(
    :getHighsLows,
    message: {
        exchanges: 'NYSE,NASDAQ',
        assetType: 'STK',
        type: 'low',
        period: '260d',
        maxRecords: '20',
        offset: '20',
    }
)

response.body