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/332?api_key=API_KEY"
Response
Returns a portfolio object if a valid portfolio ID was provided. Returns an error otherwise.
{
"id": "332",
"owner": {
"id": "1"
},
"name": "Quality - Top 50",
"description": "This portfolio consists of the top 50 stocks with an above 7 rating for Return, Growth and Risk. Portfolio is rebalanced once a quarter.",
"private": false,
"createdAt": "2020-06-21T16:17:38.893462+00:00",
"rebalanceFrequency": 3,
"maxStocks": 50,
"maxStocksCriteria": "total_rating",
"maxStocksCriteriaOrder": "descending",
"maxSectorConcentration": "1.00",
"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.
Example Request
cURL
curl -X GET "https://sensaai.com/data/v1/portfolios/?api_key=API_KEY"
Response
[
{
"id": "323",
"owner": {
"id": "1"
},
"name": "All Stocks Top 50",
"description": "This portfolio contains the top 50 rated stocks in the SensaAI universe and is rebalanced once a quarter.",
"private": true,
"createdAt": "2020-06-02T22:52:14.495073+00:00",
"rebalanceFrequency": 3,
"maxStocks": 50,
"maxStocksCriteria": "total_rating",
"maxStocksCriteriaOrder": "descending",
"maxSectorConcentration": "1.00",
"nextRebalanceDate": "2020-12-01",
"previousRebalanceDate": "2020-09-01",
"ranges": {
}
},
...more portfolios
]