Get Portfolio Value
Get detailed information about portfolio profit/loss
You will get
You will get
- Total value of portfolio
- Defi value of portfolio
- Total cost of portfolio
- Unrealized profit/loss
- Realized profit/loss
- All time profit/loss
Required
Required
- shareToken OR portfolioId: Provide one of these to identify the portfolio.
- shareToken: Get this from your CoinStats portfolio page by clicking “Share”
- portfolioId: Use a portfolio connected via POST /portfolio/wallet or POST /portfolio/exchange
- If neither is provided, returns aggregated data for all API-connected portfolios
Optional
Optional
- currency: Specify the currency for price values, default is USD
- passcode: Passcode for accessing protected portfolio data (can be passed in header or query parameter)
Authorizations
API key required to access the endpoints. Generate one from your dashboard at https://openapi.coinstats.app and pass it in the X-API-KEY request header. Never expose your key in client-side code.
Headers
Passcode for accessing protected portfolio data
"123456"
Query Parameters
Currency for price values. Default is USD.
"USD"
Portfolio ID for accessing a specific API-connected portfolio. Required if shareToken is not provided.
"abc123def456"
Response
Portfolio profit/loss
Unrealized profit/loss percentage
12.5
Realized profit/loss percentage
5
All Time profit/loss percentage
17.5
Total value of portfolio
12500.75
DeFi value of portfolio
2500.25
Total cost of portfolio
10000.5
Unrealized profit/loss
1250.75
Realized profit/loss
500.25
All Time profit/loss
1751