Skip to content
Alchemy Logo

getLedgers

POST
/{apiKey}

The getLedgers method returns a detailed list of ledgers starting from the user specified starting point that you can paginate as long as the pages fall within the history retention of their corresponding RPC provider.

Path Parameters

stringrequireddefaults to docs-demo

For higher throughput, create your own API key

Request

numberoptional

Ledger sequence number to start fetching responses from (inclusive). This method will return an error if startLedger is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. If a cursor is included in the request, startLedger must be omitted.

objectoptional

Pagination in stellar-rpc is similar to pagination in Horizon. See Pagination.

stringoptional

Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.

Responses

200

Was this page helpful?