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
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://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "account_info",
"params": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"ledger_index": "validated"
}],
"id": "getblock.io"
}'const axios = require('axios');
const url = 'https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/';
const headers = {
'Content-Type': 'application/json'
};
const payload = {
jsonrpc: '2.0',
method: 'account_info',
params: [{
account: 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH',
ledger_index: 'validated'
}],
id: 'getblock.io'
};
axios.post(url, payload, { headers })
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
Response Parameters
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
actNotFound
Account not found
invalidParams
Invalid parameters
SDK Integration
Last updated
Was this helpful?