# LedgerDataRequest | xrpl
Documentation for xrpl

# Interface LedgerDataRequest

The `ledger_data` method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version.

### Example

    const ledgerData: LedgerDataRequest = {
      "id": 2,
      "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
      "command": "ledger_data",
      "limit": 5,
      "binary": true
    }

#### Hierarchy

- BaseRequest
  - LedgerDataRequest

- Defined in packages/xrpl/src/models/methods/ledgerData.ts:24

#####
Index

### Properties

api_version?
binary?
command
id?
ledger_hash?
ledger_index?
limit?
marker?

## Properties

### `Optional` api_version

api_version?: number

The API version to use. If omitted, use version 1.

Inherited from BaseRequest.api_version

- Defined in packages/xrpl/src/models/methods/baseMethod.ts:14

### `Optional` binary

binary?: boolean

If set to true, return ledger objects as hashed hex strings instead of JSON.

- Defined in packages/xrpl/src/models/methods/ledgerData.ts:37

### command

command: "ledger_data"

Overrides BaseRequest.command

- Defined in packages/xrpl/src/models/methods/ledgerData.ts:25

### `Optional` id

id?: string | number

A unique value to identify this request. The response to this request uses the same id field. This way, even if responses arrive out of order, you know which request prompted which response.

Inherited from BaseRequest.id

- Defined in packages/xrpl/src/models/methods/baseMethod.ts:10

### `Optional` ledger_hash

ledger_hash?: string

A 20-byte hex string for the ledger version to use.

- Defined in packages/xrpl/src/models/methods/ledgerData.ts:27

### `Optional` ledger_index

ledger_index?: LedgerIndex

The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically.

- Defined in packages/xrpl/src/models/methods/ledgerData.ts:32

### `Optional` limit

limit?: number

Limit the number of ledger objects to retrieve. The server is not required to honor this value.

- Defined in packages/xrpl/src/models/methods/ledgerData.ts:42

### `Optional` marker

marker?: unknown

Value from a previous paginated response. Resume retrieving data where that response left off.

- Defined in packages/xrpl/src/models/methods/ledgerData.ts:47

Generated using TypeDoc