Portfolio
This endpoint allows you to get portfolio information of user
Get Portfolio information
GET https://api.aitrade.com/api/portfolio
Query Params
Name
Type
Required
Description
interval
string
1M
Response
//sample javascript code
const axios = require('axios');
const fetchBotTemplates = async () => {
try {
const response = await axios.get('https://api.stockhero.ai/api/portfolio', {
params: {
interval: '1M',
},
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN' // Replace YOUR_ACCESS_TOKEN with your actual token
}
});
console.log(response.data);
} catch (error) {
console.error(error.response.data);
}
};
fetchBotTemplates();{
"code": 200,
"message": "Success",
"apy": -17.89,
"pnl": "-14.32",
"trading_volume": 0,
"realized_profits": 0,
"interval": "1M",
"portfolio_value": 10000000000,
"portfolio_changed": 0
}{
"code": 401,
"success": false,
"message": "Unauthenticated."
}Last updated