> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Solana Wallet Tracker API: Holdings and Trades

> Track any Solana wallet: token holdings, recent swaps, and portfolio value. Add PnL V2 for cost basis and Datastream for live wallet updates.

Use wallet endpoints for token holdings, recent swaps, and portfolio value. Add PnL V2 when you need cost basis, realized returns, or per-token performance.

> [!NOTE]
>
> PnL means profit and loss. For detailed PnL with cost basis, win rate, and realized profit, use the [PnL V2 wallet endpoints](https://docs.solanatracker.io/guides/pnl-v2/wallet-analysis.md) instead.

## Wallet tokens

The [wallet tokens endpoint](https://docs.solanatracker.io/data-api/wallet/get-wallet-tokens.md) returns token holdings and their current values.

```bash cURL theme={null}
curl "https://data.solanatracker.io/wallet/{walletAddress}" \
  -H "x-api-key: YOUR_API_KEY"
```

```javascript JavaScript theme={null}
const wallet = "YOUR_WALLET_ADDRESS";

const res = await fetch(`https://data.solanatracker.io/wallet/${wallet}`, {
  headers: { "x-api-key": "YOUR_API_KEY" }
});
const { tokens } = await res.json();

tokens.forEach(t => {
  console.log(`${t.token.name}: ${t.balance} ($${t.value?.toFixed(2)})`);
});
```

```python Python theme={null}
import requests

wallet = "YOUR_WALLET_ADDRESS"
res = requests.get(f"https://data.solanatracker.io/wallet/{wallet}",
    headers={"x-api-key": "YOUR_API_KEY"})

for t in res.json()["tokens"]:
    print(f"{t['token']['name']}: {t['balance']} (${t.get('value', 0):.2f})")
```

### Paginated holdings

For wallets with many tokens, use the [paginated endpoint](https://docs.solanatracker.io/data-api/wallet/get-wallet-tokens-with-pagination.md):

```bash theme={null}
# Page 1 (first page)
curl "https://data.solanatracker.io/wallet/{wallet}/page/1" \
  -H "x-api-key: YOUR_API_KEY"
```

## Basic wallet info

Use the [basic wallet endpoint](https://docs.solanatracker.io/data-api/wallet/get-basic-wallet-information.md) for totals without the full token list.

```bash theme={null}
curl "https://data.solanatracker.io/wallet/{wallet}/basic" \
  -H "x-api-key: YOUR_API_KEY"
```

## Wallet trades

The [wallet trades endpoint](https://docs.solanatracker.io/data-api/wallet/get-wallet-trades.md) returns recent trades across all tokens for a wallet.

```bash cURL theme={null}
curl "https://data.solanatracker.io/wallet/{wallet}/trades" \
  -H "x-api-key: YOUR_API_KEY"
```

```javascript JavaScript theme={null}
const wallet = "YOUR_WALLET_ADDRESS";

const res = await fetch(`https://data.solanatracker.io/wallet/${wallet}/trades`, {
  headers: { "x-api-key": "YOUR_API_KEY" }
});
const { trades } = await res.json();

trades.forEach(t => {
  console.log(`${t.from.token.symbol} → ${t.to.token.symbol}: $${t.volume.usd.toFixed(2)} at ${new Date(t.time).toISOString()}`);
});
```

## Portfolio chart

Use the [wallet chart endpoint](https://docs.solanatracker.io/data-api/wallet/get-wallet-portfolio-chart.md) to plot portfolio value over time.

![Wallet dashboard showing net worth, identity tags, and portfolio chart](https://mintcdn.com/solanatracker/ZM5vWoSAJUJFeh6A/images/guides/wallet-tags.png?fit=max\&auto=format\&n=ZM5vWoSAJUJFeh6A\&q=85\&s=01ede7436f795c1f3e4887d29d4226e1)

```bash theme={null}
curl "https://data.solanatracker.io/wallet/{wallet}/chart" \
  -H "x-api-key: YOUR_API_KEY"
```

## Wallet PnL

Use [PnL V2](https://docs.solanatracker.io/guides/pnl-v2/overview.md) for wallet summaries, token positions, identity tags (including [SNS primary `.sol` domains](https://docs.solanatracker.io/guides/pnl-v2/sns-identity)), PnL modes, and batch lookups.

```bash theme={null}
# Wallet-level PnL summary
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}" \
  -H "x-api-key: YOUR_API_KEY"

# All token positions for a wallet
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/positions?sort=total&direction=desc" \
  -H "x-api-key: YOUR_API_KEY"

# Token-specific PnL
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/tokens/{token}" \
  -H "x-api-key: YOUR_API_KEY"
```

## Top traders

Use the [Solana Traders Leaderboard](https://docs.solanatracker.io/guides/pnl-v2/leaderboards.md#solana-traders-leaderboard) for Solana-wide trader rankings, and [Token Intelligence](https://docs.solanatracker.io/guides/pnl-v2/token-intelligence.md) for token-specific trader rankings.

### Solana traders leaderboard

```bash theme={null}
curl "https://data.solanatracker.io/v2/pnl/leaderboard/top?days=30&sort=realized&direction=desc&limit=50" \
  -H "x-api-key: YOUR_API_KEY"
```

### Token-specific top traders

```bash theme={null}
curl "https://data.solanatracker.io/v2/pnl/tokens/{token}/traders?sort=pnl&direction=desc&limit=50" \
  -H "x-api-key: YOUR_API_KEY"
```

## Example: wallet dashboard

```javascript theme={null}
const wallet = "YOUR_WALLET_ADDRESS";
const headers = { "x-api-key": "YOUR_API_KEY" };

// 1. Basic info
const basic = await fetch(
  `https://data.solanatracker.io/wallet/${wallet}/basic`, { headers }
).then(r => r.json());

// 2. All holdings
const holdings = await fetch(
  `https://data.solanatracker.io/wallet/${wallet}`, { headers }
).then(r => r.json());

// 3. Recent trades
const trades = await fetch(
  `https://data.solanatracker.io/wallet/${wallet}/trades`, { headers }
).then(r => r.json());

// 4. Portfolio chart
const chart = await fetch(
  `https://data.solanatracker.io/wallet/${wallet}/chart`, { headers }
).then(r => r.json());

console.log(`Tokens held: ${holdings.tokens.length}`);
console.log(`Recent trades: ${trades.trades.length}`);
console.log(`Chart data points: ${chart.chartData.length}`);
```

> [card] [Wallet PnL](https://docs.solanatracker.io/guides/pnl-v2/wallet-analysis.md)
>
> Full PnL calculations with cost basis, win rate, and position tracking.

> [card] [KOL performance](https://docs.solanatracker.io/guides/kol-tracking.md)
>
> Track and compare KOL wallet performance over time.

> [card] [Live risk signals](https://docs.solanatracker.io/guides/datastream-safety.md)
>
> Monitor wallet transactions and balance changes in real time.

> [card] [Live prices](https://docs.solanatracker.io/guides/datastream-prices.md)
>
> Stream real-time prices for tokens in a wallet's portfolio.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.