Documentation index

getInflationReward

Returns the inflation / staking reward for a list of addresses for a given epoch. This is the primary method for querying historical staking rewards, which is essential for staking dashboards, tax reporting tools, and validator performance analysis. Each address receives its reward amount, effective slot, epoch, and commission at the time of the reward.

Parameters

#TypeRequiredDescription
1array[string]YesArray of base-58 encoded addresses to query (up to a maximum of about 1000)
2objectNoConfiguration object

Configuration object fields:

FieldTypeDescription
commitmentstringCommitment level: processed, confirmed, or finalized
epochu64Epoch for which to query rewards. Defaults to the previous epoch
minContextSlotnumberMinimum slot at which the request can be evaluated

Response

Returns an array of reward objects (or null for addresses with no reward):

FieldTypeDescription
[].epochu64The epoch for which the reward was earned
[].effectiveSlotu64The slot at which the reward became active
[].amountu64Reward amount in lamports
[].postBalanceu64Post-reward account balance in lamports
[].commission`u8null`

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": "getInflationReward",
  "params": [
    ["6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu", "BGsqMegLpV6zuPNGETrSECFQdDtaYcKjkrKBF8eLnNPb"],
    { "epoch": 384 }
  ]
}'

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: "getInflationReward",
    params: [
      [
        "6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
        "BGsqMegLpV6zuPNGETrSECFQdDtaYcKjkrKBF8eLnNPb"
      ],
      { epoch: 384 }
    ]
  }),
});
const { result } = await response.json();
result.forEach((r, i) => r && console.log(`Address ${i}: ${r.amount} lamports`));

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getInflationReward",
    "params": [
        [
            "6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
            "BGsqMegLpV6zuPNGETrSECFQdDtaYcKjkrKBF8eLnNPb"
        ],
        {"epoch": 384}
    ]
})
result = response.json()["result"]
for i, r in enumerate(result):
    if r: print(f"Address {i}: {r['amount']} 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": "getInflationReward",
            "params": [
                ["6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu", "BGsqMegLpV6zuPNGETrSECFQdDtaYcKjkrKBF8eLnNPb"],
                {"epoch": 384}
            ]
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": [
    {
      "epoch": 384,
      "effectiveSlot": 166752000,
      "amount": 2500000,
      "postBalance": 500002500000,
      "commission": null
    },
    null
  ],
  "id": 1
}