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 int
ID of benchmark portfolio. To retrieve all available benchmarks including their ids please refer to Benchmarks endpoint.
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": "2008-01-02",
"return": 0.0
},
{
"date": "2008-01-03",
"return": -0.000244140625
},
{
"date": "2008-01-04",
"return": -0.011474609375000111
},
{
"date": "2008-01-07",
"return": -0.019531250000000222
},
{
"date": "2008-01-08",
"return": -0.030273437500000222
},
...more dates
]
}
]
Table of Contents