OpenInfra.sh is now live - Solana infrastructure, included with every server. LEARN MORE HERE >

OpenInfra.shopeninfra.sh

getAccountInfo

Returns all information associated with the account at the given public key — lamports, owner program, raw data, and rent status.

Parameters

ParameterTypeRequiredDescription
pubkeystringYesBase58-encoded public key of the account to query
encodingstringNoData encoding: base58 | base64 | base64+zstd | jsonParsed
commitmentstringNoprocessed | confirmed | finalized (default: finalized)
dataSliceobjectNo{ offset, length } — return a subset of account data
minContextSlotnumberNoMinimum slot at which the request may be evaluated

Request

{  "jsonrpc": "2.0",  "id": 1,  "method": "getAccountInfo",  "params": [    "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",    { "encoding": "base64", "commitment": "confirmed" }  ]}

Response

{  "jsonrpc": "2.0",  "id": 1,  "result": {    "context": { "slot": 312449201 },    "value": {      "lamports": 1461600,      "data": ["AQAAAAD...", "base64"],      "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",      "executable": false,      "rentEpoch": 361,      "space": 165    }  }}

value is null when the account does not exist or has been closed. Check for this before destructuring.

Notes

Use encoding: "jsonParsed" for token accounts, mint accounts, and other Metaplex/SPL types — the node will decode the raw bytes into a structured JSON object when the owner program is known.

For batch lookups use getMultipleAccounts to fetch up to 100 accounts in a single round-trip.