ledger_index
Looks up the last closed ledger at a given real-world time. Useful for correlating events that happened off-chain with historical data in the XRP Ledger.
This method will use 20 Compute Units.
Reference: Here
Parameters
date(string, optional) An ISO 8601 timestamp of the time to look up, without microseconds and usingZas the time zone marker, for example2025-01-01T00:00:00Z. If omitted, use the current time.
Returns
ledger_index(number) The ledger index of the most recently closed ledger at the specified time.ledger_hash(string) The identifying hash of that ledger.closed(string) The official close time of that ledger.validated(boolean) Iftrue, the ledger has been validated by the consensus process and is immutable.
// Result
{
"result": {
"ledger_index": 93153309,
"ledger_hash": "7BAACC9E41B907204EC0A9296ED2F6F4B78FCC6C9D81BE3CCBB0EBC5951E97DF",
"closed": "2025-01-01T00:00:00Z",
"validated": true,
"status": "success"
}
}Over WebSocket, send {"id":1,"command":"ledger_index","date":"2025-01-01T00:00:00Z"} to wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>.
This method is served by Clio, our full-history XRPL server, and is not available from rippled.
Last updated
Was this helpful?