curl --request POST \
--url 'https://rpc-data.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwners",
"params": [
[
"Bs88sAYgQehsK2fkzn6fxB6FgSJJPbxzAmcfQ3Eb6TWC",
"BMLE4H5XLDS8WwCjEXCL9tmF4ZSNFnd5jmw2Xm9uG4To"
],
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "3.0.0",
"slot": 378770899
},
"value": [
{
"account": "424L75FrM5LTbNrbrqyCfrR4gWBn5rtzzaEhiSiNLC1h",
"amount": "146120000068",
"decimals": 6,
"owner": "BMLE4H5XLDS8WwCjEXCL9tmF4ZSNFnd5jmw2Xm9uG4To",
"slot": 356527310,
"uiAmount": 146120.000068,
"uiAmountString": "146120.000068"
},
{
"account": "EzewvqfZPbroCmuRiKFj3KoHQ1XkuDc8qJ9MYCTzcJUY",
"amount": "540966303",
"decimals": 6,
"owner": "Bs88sAYgQehsK2fkzn6fxB6FgSJJPbxzAmcfQ3Eb6TWC",
"slot": 370336402,
"uiAmount": 540.966303,
"uiAmountString": "540.966303"
}
]
}
}自定义查询
getTokenAccountsByOwners
一次查询最多 250 个钱包持有的同一代币余额。
POST
/
curl --request POST \
--url 'https://rpc-data.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwners",
"params": [
[
"Bs88sAYgQehsK2fkzn6fxB6FgSJJPbxzAmcfQ3Eb6TWC",
"BMLE4H5XLDS8WwCjEXCL9tmF4ZSNFnd5jmw2Xm9uG4To"
],
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "3.0.0",
"slot": 378770899
},
"value": [
{
"account": "424L75FrM5LTbNrbrqyCfrR4gWBn5rtzzaEhiSiNLC1h",
"amount": "146120000068",
"decimals": 6,
"owner": "BMLE4H5XLDS8WwCjEXCL9tmF4ZSNFnd5jmw2Xm9uG4To",
"slot": 356527310,
"uiAmount": 146120.000068,
"uiAmountString": "146120.000068"
},
{
"account": "EzewvqfZPbroCmuRiKFj3KoHQ1XkuDc8qJ9MYCTzcJUY",
"amount": "540966303",
"decimals": 6,
"owner": "Bs88sAYgQehsK2fkzn6fxB6FgSJJPbxzAmcfQ3Eb6TWC",
"slot": 370336402,
"uiAmount": 540.966303,
"uiAmountString": "540.966303"
}
]
}
}Get token balances for multiple wallets in a single request with getTokenAccountsByOwners. Powered by Ridge DB, our custom-built client designed for high-performance token account queries. Instead of making hundreds of individual requests, query up to 250 wallets at once for any token mint.
Query up to 250 wallet addresses in one request to reduce API calls and latency.
- If a wallet has multiple accounts for the same mint, the response returns all of them.
- If a wallet has no token account, the response returns a clean zero balance instead of an error.
- Each account includes the slot when the balance was last updated, which helps with caching and change tracking.
授权
请求体
application/json
The JSON-RPC protocol version.
可用选项:
2.0 示例:
"2.0"
A unique identifier for the request.
示例:
"1"
The name of the RPC method to invoke.
可用选项:
getTokenAccountsByOwners 示例:
"getTokenAccountsByOwners"
Parameters for the batch token balance query.
Array of owner wallet public keys to query (1-250 wallets). All pubkeys must be valid base-58 encoded Solana addresses.
Required array length:
1 - 250 elementsOwner wallet public key as a base-58 encoded string.
此页面对您有帮助吗?