Retrieve your account portfolio including buying power, positions, and equity breakdown.
First, retrieve your account ID using the accounts endpoint:
curl --request GET \
--url https://api.public.com/userapigateway/trading/account \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'This returns your available accounts with their IDs:
{
"accounts": [
{
"accountId": "YOUR_ACCOUNT_ID",
"accountType": "BROKERAGE",
"optionsLevel": "LEVEL_2",
"brokerageAccountType": "MARGIN"
}
]
}curl --request GET \
--url https://api.public.com/userapigateway/trading/{YOUR_ACCOUNT_ID}/portfolio/v2 \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'The response includes your account balance and portfolio details:
{
"accountId": "YOUR_ACCOUNT_ID",
"accountType": "BROKERAGE",
"buyingPower": {
"cashOnlyBuyingPower": "5000.00",
"buyingPower": "10000.00",
"optionsBuyingPower": "10000.00"
},
"equity": [
{
"type": "CASH",
"value": "2500.00",
"percentageOfPortfolio": "25.00"
},
{
"type": "STOCK",
"value": "7500.00",
"percentageOfPortfolio": "75.00"
}
],
"positions": [
{
"instrument": {
"symbol": "AAPL",
"name": "Apple Inc.",
"type": "EQUITY"
},
"quantity": "10.0",
"currentValue": "1500.00",
"percentOfPortfolio": "15.00"
}
],
"orders": []
}