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

# How to Get Solana SPL Tokens: Complete API Guide

> Retrieve and query Solana SPL token data with Helius: balances, token accounts, supply, holders, and the fungible token extension, with code examples.

## Overview

This guide covers reading fungible tokens on Solana: account balances, token accounts by owner or mint, total supply, largest holders, and the DAS fungible token extension. Helius exposes both standard Solana RPC token methods and DAS methods that add metadata and USD prices.

For NFTs, compressed NFTs, editions, and proofs, see the [Get Assets guide](/das/get-nfts). This page focuses on fungible (SPL and Token-2022) tokens.

## When to use this

Use the methods on this page when you are:

* Reading the balance of a single token account
* Listing every token account a wallet holds
* Finding all accounts that hold a specific mint
* Checking a token's total supply or its largest holders
* Fetching token metadata and USD price alongside balances

## Token account balance

Get the balance for a specific token account using standard RPC:

```typescript theme={"system"}
const response = await fetch("https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY", {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: '1',
    method: 'getTokenAccountBalance',
    params: [
      '3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa'
    ]
  })
});
const data = await response.json();
console.log(data);
```

<Card title="API Reference" horizontal icon="code" href="/api-reference/rpc/http/gettokenaccountbalance">
  getTokenAccountBalance
</Card>

## Token accounts by owner

List all token accounts owned by a wallet:

```typescript theme={"system"}
const response = await fetch("https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY", {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: '1',
    method: 'getTokenAccountsByOwner',
    params: [
      '86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY',
      {
        programId: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
      },
      {
        encoding: 'jsonParsed'
      }
    ]
  })
});
const data = await response.json();
console.log(data);
```

<Card title="API Reference" horizontal icon="code" href="/api-reference/rpc/http/gettokenaccountsbyowner">
  getTokenAccountsByOwner
</Card>

## Token accounts by mint

List all accounts holding a specific token:

```typescript theme={"system"}
const response = await fetch("https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY", {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: '1',
    method: 'getTokenAccountsByOwner',
    params: [
      'CEXq1uy9y15PL2Wb4vDQwQfcJakBGjaAjeuR2nKLj8dk',
      {
        mint: "8wXtPeU6557ETkp9WHFY1n1EcU6NxDvbAggHGsMYiHsB"
      },
      {
        encoding: 'jsonParsed'
      }
    ]
  })
});
const data = await response.json();
console.log(data);
```

<Card title="API Reference" horizontal icon="code" href="/api-reference/rpc/http/gettokenaccountsbyowner">
  getTokenAccountsByOwner
</Card>

To find every account holding a mint across all owners (not just one owner), use the DAS `getTokenAccounts` method described below.

## Token supply

Check the total supply of a token:

```typescript theme={"system"}
const response = await fetch("https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY", {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: '1',
    method: 'getTokenSupply',
    params: [
      'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    ]
  })
});
const data = await response.json();
console.log(data);
```

<Card title="API Reference" horizontal icon="code" href="/api-reference/rpc/http/gettokensupply">
  getTokenSupply
</Card>

## Largest token holders

Identify the largest accounts holding a token:

```typescript theme={"system"}
const response = await fetch("https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY", {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: '1',
    method: 'getTokenLargestAccounts',
    params: [
      'he1iusmfkpAdwvxLNGV8Y1iSbj4rUy6yMhEA3fotn9A'
    ]
  })
});
const data = await response.json();
console.log(data);
```

<Card title="API Reference" horizontal icon="code" href="/api-reference/rpc/http/gettokenlargestaccounts">
  getTokenLargestAccounts
</Card>

Returns up to the 20 largest accounts for the mint:

```json theme={"system"}
{
  "context": { "slot": 0 },
  "value": [
    { "address": "...", "amount": "1000000000000", "decimals": 9, "uiAmount": 1000.0, "uiAmountString": "1000" }
  ]
}
```

## Token accounts with the DAS API

The DAS `getTokenAccounts` method returns token accounts by mint or owner, including balances, in a single paginated call. Unlike `getTokenAccountsByOwner`, you can query by `mint` alone to list every account holding a token across all owners.

```typescript theme={"system"}
const url = `https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`;

const getTokenAccounts = async (params) => {
  const response = await fetch(url, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      jsonrpc: "2.0",
      id: "my-request-id",
      method: "getTokenAccounts",
      params: params,
    }),
  });

  const { result } = await response.json();
  return result;
};

// Example: Get all accounts holding a specific token
getTokenAccounts({
  mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC
  page: 1,
  limit: 100
});
```

<Card title="API Reference" horizontal icon="code" href="/api-reference/das/gettokenaccounts">
  getTokenAccounts
</Card>

Paginated; each entry includes the account, mint, owner, and balance:

```json theme={"system"}
{
  "total": 100,
  "limit": 100,
  "page": 1,
  "token_accounts": [
    { "address": "...", "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "owner": "...", "amount": 12345678 }
  ]
}
```

## Token metadata and price with the DAS API

For token metadata and USD price, call the DAS `getAsset` method with `showFungible` enabled. Prices for verified tokens are returned under `token_info.price_info`.

<Note>
  Price data from `getAsset` is cached for up to 600 seconds, so it can be up to 10 minutes old.
</Note>

```typescript theme={"system"}
const response = await fetch("https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY", {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: '1',
    method: 'getAsset',
    params: {
      id: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263', // Bonk
      options: {
        showFungible: true
      }
    }
  })
});
const { result } = await response.json();
console.log(result.token_info.price_info);
```

<Card title="API Reference" horizontal icon="code" href="/api-reference/das/getasset">
  getAsset
</Card>

The response returns supply, decimals, and price under `token_info`:

```json theme={"system"}
{
  "token_info": {
    "symbol": "Bonk",
    "supply": 8881594973561640000,
    "decimals": 5,
    "token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
    "price_info": {
      "price_per_token": 0.0000192271,
      "currency": "USDC"
    }
  }
}
```

### Calculate market cap

Multiply the price by the decimal-adjusted supply:

```typescript theme={"system"}
const { price_per_token } = result.token_info.price_info;
const { supply, decimals } = result.token_info;
const marketCap = (supply / Math.pow(10, decimals)) * price_per_token;
```

To list every fungible token in a wallet (with balances and prices) in one call, use `getAssetsByOwner` or `searchAssets` with `tokenType: "fungible"`. See the [fungible token extension](/das/fungible-token-extension) for how `tokenType`, balances, Token-2022 extensions, and price data appear in the response.

## Best practices

* Use pagination for methods that return large result sets. See the [Pagination guide](/das/pagination).
* Prefer DAS methods (`getAsset`, `getAssetsByOwner`, `getTokenAccounts`) when you need metadata or USD prices; use standard RPC methods for raw on-chain balances and supply.
* Handle errors gracefully with try/catch blocks and retries.
* Cache responses when appropriate to reduce API calls.

## Next steps

<CardGroup cols={3}>
  <Card title="Fungible Token Extension" icon="coins" href="/das/fungible-token-extension">
    How DAS returns fungible tokens, Token-2022 extensions, and prices.
  </Card>

  <Card title="Get Assets (NFTs)" icon="image" href="/das/get-nfts">
    Retrieve NFTs, compressed NFTs, editions, and proofs.
  </Card>

  <Card title="DAS API reference" icon="code" href="/api-reference/das">
    Full schemas for every DAS method.
  </Card>
</CardGroup>
