Skip to main content

Access Your Portfolio Coins

Get comprehensive information about all cryptocurrency holdings in your CoinStats portfolio, including current balances, profit/loss calculations, performance metrics, and risk assessment scores.

Key Features

  • Complete Holdings Overview: View all coins with current balances and USD values
  • Profit/Loss Tracking: Detailed PnL data including realized, unrealized, and 24-hour changes
  • Performance Metrics: Average buy/sell prices and profit percentages
  • Risk Assessment: Optional risk scores including liquidity, volatility, and market cap metrics
  • Multi-Currency Values: Get values in USD, BTC, and ETH
This endpoint is only available for users with a Degen plan subscription. You’ll need a share token to access portfolio data. Learn more about Share Token Authentication.

Get Portfolio Coins

Retrieve detailed information about all coins in your portfolio:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/portfolio/coins?shareToken=YOUR_SHARE_TOKEN&includeRiskScore=true"
8 credits per request

Parameters

ParameterTypeRequiredDescription
shareTokenstringYesYour portfolio share token (how to get it)
pagenumberNoPage number for pagination (default: 1)
limitnumberNoNumber of results per page
includeRiskScorebooleanNoSet to true to include risk metrics (default: false)
passcodestringNoPasscode if your portfolio is protected
For better security, pass the share token and passcode in headers:
curl -H "X-API-KEY: your-api-key" \
     -H "sharetoken: YOUR_SHARE_TOKEN" \
     -H "passcode: 123456" \
     "https://openapiv1.coinstats.app/portfolio/coins?includeRiskScore=true"

Example Response

{
  "result": [
    {
      "count": 44.4987,
      "coin": {
        "rank": 2,
        "identifier": "ethereum",
        "symbol": "ETH",
        "name": "Ethereum",
        "icon": "https://static.coinstats.app/coins/1650455629727.png",
        "isFake": false,
        "isFiat": false,
        "priceChange24h": -5.74,
        "priceChange1h": 0.1,
        "priceChange7d": 1.12,
        "volume": 61315198931.43572
      },
      "price": {
        "USD": 4343.564311034,
        "BTC": 0.039479708,
        "ETH": 1
      },
      "profit": {
        "allTime": {
          "USD": 83720.75297372,
          "BTC": 0.054246576,
          "ETH": -0.0008427712028833412
        },
        "hour24": {
          "USD": -11770.04265107636,
          "BTC": -0.055726915608058335,
          "ETH": 0
        },
        "lastTrade": {
          "USD": -0.0011652685976688212,
          "BTC": -8.325768295004658e-9,
          "ETH": 8.470329472543003e-22
        },
        "unrealized": {
          "USD": 64875.375139922,
          "BTC": 0.516615331,
          "ETH": -0.000013421973257266018
        },
        "realized": {
          "USD": 18844.785945298,
          "BTC": -0.46237401135664413,
          "ETH": -0.0008426785167330308
        }
      },
      "averageBuy": {
        "USD": 2800.50,
        "BTC": 0.028,
        "ETH": 0.95
      },
      "averageSell": {
        "USD": 3200.00,
        "BTC": 0.032,
        "ETH": 1.05
      },
      "profitPercent": {
        "allTime": {
          "USD": 55.2,
          "BTC": 41.0,
          "ETH": -0.09
        },
        "unrealized": {
          "USD": 42.5,
          "BTC": 38.2,
          "ETH": -0.01
        },
        "realized": {
          "USD": 14.2,
          "BTC": -15.5,
          "ETH": -0.08
        }
      },
      "liquidityScore": 94.44676177373067,
      "volatilityScore": 6.823477152064536,
      "marketCapScore": 90.15554879029162,
      "riskScore": 7.407055529347417,
      "avgChange": 2.631321607022045
    }
  ]
}

Response Fields

  • count: Amount of the coin you hold
  • coin.rank: Market cap rank
  • coin.identifier: Unique coin identifier
  • coin.symbol: Coin ticker symbol
  • coin.name: Full coin name
  • coin.icon: Coin logo URL
  • coin.priceChange24h: 24-hour price change percentage
  • coin.priceChange1h: 1-hour price change percentage
  • coin.priceChange7d: 7-day price change percentage
  • coin.volume: 24-hour trading volume
Current prices in multiple currencies:
  • price.USD: Price in US Dollars
  • price.BTC: Price in Bitcoin
  • price.ETH: Price in Ethereum
  • profit.allTime: Total profit/loss since first purchase
  • profit.hour24: Profit/loss in the last 24 hours
  • profit.lastTrade: Profit/loss from the most recent trade
  • profit.unrealized: Profit/loss on holdings not yet sold
  • profit.realized: Profit/loss from completed sales
  • averageBuy: Average price paid when buying
  • averageSell: Average price received when selling
Only included when includeRiskScore=true:
  • liquidityScore: Market liquidity metric (0-100)
  • volatilityScore: Price volatility metric (0-100)
  • marketCapScore: Market capitalization score (0-100)
  • riskScore: Overall risk assessment (0-100)
  • avgChange: Average price change percentage

Use Cases

Portfolio Analysis

Analyze your complete crypto holdings with detailed profit/loss data

Performance Tracking

Monitor individual coin performance and identify top performers

Risk Management

Use risk scores to assess portfolio volatility and liquidity

Tax Reporting

Export realized and unrealized gains for tax calculations

Pagination

For portfolios with many coins, use pagination to manage results:
# Get first 20 coins
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/portfolio/coins?shareToken=YOUR_SHARE_TOKEN&page=1&limit=20"

# Get next 20 coins
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/portfolio/coins?shareToken=YOUR_SHARE_TOKEN&page=2&limit=20"

Error Handling

{
  "error": "shareToken is required"
}
Solution: Include the share token in your request
{
  "error": "Invalid API key"
}
Solution: Check that your API key is correct and active
{
  "error": "This endpoint requires a Degen plan subscription"
}
Solution: Upgrade to a Degen plan to access portfolio endpoints
{
  "error": "Shared portfolio not found"
}
Solution: Verify your share token is correct
{
  "error": "Passcode required for this portfolio"
}
Solution: Include the correct passcode in your request
Make sure you have a valid share token before making requests. See the Share Token Authentication guide for detailed instructions on getting your token.