getTokenAccountsByOwnerV2
Last updated:
`getTokenAccountsByOwnerV2` returns the SPL token accounts owned by a given wallet address, filtered by either a specific mint or a token program. It is the enhanced successor to [`getTokenAccountsByOwner`](getTokenAccountsByOwner.md): the V2 variant is intended to add cursor-based pagination so that owners holding large numbers of token accounts can be enumerated reliably without hitting response-size limits.
Use it when you want to list a wallet's token balances — for example to render a portfolio view or to find the associated token account for a particular mint. For a single mint you should still pass a `filter` so the validator only returns the relevant accounts rather than the owner's entire token set.
This method is served directly from the validator (not the DAS index), so it is available on the **free** tier and up under the `sol_read_rpc` category. It is *not* one of the heavily throttled `sol_read_rpc_heavy` methods, so it carries the standard 20 / 60 / 200 / 600 RPS allowances.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://<your-endpoint>/ \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwnerV2","params":[]}'const res = await fetch("https://<your-endpoint>/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"id": 1,
"method": "getTokenAccountsByOwnerV2",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getTokenAccountsByOwnerV2","params":[],"jsonrpc":"2.0"})
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does getTokenAccountsByOwnerV2 do?
- Enhanced, paginated version of `getTokenAccountsByOwner` that returns the SPL token accounts owned by a given address.
- How many credits does getTokenAccountsByOwnerV2 cost?
- getTokenAccountsByOwnerV2 costs 1 credit(s) per call on Triport by default.
- Is getTokenAccountsByOwnerV2 available over WebSocket?
- getTokenAccountsByOwnerV2 is an HTTP JSON-RPC method.