Share
TTAGG Stock API
The TTAGG Stock API was released to provide easy access to stock data for developers building web applications driven by or needing access to stock data. Currently we provide daily data for more than 6,000 companies and will continue to expand our API.
How to use
Our Stock API is Uber easy to use, and it's free!
API URL
Simply call this URL: http://ttagg.com/json/stock, and append any of the below parameters based on your exact needs. The API returns only JSON right now, but later it will support CSV, TEXT, and XML formats as well!
API Parameters
ticker
The stock's Ticker (Use Capital letters)
num_data
The number of stock quotes you want to gather, if the start_date is not set, then the api will return num_data of the most recent stock data
start_date
The date to start pulling data from. If no end_date is set it will return num_days worth of stock data (default 1, max 365). format example (2011-09-14 04:52:54)
end_date
Used in conjunction with start_date to specify a range of data to query. A maximum of 365 stock data points can be returned at a time. format example (2011-09-14 04:52:54)
time_format
There are 3 values you can choose from to configure the time format returned.

datetime - (default setting) returns a formated timestamp, for example (format example (2011-09-14 04:52:54).
pretty - returns a formatted timestamp in the form of MM/DD/YYYY
seconds - returns an integer value of the timestamp in seconds.
milliseconds - returns an integer value of the timestamp in milliseconds (particularly useful when dealing with some JavaScript libraries that use milliseconds instead of seconds.
explode - explodes the time stamp into individual components year, month, day, hour, minute, and second. all stored in the 'date' array of each quote.
milliseconds
Example URLs (click to see the API return)
http://finance.ttagg.com/json/stock/get?ticker=AA
http://finance.ttagg.com/json/stock/get?ticker=AA&num_data=2
http://finance.ttagg.com/json/stock/get?ticker=AA&time_format=seconds
http://finance.ttagg.com/json/stock/get?ticker=AA&time_format=milliseconds
http://finance.ttagg.com/json/stock/get?ticker=AA&&num_data=10&time_format=milliseconds
http://finance.ttagg.com/json/stock/get?ticker=AA&start_date=2000-01-01&end_date=2000-02-01
http://finance.ttagg.com/json/stock/get?ticker[]=AA&ticker[]=MMM&num_data=2
http://finance.ttagg.com/json/stock/get?ticker[]=AA&ticker[]=MMM&start_date=2000-01-01&end_date=2000-02-01
http://finance.ttagg.com/json/stock/get?ticker[]=AA&num_data=10&time_format=explode
You can also integrate this with any other library including JQuery's $.get functions.