Documentation index

getBalance

Returns the native SOL balance of an account in lamports (1 SOL = 1,000,000,000 lamports). This is one of the most commonly used RPC methods for checking wallet balances, verifying account funding, and monitoring SOL holdings in real-time. It is lightweight and returns a single numeric value, making it ideal for frequent polling scenarios.

Parameters

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

Configuration object fields:

FieldTypeDescription
commitmentstringCommitment level: processed, confirmed, or finalized
minContextSlotnumberMinimum slot at which the request can be evaluated

Response

Returns an RpcResponse object:

FieldTypeDescription
context.slotu64The slot at which the value was read
valueu64The balance in lamports

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": "getBalance",
  "params": [
    "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
    { "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: "getBalance",
    params: [
      "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
      { commitment: "confirmed" }
    ]
  }),
});
const { result } = await response.json();
console.log("Balance:", result.value / 1e9, "SOL");

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBalance",
    "params": [
        "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
        {"commitment": "confirmed"}
    ]
})
result = response.json()["result"]
print(f"Balance: {result['value'] / 1e9} SOL")

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": "getBalance",
            "params": [
                "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
                {"commitment": "confirmed"}
            ]
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": {
    "context": { "slot": 123456789 },
    "value": 2500000000
  },
  "id": 1
}