Skip to main content

getLedgers RPC Method

Returns a list of ledgers with pagination support.

Updated on
Aug 14, 2025

getLedgers RPC Method

Parameters

startLedger
string
The ledger sequence number to start fetching from
pagination
object
The pagination object which contains the following fields:
cursor
string
When provided it excludes the element with an ID matching the cursor and only includes elements appearing after it in the response
limit
integer
The maximum number of records returned. By default, it is set to 100
xdrFormat
string
Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')

Returns

result
object
The result object containing ledger details and pagination metadata. Returns null if no ledgers are found
ledgers
array
An array of ledger objects
hash
string
The hash of the ledger header which was included in the chain
sequence
integer
The sequence number of the ledger (also referred to as the block height)
ledgerCloseTime
string
The timestamp at which the ledger was closed
headerXdr
string
The LedgerHeader structure for this ledger (base64-encoded string)
metadataXdr
string
The LedgerCloseMeta union for this ledger (base64-encoded string)
latestLedger
integer
The sequence number of the latest ledger known to Stellar RPC at the time it handled the request
latestLedgerCloseTime
integer
The Unix timestamp of the close time of the latest ledger known to Stellar RPC at the time it handled the request
oldestLedger
integer
The sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request
oldestLedgerCloseTime
integer
The Unix timestamp of the close time of the oldest ledger ingested by Stellar RPC at the time it handled the request
cursor
string
A token that can be included in a subsequent request to obtain the next page of results
Request
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free