> For the complete documentation index, see [llms.txt](https://docs.solanavibestation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.solanavibestation.com/api-reference/rewind/methods/getaccountinfo.md).

# getHistoricalAccountInfo

## getHistoricalAccountInfo — Historical account lookup at a chosen position

> Returns the state of \`pubkey\` at a chosen historical position.\
> \
> \*\*Parameters\*\*\
> \
> 0\. \`pubkey\` (required) — base58 account pubkey.\
> 1\. \`config\` (required) — positioning + encoding options. One of \`slot\` (end-of-slot, optionally with \`writeVersion\` for inside-a-slot) or \`anchor\` must be set.<br>

```json
{"openapi":"3.0.3","info":{"title":"Rewind RPC: getHistoricalAccountInfo","version":"1.0.0"},"tags":[{"name":"Rewind","description":"Historical account state, per-write change history, and historical simulation."}],"servers":[{"url":"https://rewind.solanavibestation.com","description":"Rewind service (all tiers routed by API key)"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Pass `Authorization: <api-key>` on each request."},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"Pass `?api_key=<api-key>` on the URL."}},"schemas":{"Anchor":{"type":"object","required":["signature"],"description":"Per-transaction positioning. The named transaction is resolved against the archive index and used as the boundary.","properties":{"signature":{"type":"string","description":"Base58 transaction signature. The slot is derived automatically from the archive — you don't need to know it."},"position":{"type":"string","enum":["before","after"],"default":"before","description":"`before` (default) loads the state that transaction read. `after` loads the state immediately after it finished writing. When the transaction was the first writer in its slot, `before` resolves to the end of the previous slot."}}},"Encoding":{"type":"string","enum":["base64","base64+zstd","base58","jsonParsed"],"default":"base64","description":"Encoding for account data:\n- `base64` — standard base64.\n- `base64+zstd` — zstd-compressed then base64'd.\n- `base58` — bs58. Rejected if post-`dataSlice` length > 129 bytes.\n- `jsonParsed` — solana-account-decoder for the standard parsable programs (token, token-2022, stake, vote, nonce, address lookup table, config, upgradeable loader, sysvars); falls back to `base64` for others. Token accounts are decoded with their mint's decimals as of the same position."},"DataSlice":{"type":"object","required":["offset","length"],"description":"Byte-slice applied to the account's data before encoding. Not allowed with `jsonParsed`.","properties":{"offset":{"type":"integer","format":"int64","minimum":0},"length":{"type":"integer","format":"int64","minimum":0}}},"JsonRpcEnvelope":{"type":"object","required":["jsonrpc","id"],"description":"Base envelope of every JSON-RPC 2.0 response.","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Echoed request id."}}},"RewindContext":{"type":"object","required":["apiVersion","slot"],"properties":{"apiVersion":{"type":"string"},"slot":{"type":"integer","format":"int64","description":"The resolved load slot. For end-of-slot calls this echoes the request's `slot`. For `anchor` calls this is the slot the signature resolves to."}}},"AccountInfo":{"type":"object","nullable":true,"description":"Account state, or `null` when no version exists at or before the resolved position and the account had not been created yet (or the account is filtered — Vote — from the archive; see `-32017`).","required":["lamports","owner","data","executable","rentEpoch","space","rewindSlot","rewindWriteVersion"],"properties":{"lamports":{"type":"integer","format":"int64","description":"Balance in lamports after this version."},"owner":{"type":"string","description":"Base58 program id that owns the account."},"data":{"oneOf":[{"type":"array","description":"[<encoded string>, \"<encoding>\"] for base64 / base64+zstd / base58.","items":{"type":"string"},"minItems":2,"maxItems":2},{"type":"object","description":"For `jsonParsed`: `{ \"program\", \"parsed\", \"space\" }`.","additionalProperties":true}]},"executable":{"type":"boolean"},"rentEpoch":{"type":"integer","format":"int64"},"space":{"type":"integer","format":"int64","description":"Full data length before `dataSlice`."},"rewindSlot":{"type":"integer","format":"int64","description":"Rewind extension. Actual slot of the version returned. `rewindSlot == request slot` means the account was written in the requested slot; a smaller value means the state was carried forward."},"rewindWriteVersion":{"type":"integer","format":"int64","description":"Rewind extension. The exact `writeVersion` of the returned version within `rewindSlot`. `(pubkey, rewindSlot, rewindWriteVersion)` is a stable cache key, and the pair can be passed to `getAccountChanges` as a `before` cursor."}}},"JsonRpcErrorResponse":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"JsonRpcError":{"type":"object","required":["code","message"],"description":"Structured JSON-RPC error. Rewind codes:\n\n- `-32014` Slot not available — position is above `latestSlot`. Query a live RPC.\n- `-32015` Slot before earliest — position is below `earliestSlot` (or an account's history at it aged out, with `data.lastWriteSlot`).\n- `-32016` Signature not found — `anchor.signature` not indexed.\n- `-32017` Filtered account — the account belongs to a class the archive does not track (Vote). `data` names the pubkey and owner.\n- `-32018` Slot in archive gap — resolved position inside a `partial`/`missing`/`unknown` slot. `data` carries the gap bounds.\n- `-32602` Invalid params.\n- `-32603` Internal error (transient; safe to retry).\n","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true,"description":"For `-32018`, includes `queriedSlot`, `gapStart`, `gapEnd`, `gapStatus`. For `-32017`, includes the offending pubkey and owner."}}}},"responses":{"UnauthorizedError":{"description":"Authentication required or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}},"ForbiddenError":{"description":"Insufficient permissions for the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}},"TooManyRequestsError":{"description":"Rate limit exceeded for this tier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}},"InternalServerError":{"description":"Unexpected server error. Treat as transient; safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}}}},"paths":{"/":{"post":{"operationId":"getHistoricalAccountInfo","summary":"getHistoricalAccountInfo — Historical account lookup at a chosen position","tags":["Rewind"],"description":"Returns the state of `pubkey` at a chosen historical position.\n\n**Parameters**\n\n0. `pubkey` (required) — base58 account pubkey.\n1. `config` (required) — positioning + encoding options. One of `slot` (end-of-slot, optionally with `writeVersion` for inside-a-slot) or `anchor` must be set.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"],"description":"JSON-RPC protocol version."},"id":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Request identifier echoed back in the response."},"method":{"type":"string","enum":["getHistoricalAccountInfo"],"description":"Must be `getHistoricalAccountInfo`."},"params":{"type":"array","description":"Positional parameters [pubkey, config].","minItems":2,"maxItems":2,"items":{"anyOf":[{"title":"pubkey","type":"string","description":"Account pubkey, base58-encoded."},{"title":"config","type":"object","description":"Positioning + encoding options.","properties":{"slot":{"type":"integer","format":"int64","description":"End-of-slot boundary, or (with `writeVersion`) the slot for the inside-a-slot cursor. Required unless `anchor` is set; not allowed with `anchor`."},"writeVersion":{"type":"integer","format":"int64","description":"Position inside `slot`. When set, returns the newest version at or before `(slot, writeVersion)`. `writeVersion` values come from `getAccountChanges` rows."},"anchor":{"$ref":"#/components/schemas/Anchor"},"encoding":{"$ref":"#/components/schemas/Encoding"},"dataSlice":{"$ref":"#/components/schemas/DataSlice"},"commitment":{"type":"string","description":"Accepted for compatibility; ignored. Only rooted data is archived."},"tolerateGaps":{"type":"boolean","default":false,"description":"When `false` (default), queries that resolve to a slot inside a `partial`, `missing` or `unknown` archive gap return `-32018`. Set `true` to bypass and accept at-or-before data."}}}]}}}}}}},"responses":{"200":{"description":"Successful `getHistoricalAccountInfo` response.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/JsonRpcEnvelope"},{"type":"object","required":["result"],"properties":{"result":{"type":"object","required":["context","value"],"properties":{"context":{"$ref":"#/components/schemas/RewindContext"},"value":{"$ref":"#/components/schemas/AccountInfo"}}}}}]}}}},"400":{"description":"Malformed JSON (the one non-envelope failure mode)."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```
