40 Compute Units.
Reference: Here
Parameters
ledger_hash(string, optional) A 32-byte hex string for the ledger version to use.ledger_index(number or string, optional) The ledger index of the ledger to use, or a shortcut string such asvalidated,closedorcurrent.transactions(boolean, optional) Iftrue, return information on transactions in the specified ledger version. The default isfalse.expand(boolean, optional) Provide full JSON-formatted transaction information instead of only hashes. The default isfalse. Ignored unless you request transactions.owner_funds(boolean, optional) Iftrue, include anowner_fundsfield in the metadata of OfferCreate transactions. Ignored unless transactions are included andexpandistrue.binary(boolean, optional) Iftrue, andtransactionsandexpandare bothtrue, return transaction information in binary format instead of JSON.queue(boolean, optional) Iftrue, and the command is requesting thecurrentledger, include an array of queued transactions in the results.
Returns
ledger(object) The complete ledger header data, includingaccount_hash,close_flags,close_time,close_time_human,close_time_iso,close_time_resolution,closed,ledger_hash,ledger_index,parent_close_time,parent_hash,total_coins,transaction_hashand, if requested,transactions.ledger_hash(string) The unique identifying hash of the entire ledger, as hexadecimal.ledger_index(number) The ledger index of this ledger.validated(boolean) Iftrue, this is a validated ledger version.queue_data(array) Omitted unless requested with thequeueparameter. Queued transactions, in the same order as the queue.
{"id":1,"command":"ledger","ledger_index":"validated","transactions":false,"expand":false} to wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>.
Requestingtransactions: truewithexpand: truereturns every transaction in the ledger in full, including metadata. This is the heaviest call on this endpoint; a busy mainnet ledger can return several megabytes. Request hashes only (expand: false) and fetch individual transactions withtxwhen you do not need the whole ledger.