Hedera
Search…
Get account info
A query that returns the current state of the account. This query does not include the list of records associated with the account. Anyone on the network can request an account info for a given account. Queries do not change the state of the account or require network consensus. The information is returned from a single node processing the query.
Query Fees
  • Please see the transaction and query fees table for base transaction fee
  • Please use the Hedera fee estimator to estimate your query fee cost
Account Info Response:
Field
Description
Account ID
The account ID of the account the information was requested for.
Contract Account ID
The Contract Account ID comprising of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity.
Key(s)
The keys that are currently on the account.
Balance
The current balance of hbars on the account.
Expiration Time
The account's expiration time.
Auto Renew Period
The duration at which the account is charged to renew.
Deleted
Whether or not the account is marked as deleted.
Receiver Signature
Whether or not the signature of this account is required for other accounts to transfer to it
Proxy Account
The Account ID of the account to which this is proxy staked. If proxyAccountID is null, or is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking, or if it is not currently running a node, then it will behave as if proxyAccountID was null.
Proxy Received
The total number of tinybars proxy staked to this account.
LiveHash
All of the livehashes attached to the account (each of which is a hash along with the keys that authorized it and can delete it).
Tokens
All tokens related to this account
Memo
A note or description that is recorded with the account entity
Owned NFTs
The number of NFTs owned by the specified account
Max Automatic Token Associations
The total number of auto token associations that are specified for this account.
Ethereum Nonce
The Ethereum transaction nonce associated with this account.
Ledger ID
The ID of the network the response came from. See HIP-198.
Query Signing Requirements
  • The client operator private key is required to sign the query request
Constructor
Description
new AccountInfoQuery()
Initializes the AccountInfoQuery object
1
new AccountInfoQuery()
Copied!

Methods

V2
V1
Method
Type
Requirement
setAccountId(<accountId>)
AccountId
Required
<AccountInfo>.accountId
AccountId
Optional
<AccountInfo>.contractAccountId
String
Optional
<AccountInfo>.isDeleted
boolean
Optional
<AccountInfo>.key
Key
Optional
<AccountInfo>.balance
Hbar
Optional
<AccountInfo>.isReceiverSignatureRequired
boolean
Optional
<AccountInfo>.liveHashes
List<LiveHash>
Optional
<AccountInfo>.tokenRelationships
Map<TokenId, TokenRelationships>
Optional
<AccountInfo>.ownedNfts
long
Optional
<AccountInfo>.maxAutomaticTokenAssociations
int
Optional
<AccountInfo>.accountMemo
String
Optional
<AccountInfo>.expirationTime
Instant
Optional
<AccountInfo>.proxyReceived
Hbar
Optional
<AccountInfo>.proxyAccountId
AccountId
Optional
<AccountInfo>.autoRenewPeriod
Duration
Optional
<AccountInfo>.ledgerId
LedgerId
Optional
<AccountInfo>.ethereumNonce
long
Optional
Java
1
//Create the account info query
2
AccountInfoQuery query = new AccountInfoQuery()
3
.setAccountId(newAccountId);
4
​
5
//Submit the query to a Hedera network
6
AccountInfo accountInfo = query.execute(client);
7
8
//Print the account key to the console
9
System.out.println(accountInfo);
10
​
11
//v2.0.0
Copied!
JavaScript
1
//Create the account info query
2
const query = new AccountInfoQuery()
3
.setAccountId(newAccountId);
4
​
5
//Sign with client operator private key and submit the query to a Hedera network
6
const accountInfo = await query.execute(client);
7
​
8
//Print the account info to the console
9
console.log(accountInfo);
10
​
11
//v2.0.0
Copied!
Go
1
//Create the account info query
2
query := hedera.NewAccountInfoQuery().
3
SetAccountID(newAccountId)
4
​
5
//Sign with client operator private key and submit the query to a Hedera network
6
accountInfo, err := query.Execute(client)
7
if err != nil {
8
panic(err)
9
}
10
​
11
//Print the account info to the console
12
fmt.Println(accountInfo)
13
​
14
//v2.0.0
Copied!

