Portfolio Performance
Retrieves periodic portfolio performance for a portfolio.
Endpoint
GET
/data/v1/portfolio_performance/:idParameters
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/portfolio_performance/332?api_key=API_KEY"
Response
Returns a list of portfolio performance if a valid portfolio ID 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": "Portfolio",
"data": [
{
"date": "2012-01-03",
"return": 0.0
},
{
"date": "2012-01-04",
"return": -0.0014476100000000436
},
{
"date": "2012-01-05",
"return": 0.004743490000000072
},
{
"date": "2012-01-06",
"return": 0.005322650000000095
},
{
"date": "2012-01-09",
"return": 0.007556160000000034
},
...more dates
]
}
]
Table of Contents