This method retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a specific ledger version.
bashcurl --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"
}'
javascriptconst 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));
pythonimport requests
url = "https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/"
headers = {
"Content-Type": "application/json"
}
payload = {
"jsonrpc": "2.0",
"method": "account_info",
"params": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"ledger_index": "validated"
}],
"id": "getblock.io"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
rustuse reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let payload = json!({
"jsonrpc": "2.0",
"method": "account_info",
"params": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"ledger_index": "validated"
}],
"id": "getblock.io"
});
let response = client
.post("https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/")
.header("Content-Type", "application/json")
.json(&payload)
.send()
.await?;
let result: serde_json::Value = response.json().await?;
println!("{:#?}", result);
Ok(())
}
json{
"result": {
"account_data": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Balance": "1070051282",
"Flags": 0,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 0,
"PreviousTxnID": "8CA6DE7FCB677A4E59D34B782AF47298E8426E4C1F5774CD0F0185664C68CE52",
"PreviousTxnLgrSeq": 100788827,
"Sequence": 45,
"index": "B1CB040A17F9469BC00376EC8719535655824AD16CB5F539DD5765FEA88FDBE3"
},
"account_flags": {
"allowTrustLineClawback": false,
"defaultRipple": false,
"depositAuth": false,
"disableMasterKey": false,
"disallowIncomingCheck": false,
"disallowIncomingNFTokenOffer": false,
"disallowIncomingPayChan": false,
"disallowIncomingTrustline": false,
"disallowIncomingXRP": false,
"globalFreeze": false,
"noFreeze": false,
"passwordSpent": false,
"requireAuthorization": false,
"requireDestinationTag": false
},
"ledger_hash": "2F1865AEA9A70D048D491819D76CBB3F1B6FA567B03A7411BACFED0043A11342",
"ledger_index": 102053337,
"status": "success",
"validated": true
}
}