Ask or search…
K
Links
💰

Token Balances API

Get a list of assets owned by a Solana address.

Overview

This will return a list of assets for the specified owner. Supported assets include NFTs and compressed NFTs (regular DAS), as well as fungible tokens and Token22 (Helius extension).
This method is the fastest way to return all assets belonging to a wallet.
The page parameter in starts at 1 .

Fungible Token Extension

DAS API traditionally has returned data for NFTs — at Helius, we've also added support for all tokens. To learn more, please visit Fungible Token Extension (Beta).
This feature can be enabled via the showFungible filter. When enabled, the response will include fungible tokens and their associated information (supply, balance, and price). Token22 tokens are supported and their extensions are parsed. For richer options, consider using Search Assets.
post
https://rpc.helius.xyz
/api-key=<api_key>
getAssetsByOwner
Parameters
Query
api-key*
string
The API key.
Body
Example
Schema
{
"jsonrpc": "2.0",
"id": "string",
"method": "getAssetsByOwner",
"params": {
"ownerAddress": "string",
"page": 1,
"limit": 100,
"sortBy": {
"sortBy": "created",
"sortDirection": "asc"
},
"before": "string",
"after": "string",
"displayOptions": {
"showUnverifiedCollections": false,
"showCollectionMetadata": false,
"showGrandTotal": false,
"showFungible": false
}
}
}
Responses
200: OK
Successful response
400: Bad Request
Invalid request.
401: Unauthorized
Unauthorized request.
403: Forbidden
Request was forbidden.
404: Not Found
The specified resource was not found.
429: Too Many Requests
Exceeded rate limit..
500: Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request.

Suggested Use Cases

The Fungible Token Extension also returns the USD prices of token holdings.
Using 'Get Assets by Owner' to return all tokens from a user wallet enables the creation of::
  • A wallet tracker.
  • A portfolio viewer for both fungible and non-fungible tokens.
  • A token-gated dApp.

Example

Get NFTs & compressed NFTs from the toly.sol wallet:
const url = `https://mainnet.helius-rpc.com/?api-key=<api_key>`
const getAssetsByOwner = async () => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-id',
method: 'getAssetsByOwner',
params: {
ownerAddress: '86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY',
page: 1, // Starts at 1
limit: 1000,
},
}),
});
const { result } = await response.json();
console.log("Assets by Owner: ", result.items);
};
getAssetsByOwner();
Get ALL assets from the toly.sol wallet:
const getAssetsByOwner = async () => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-id',
method: 'getAssetsByOwner',
params: {
ownerAddress: '86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY',
page: 1, // Starts at 1
limit: 1000,
displayOptions: {
showFungible: true //return both fungible and non-fungible tokens
}
},
}),
});
const { result } = await response.json();
console.log("Assets by Owner: ", result.items);
};
getAssetsByOwner();