Historical Accounts
getHistoricalAccountInfo
Read any Solana account as it was at a past slot or right after a specific transaction, with getAccountInfo encodings and the position of the last write.
POST
/
getHistoricalAccountInfo
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{
"slot": 445000000
},
{
"encoding": "jsonParsed"
}
]
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", { "slot": 445000000 }, { "encoding": "jsonParsed" }]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'getHistoricalAccountInfo',
params: [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
{slot: 445000000},
{encoding: 'jsonParsed'}
]
})
};
fetch('https://mainnet.helius-rpc.com/?api-key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.helius-rpc.com/?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'getHistoricalAccountInfo',
'params' => [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
[
'slot' => 445000000
],
[
'encoding' => 'jsonParsed'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mainnet.helius-rpc.com/?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mainnet.helius-rpc.com/?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"context": {
"slot": 468129571
},
"value": {
"lamports": 531589475273,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"data": [
"<string>"
],
"executable": false,
"rentEpoch": 123,
"space": 82,
"lastUpdatedAt": {
"slot": 444999837,
"transactionIndex": 700
}
}
}
}{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Invalid params"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "Unauthorized"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "Too many requests"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32603,
"message": "Internal error"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32002,
"message": "Service unavailable"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "Gateway timeout"
},
"id": "1"
}getHistoricalAccountInfo is in Beta. Parameters, pricing, response formats, and data coverage may change.Overview
getHistoricalAccountInfo returns a Solana account as it was at a past slot, or immediately after a specific transaction in that slot. It’s a Helius-exclusive RPC method. Standard getAccountInfo only returns current state.
The response has the same account fields as getAccountInfo, plus lastUpdatedAt: the slot and transaction that last wrote the state you received.
History is available from slot 444,959,999 (September 7, 2026) onward, which is the state at the start of epoch 1030. Requests for earlier slots return error -32018.
getHistoricalAccountInfo is available on mainnet for Business plans and above, and costs 0 credits per call during the beta period. Pricing is subject to change.
Choose a position in history
The second parameter is a query object that selects which point in history to read:| Query | Returns the account |
|---|---|
Omitted or {} | At the latest indexed slot, capped at the requested commitment |
{ "slot": 445000000 } | At the end of slot 445,000,000 |
{ "slot": 445000000, "transactionIndex": 10 } | Immediately after the transaction at index 10 in slot 445,000,000 executed |
transactionIndex requires slot. To read an account right before the transaction at index N, query transactionIndex: N - 1. For the first transaction in a slot, query the previous slot with no transactionIndex.
Non-transaction writes, such as epoch rewards, are applied at the end of the slot. A query with transactionIndex never includes them.
Example request
curl https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{ "slot": 445000000 },
{ "encoding": "jsonParsed" }
]
}'
Read the response
valueis the account as it was at the requested position, ornullif the account didn’t exist then: it hadn’t been created yet, or it had been closed. Anullresponse has nolastUpdatedAt.lastUpdatedAt.slotandlastUpdatedAt.transactionIndexidentify the write that produced this state. The write is at or before the position you asked for.lastUpdatedAt.transactionIndexisnullwhen the write happened outside a transaction, such as epoch rewards.lastUpdatedAt.slotof 444,959,999 with anulltransactionIndexmeans the account hasn’t changed since history coverage began. It doesn’t mean the account was written in that slot.context.slotis the latest slot Helius had indexed when it served the request, not the slot you queried.jsonParsedtoken accounts use the mint’s decimals as of the requested position. If the mint can’t be read at that position, the account falls back to base64.
lastUpdatedAt as a cursor. See Walk back through account history.
Errors
| Code | Meaning |
|---|---|
-32018 | The slot is before history coverage begins (slot 444,959,999) |
-32004 | The slot is newer than the requested commitment allows. Use confirmed or query an older slot |
-32602 | Invalid parameters, such as transactionIndex without slot, base58 encoding, or an unknown configuration field |
-32601 | Method not found. Call your Helius mainnet or Gatekeeper endpoint; the method isn’t available on devnet |
Related methods
Historical Accounts Guide
How positions, coverage, and lastUpdatedAt work for historical account methods
getHistoricalTokenAccountsByOwner
List a wallet’s token accounts at a past slot
getTransactionsForAddress
Find the slot and transactionIndex of the transactions you want to inspect
getAccountInfo
Read an account’s current state
Request Parameters
Slot to read state at. Returns the account as of the end of this slot. The earliest supported slot is 444959999, the state at the start of epoch 1030. When omitted, reads the latest indexed slot, capped at the requested commitment.
Position of a transaction within the slot. Returns the account state immediately after that transaction executed, instead of at the end of the slot. Requires slot.
Encoding format for account data. base58 and binary are not supported.
base64base64+zstdjsonParsed
Authorizations
Your Helius API key. You can get one for free in the dashboard.
Body
application/json
Array containing the account address, an optional query object that selects the position in history, and an optional configuration object.
Required array length:
1 - 3 elementsBase-58 encoded address of the account to read.
Example:
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
Was this page helpful?
⌘I
getHistoricalAccountInfo
curl --request POST \
--url 'https://mainnet.helius-rpc.com/?api-key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
{
"slot": 445000000
},
{
"encoding": "jsonParsed"
}
]
}
'import requests
url = "https://mainnet.helius-rpc.com/?api-key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getHistoricalAccountInfo",
"params": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", { "slot": 445000000 }, { "encoding": "jsonParsed" }]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'getHistoricalAccountInfo',
params: [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
{slot: 445000000},
{encoding: 'jsonParsed'}
]
})
};
fetch('https://mainnet.helius-rpc.com/?api-key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.helius-rpc.com/?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'getHistoricalAccountInfo',
'params' => [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
[
'slot' => 445000000
],
[
'encoding' => 'jsonParsed'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mainnet.helius-rpc.com/?api-key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mainnet.helius-rpc.com/?api-key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getHistoricalAccountInfo\",\n \"params\": [\n \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n {\n \"slot\": 445000000\n },\n {\n \"encoding\": \"jsonParsed\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": {
"context": {
"slot": 468129571
},
"value": {
"lamports": 531589475273,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"data": [
"<string>"
],
"executable": false,
"rentEpoch": 123,
"space": 82,
"lastUpdatedAt": {
"slot": 444999837,
"transactionIndex": 700
}
}
}
}{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Invalid params"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "Unauthorized"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "Too many requests"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32603,
"message": "Internal error"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32002,
"message": "Service unavailable"
},
"id": "1"
}{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "Gateway timeout"
},
"id": "1"
}