Skip to main content
GET
Get detailed information about portfolio profit/loss
10 credits per request

  • Total value of portfolio
  • Defi value of portfolio
  • Total cost of portfolio
  • Unrealized profit/loss
  • Realized profit/loss
  • All time profit/loss
  • 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
  • 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

X-API-KEY
string
header
required

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

sharetoken
string
passcode
string

Passcode for accessing protected portfolio data

Example:

"123456"

Query Parameters

currency
string
default:USD

Currency for price values. Default is USD.

Example:

"USD"

portfolioId
string

Portfolio ID for accessing a specific API-connected portfolio. Required if shareToken is not provided.

Example:

"abc123def456"

Response

Portfolio profit/loss

unrealizedProfitLossPercent
number
required

Unrealized profit/loss percentage

Example:

12.5

realizedProfitLossPercent
number
required

Realized profit/loss percentage

Example:

5

allTimeProfitLossPercent
number
required

All Time profit/loss percentage

Example:

17.5

totalValue
number

Total value of portfolio

Example:

12500.75

defiValue
number

DeFi value of portfolio

Example:

2500.25

totalCost
number

Total cost of portfolio

Example:

10000.5

unrealizedProfitLoss
number

Unrealized profit/loss

Example:

1250.75

realizedProfitLoss
number

Realized profit/loss

Example:

500.25

allTimeProfitLoss
number

All Time profit/loss

Example:

1751