Stock Price API Documentation
A free stock price API.
We created this API to support our own applications and decided to share it with the world. This API is a basic, free alternative to Yahoo Finance (finance.yahoo.com) previously available. It supplies basic end of previous closing day stock price information for a wide range of tickers including international markets, ETFs, and more. The following documentation describes how to use our free Stock Price API.
API Parameters
-
ticker | Required
The ticker symbol you wish to select. Use Yahoo Finance to find active tickers. For international tickers, simply append the exchange identifier found HERE to the end of the ticker.
-
interval | Required
Accepted values: 1d, 1wk, 1mo. Returns the end of day [1d], end of week [1wk], or end of month [1mo] data type.
-
dataType | Required
Accepted values: 0, 1, 2, 3, 4, 5, 6. Each number represents a data type. Data can be returned in any order (e.g. 65432310) or any combination (e.g. 6051423). 0=>Date (in UNIX format), 1=>Open Price, 2=>High Price, 3=>Low Price, 4=>Close Price, 5=>Volume, 6=>Adjusted Close (adjusted for dividends, splits, etc).
-
observations | Required
A unit that represents the number of intervals you are seeking. For a ten day history use '10'. For a 2 month history use '2'. Will take a value up to 99999. The API will return a lesser amount if there is insufficient data available. For example, if you request 2000 observations but there are only 1000 observations available, the API will return only 1000 observations.
Outputs
-
JSON | Default
Status, status message, and returned data. Status 200 is successful while status 400 is unsuccessful. Data will supply error message or the data requested from the API.
-
No others at this time.
Examples
-
Last 10 days of Google's adjusted closing prices
https://api.newtonanalytics.com/price/?ticker=goog&interval=1d&dataType=6&observations=10
-
Last 99 months of Google's date and volumes
https://api.newtonanalytics.com/price/?ticker=goog&interval=1mo&dataType=05&observations=99