account_info - XRPL

Example code for the account_info JSON RPC method. Complete guide to using account_info JSON-RPC in the GetBlock Web3 documentation.

This method retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a specific ledger version.

Parameters

Parameter
Type
Required
Description

account

string

Yes

Account address

ledger_hash

string

No

64-character hex ledger hash

ledger_index

string/number

No

Ledger index or shortcut

queue

boolean

No

Include queued transactions

signer_lists

boolean

No

Include signer lists

Request Example

curl --location --request POST 'https://xrp.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "account_info",
    "params": [{
        "account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
        "ledger_index": "validated"
    }],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Parameter
Type
Description

Account

string

Account address

Balance

string

XRP balance in drops

Flags

number

Account flags

OwnerCount

number

Objects owned

Sequence

number

Next transaction sequence

account_data

object

Account information object

ledger_current_index

integer

Current ledger index

validated

boolean

Whether ledger is validated

Use Cases

  • Check XRP balance

  • Verify account exists

  • Get account sequence for transactions

  • Monitor account settings

Error Handling

Error Code
Description

actNotFound

Account not found

invalidParams

Invalid parameters

SDK Integration

Last updated

Was this helpful?