Stock Quotes and Business News for Your Website
(888) 688-9880

Stock Chart API

Overview

Our Stock Chart API allows you to generate static PNG charts on demand, by passing in the following parameters

param description
General Params
width Total image (canvas) width in px
height Total image (canvas) height in px
interval Number of days back to show
  • 1 = current day
  • >1 = number of calendar days' worth of historical data to show
start Starting date of chart
  • Example: 2004-03-25
  • When start & end are specified, they override the interval parameter
end Ending date of chart
  • Example: 2005-03-25
  • When start & end are specified, they override the interval parameter
ticker Comma-delimited list of stock symbols [1]
volume Do/don't show supplementary volume graph [2]
  • 0 = don't show volume graph
  • 1 = show monochrome volume graph
  • 2 = show volume graph colored by price increase vs. decrease
shwidth Chart and footer box bg shadow/extrusion thickness in px
watermark Name of prerendered watermark image to apply, minus .png suffix. It is presumed that the specified image already exists as a PNG file in the preconfigured watermark directory.
wmalpha Watermark translucency in percent
Filled Area Charts Only
fillalpha Filled area chart translucency in percent [4]
fillshx Area chart fill shadow x offset in px (positive = east) [4]
fillshx Area chart fill shadow y offset in px (positive = south) [4]
fillsha Area chart fill shadow alpha [4]
outputMode Image output format
Colors
All colors are 24-bit RGB hex values in the form RRGGBB
ibcolor Canvas background color [3]
bgcolor Price region background color
bvcolor Volume region background color
arcolor Filled area chart color, ignored if a gradient is used [4]
lncolor Comma-delimited list of value line colors, corresponding to tickers
vocolor Volume bar color if volume=1
brcolor Price & volume graph border & tick color
shcolor Price & volume graph shadow/extrude color
grcolor Price & volume graph grid line color (major)
gmcolor Price & volume graph grid line color (minor)
mkcolor Intraday chart previous close line color
txcolor Text color for axis labels, attribution, etc., and tickers if legend is outside chart [5]
itcolor Ticker symbol legend text color if legend is inside chart [5]
gtcolor Filled area chart gradient color (top/left) [4]
gbcolor Filled area chart gradient color (bottom/right) [4]
Notes
[1] If multiple tickers are specified, values are rendered in terms of performance (% gain/loss from starting point). The first ticker is the "primary" ticker and will be rendered with any of the specified fills, gradients, footer charts, etc., while all additional tickers will be rendered as performance line overlays only.
[2] Specifying volume up/down colors (vucolor and vdcolor) will override this setting, effectively forcing it to 2. This setting will be further overridden to 0 if the ticker is an index or mutual fund (for which no volume data is available)
[3] Since the "canvas" upon which the price and volume charts and their axis labels are drawn is normally transparent in order to allow the page background color to show through, this color only affects browsers that are incapable of properly rendering 32-bit PNG transparency, namely all versions of MSIE for Windows. The canvas will be drawn opaquely with this color on such browsers.
[4] Only applies when type=0 (filled area chart)
[5] When the legend is positioned outside the chart price region, the ticker text color is txcolor. When it is inside the chart price region, the ticker text color is itcolor (in order to preserve backward-compatability with old URLs).