Portfolios
Retrieves a portfolio or a list of portfolios.
Endpoints
Retrieve a Portfolio Object
Parameters
api_key string required
Your authentication key needed to make requests.
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/portfolios/337?api_key=API_KEY"
Response
Returns a portfolio object if a valid portfolio ID was provided. Returns an error otherwise.
{
"id": "337",
"owner": {
"id": "1"
},
"name": "SolidSelect",
"description": "Top 20 stocks with an above 7 rating for Return, Growth and Risk. Rebalanced once a quarter.",
"private": false,
"createdAt": "2020-06-21T16:17:38.893462+00:00",
"rebalanceFrequency": 3,
"maxStocks": 20,
"maxStocksCriteria": "total_rating",
"maxStocksCriteriaOrder": "descending",
"nextRebalanceDate": "2021-01-02",
"previousRebalanceDate": "2020-10-02",
"ranges": {
"returnRating": [
7.0,
10.0
],
"growthRating": [
7.0,
10.0
],
"riskRating": [
7.0,
10.0
]
}
}
Retrieve a List of Portfolio Objects
Parameters
api_key string required
Your authentication key needed to make requests.
format string default: json
Defines return format of response. Options are json or csv. Default is json.
private boolean default: true
Defines whether user's portfolios are returned (if set to true) or whether SensaAI predefined portfolios are returned (if set to false). Options are true or false. Default is true.
Example Request
cURL
curl -X GET "https://sensaai.com/data/v1/portfolios/?api_key=API_KEY"
Response
[
{
"id": "3232",
"owner": {
"id": "12345"
},
"name": "My AI Stock Portfolio",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"private": true,
"createdAt": "2020-06-02T22:52:14.495073+00:00",
"rebalanceFrequency": 3,
"maxStocks": 25,
"maxStocksCriteria": "total_rating",
"maxStocksCriteriaOrder": "descending",
"maxSectorConcentration": "0.4",
"nextRebalanceDate": "2020-12-01",
"previousRebalanceDate": "2020-09-01",
"ranges": {
"returnRating": [
9.0,
10.0
],
"growthRating": [
9.0,
10.0
],
}
},
...more portfolios
]