Sample Output:

1
{
2
accountId=0.0.96928,
3
contractAccountId=0000000000000000000000000000000000017aa0,
4
"deleted=false",
5
"proxyAccountId=null",
6
proxyReceived=0 tℏ,
7
key=302a300506032b65700321001a5a62bb9f35990d3fea1a5bb7ef6f1df0a297697adef1e04510c9d4ecc5db3f,
8
balance=1 ℏ,
9
sendRecordThreshold=92233720368.54775807 ℏ,
10
receiveRecordThreshold=9223372 0368.54775807 ℏ,
11
"receiverSignatureRequired=false",
12
expirationTime=2021-02-02T19:29:36Z,
13
autoRenewPeriod=PT2160H,
14
liveHashes="[],
15
tokenRelationships={
16
0.0.27335=TokenRelationship{
17
tokenId=0.0.27335, symbol=F, balance=5, kycStatus=null,
18
freezeStatus=null, automaticAssociation=true
19
}
20
},
21
accountMemo=,
22
ownedNfts=0,
23
maxAutomaticTokenAssociations=10
24
ledgerId=previewnet,
25
hbarAllowances=[
26
HbarAllowance{
27
ownerAccountId=null,
28
spenderAccountId=0.0.6019,
29
amount=50 ℏ
30
},
31
HbarAllowance{
32
ownerAccountId=null,
33
spenderAccountId=0.0.6020,
34
amount=50 ℏ
35
}
36
],
37
tokenAllowances=[],
38
tokenNftAllowances=[]
39
}
Copied!
​
Method
Type
Requirement
setAccountId(<accountId>)
AccountId
Required
<AccountInfo>.accountId
AccountId
Optional
<AccountInfo>.contractAccountId
String
Optional
<AccountInfo>.isDeleted
boolean
Optional
<AccountInfo>.key
Key
Optional
<AccountInfo>.balance
long
Optional
<AccountInfo>.isReceiverSignatureRequired
boolean
Optional
<AccountInfo>.liveHashes
List<LiveHash>
Optional
<AccountInfo>.tokenRelationships
Map<TokenId, TokenRelationships>
Optional
<AccountInfo>.ownedNfts
long
Optional
<AccountInfo>.expirationTime
Instant
Optional
<AccountInfo>.proxyReceived
long
Optional
<AccountInfo>.proxyAccountId
AccountId
Optional
<AccountInfo>.autoRenewPeriod
Duration
Optional
Java
1
//Create the account info query
2
AccountInfoQuery query = new AccountInfoQuery()
3
.setAccountId(newAccountId);
4
​
5
//Submit the query to a Hedera network
6
AccountInfo accountInfo = query.execute(client);
7
8
//Print the account key to the console
9
System.out.println(accountInfo);
10
​
11
//v1.3.2
Copied!
JavaScript
1
//Create the account info query
2
const query = new AccountInfoQuery()
3
.setAccountId(newAccountId);
4
​
5
//Sign with client operator private key and submit the query to a Hedera network
6
const accountInfo = await query.execute(client);
7
​
8
//Print the account info to the console
9
console.log(accountInfo);
10
​
11
//v1.4.4
Copied!

Sample Output:

{ accountId=0.0.96928, contractAccountId=0000000000000000000000000000000000017aa0, "deleted=false", "proxyAccountId=null", proxyReceived=0 tℏ, key=302a300506032b65700321001a5a62bb9f35990d3fea1a5bb7ef6f1df0a297697ad ef1e04510c9d4ecc5db3f, balance=1 ℏ, sendRecordThreshold=92233720368.54775807 ℏ, receiveRecordThreshold=9223372 0368.54775807 ℏ, "receiverSignatureRequired=false", expirationTime=2021-02-02T19:29:36Z, autoRenewPeriod=PT2160H, "liveHashes="[] }
Copy link
Contents
Methods