| hide_title | true |
|---|---|
| description | Returns list of ledgers |
import { RpcMethod } from "@site/src/components/RpcMethod"; import rpcSpec from "@site/static/stellar-rpc.openrpc.json";
<RpcMethod method={rpcSpec.methods.filter((meth) => meth.name === "getLedgers")[0]} />
You can retrieve a list of past ledgers using the getLedgers method in the Stellar Laboratory. This endpoint returns detailed ledger data starting from a specified point, with support for pagination—as long as the requested range falls within the history retention of the RPC provider.
The method also supports an optional XDR format parameter, which allows developers to choose between unpacked JSON or base64-encoded XDR strings for the response format.
