Get Ledger By Hash Or Index
POST
Returns information about a Ledger queried by Ledger hash or index.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.networkstringrequired
Parameter specifying the network of the target chain.Request Body
ledgerstringrequired
Parameter specifying the ledger to query. You can enter one of the following formats:- ledger index: Ledger number as a decimal string
- ledger hash: 64-character hexadecimal string (excluding 0x prefix)
- ledger tag: "earliest" or "latest" (oldest or most recent ledger)
Responses
ledgerHashstringrequired
Unique identifier of the current ledger, a 256-bit (64-digit hexadecimal) cryptographic hash. Used for ledger data integrity verification and identification.ledgerIndexintegerrequired
Integer value indicating the creation order of the ledger, used to identify its position (sequence number) on the network.ledgerTimestampintegerrequired
The ledger's close time converted to a Unix timestamp. The close time recorded in the ledger header is expressed in seconds since the Ripple Epoch (January 1, 2000 00:00 UTC), which differs from the Unix Epoch (January 1, 1970 00:00 UTC) by 946,684,800 seconds. Thus ledgerTimestamp is the recorded close time plus 946,684,800 seconds.parentLedgerHashstringrequired
256-bit (64-digit hexadecimal) hash identifying the ledger immediately preceding the current ledger. References the previous ledger's hash to maintain chain integrity.accountHashstringrequired
256-bit (64-digit hexadecimal) hash summarizing all account state information recorded in the ledger. Used to verify consistency and integrity of account data.totalCoinsstringrequired
Total quantity of XRP (in XRP units) owned by accounts recorded in the ledger. This value excludes XRP burned as transaction fees. The actual circulating XRP may be lower than this value because some accounts may be in a "black hole" state (accounts with no key).transactionHashstringrequired
256-bit (64-digit hexadecimal) Merkle tree root hash summarizing all transaction data included in the ledger. Used for transaction history integrity verification.transactionCountintegerrequired
Integer value indicating the total number of transactions included in the ledger. Used to assess the scale and activity of ledger transaction history.transactionsarrayrequired
Array of transaction hashes included in the ledger. Each hash is a 256-bit (64-digit hexadecimal) cryptographic hash uniquely identifying a transaction, used for transaction data integrity and identification.codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "MISSING_REQUIRED_PARAMETER","message": "Missing required parameter: { PARAMETER_NAME }"}
cURL
curl -X POST 'https://web3.nodit.io/v1/xrpl/mainnet/blockchain/getLedgerByHashOrIndex' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{}'