Stock Performance
Retrieves periodic performance for a stock.
Endpoint
GET
/data/v1/stock_performance/:tickerParameters
api_key string
required
Your authentication key needed to make requests.
type string
default: cumulative_return
The type of portfolio performance. Possible values are: "cumulative_return", "yearly_returns", "histogram", "drawdown", "rolling_beta" (requires benchmark
), "rolling_volatility", "rolling_sharpe", "monthly_heatmap", "boxplot".
benchmark string
Benchmark for comparison. E.g. for the S&P 500 Total Return Index use ^SP500TR.
format string
default: json
Defines return format of response. Options are json or csv. Default is json.
Example Request
cURL
curl -X GET "https://sensaai.com/data/v1/stock_performance/mmm?api_key=API_KEY"
Response
Returns a list of stock performance if a valid stock ticker was provided. Returns an error otherwise.
NOTE: This endpoint currently does not allow specifying a custom date range, so data is provided for the entire available period.
[
{
"name": "MMM",
"data": [
{
"date": "2000-01-03",
"return": 0.0
},
{
"date": "2000-01-04",
"return": -0.039579967689822304
},
{
"date": "2000-01-05",
"return": 0.00928917609046831
},
{
"date": "2000-01-06",
"return": 0.06825525040387714
},
{
"date": "2000-01-07",
"return": 0.08925686591276238
},
...more dates
]
}
]
Table of Contents