getAccountInfo

Read a single Solana account's data and metadata over rpc edge JSON-RPC, with encoding and commitment options.

getAccountInfo returns all information associated with a single account: its lamport balance, owner program, data, and metadata. It is the workhorse read for any client that needs on-chain state - token accounts, program state, PDAs.

Request

Use the JSON-RPC endpoint and authenticate like any other call:

https://rpc.rpcedge.com
https://frankfurt.rpc.rpcedge.com
curl -s https://rpc.rpcedge.com \
  -H 'content-type: application/json' \
  -H 'x-api-key: YOUR_UUID_KEY' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAccountInfo",
    "params": [
      "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
      { "encoding": "base64", "commitment": "processed" }
    ]
  }'

Or from Python with requests:

account.py
import requests
 
ENDPOINT = "https://rpc.rpcedge.com?key=YOUR_UUID_KEY"
 
res = requests.post(ENDPOINT, json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAccountInfo",
    "params": ["vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", {"encoding": "base64"}],
})
print(res.json()["result"]["value"])

Parameters

PositionNameTypeNotes
0pubkeystringBase-58 account address to query.
1configobjectOptional. Fields below.

Config fields:

FieldTypeNotes
commitmentstringprocessed | confirmed | finalized. Defaults to finalized.
encodingstringbase64 (recommended), base58 (slow, ≤129 bytes), base64+zstd, or jsonParsed.
dataSliceobject{ offset, length } to return only a byte range - cheaper for large accounts.
minContextSlotnumberFail if the node is behind this slot.

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": { "slot": 429641447 },
    "value": {
      "lamports": 2039280,
      "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "data": ["<base64>", "base64"],
      "executable": false,
      "rentEpoch": 361,
      "space": 165
    }
  }
}
FieldMeaning
context.slotSlot the read was served at.
valuenull if the account does not exist.
lamportsBalance in lamports (1 SOL = 1e9 lamports).
ownerProgram that owns the account.
dataAccount data - [string, encoding], or a parsed object with jsonParsed.
spaceData length in bytes.
getAccountInfo · rpc edge docs