getMultipleAccounts
Last updated:
getMultipleAccounts fetches the current on-chain state of several accounts at
once, identified by their base-58 public keys. It is the batched counterpart of
getAccountInfo: instead of one request per account, you
pass up to 100 public keys and receive one AccountInfo entry per key, in
the same order you requested them.
Use it whenever you would otherwise loop over getAccountInfo — for example to
read a set of token accounts, several PDAs, or a basket of mints — to cut
latency and stay well within your rate limit. All accounts are read at the same
slot, so the returned values are mutually consistent.
The value array is positional and the same length as the pubkeys you sent.
Any account that does not exist comes back as a null entry at that position
(the surrounding array and context are still populated). The shape of each
account's data field depends on the encoding you request, exactly as for
getAccountInfo.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| pubkeys | array | Yes | |
| config | GetAccountInfoConfig | No |
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"getMultipleAccounts","params":[["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],{"encoding":"base64"}],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "getMultipleAccounts",
"params": [
[
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
{
"encoding": "base64"
}
],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/sol",
headers={"Authorization": "Bearer <api-key>"},
json={"id":1,"method":"getMultipleAccounts","params":[["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],{"encoding":"base64"}],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does getMultipleAccounts do?
- Returns the account information for a list of Solana public keys in a single round-trip.
- How many credits does getMultipleAccounts cost?
- getMultipleAccounts costs 1 credit(s) per call on Triport by default.
- Is getMultipleAccounts available over WebSocket?
- getMultipleAccounts is an HTTP JSON-RPC method.