Documentation index

getAccountInfo

Returns all information associated with the account of the provided public key, including lamports balance, owner program, data content, and executable status. This is the most fundamental read operation on Solana, used by wallets, explorers, and dApps to inspect any on-chain account. It supports multiple encoding formats including jsonParsed for human-readable output of known program accounts such as SPL Token and System accounts.

Parameters

#TypeRequiredDescription
1stringYesBase-58 encoded public key of the account to query
2objectNoConfiguration object

Configuration object fields:

FieldTypeDescription
commitmentstringCommitment level: processed, confirmed, or finalized
encodingstringData encoding: base58, base64, base64+zstd, or jsonParsed
dataSliceobjectRequest a slice of the account data: { offset: number, length: number }. Only available for base58, base64, or base64+zstd encodings
minContextSlotnumberMinimum slot at which the request can be evaluated

Response

Returns an RpcResponse object with value set to null if the account does not exist, otherwise:

FieldTypeDescription
context.slotu64The slot at which the value was read
value.lamportsu64Number of lamports in the account
value.ownerstringBase-58 encoded program that owns the account
value.data[string, string]object
value.executableboolWhether the account contains a program
value.rentEpochu64The epoch at which this account will next owe rent
value.spaceu64The data size of the account

Code Examples

cURL

Terminal
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAccountInfo",
  "params": [
    "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
    { "encoding": "base64", "commitment": "confirmed" }
  ]
}'

TypeScript

TypeScript
const response = await fetch("http://88.216.36.108:7999", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getAccountInfo",
    params: [
      "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
      { encoding: "base64", commitment: "confirmed" }
    ]
  }),
});
const { result } = await response.json();
console.log("Lamports:", result.value.lamports);

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAccountInfo",
    "params": [
        "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
        {"encoding": "base64", "commitment": "confirmed"}
    ]
})
result = response.json()["result"]
print(f"Lamports: {result['value']['lamports']}")

Rust

Rust
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("http://88.216.36.108:7999")
        .json(&json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "getAccountInfo",
            "params": [
                "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
                {"encoding": "base64", "commitment": "confirmed"}
            ]
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": {
    "context": { "slot": 123456789 },
    "value": {
      "data": ["", "base64"],
      "executable": false,
      "lamports": 1000000000,
      "owner": "11111111111111111111111111111111",
      "rentEpoch": 361,
      "space": 0
    }
  },
  "id": 1
}