Solana
Solana
Solana
Free tier covers personal projects. Pay-as-you-go scales without a card.
On Solana — the high-throughput chain secured by Proof-of-History and Proof-of-Stake, with SOL as its native token — getTokenAccountsByOwner returns the token accounts owned by an address, filtered by mint or program. Because every SPL token a wallet holds lives in its own data account rather than a single balance map, this is the standard way to enumerate a wallet's holdings. Send a JSON-RPC 2.0 request with positional params to https://solana.therpc.io/YOUR_API_KEY, passing the owner pubkey plus a filter of either { mint } or { programId }, and you get an array of { pubkey, account } entries.
programId (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA).encoding: "jsonParsed", which decodes amount, decimals, and mint inline.| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | owner | string | Yes | Base-58 owner wallet address. |
| 2 | filter | object | Yes | Either { mint } or { programId } — exactly one. |
| 3 | config | object | No | Options: commitment, encoding (use jsonParsed for readable amounts), dataSlice, minContextSlot. |
| Type | Description |
|---|---|
| object | RpcResponse wrapping an array of { pubkey, account }. |
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
mint or programId — passing both, or an empty object, yields an Invalid params (-32602) error.TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb) than classic SPL Token. To cover a wallet completely, query both program IDs and merge the results.