> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hedera.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 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.

In Services release 0.50, returning token balance information from the consensus node was deprecated with HIP-367. This query now returns token information by requesting the information from the Hedera Mirror Node APIs via [/api/v1/accounts/\{id}/tokens](https://mainnet.mirrornode.hedera.com/api/v1/docs/#/accounts/listTokenRelationshipByAccountId). Token symbol is not returned in the response.

**Account Properties**

<Card title="Account Properties" href="/learn/core-concepts/accounts/account-properties" />

<Note>
  #### **Recommend Using Mirror Node REST API**

  For obtaining account information and historical data, consider using the Mirror Node REST API endpoint [**Get Account by Alias, ID, or EVM Address**](https://docs.hedera.com/api-reference/accounts/get-account-by-alias-id-or-evm-address) which offers several advantages:

  * **Cost-effective and scalable:** [Mirror node providers](/operators/mirror-node#mainnet) offer paid plans with a large number of queries included. The Hedera-hosted mirror node offers free queries with specific throttles for testing. While some SDK queries are currently free, these are subject to change in the future.
  * **Performance:** Mirror nodes don't burden consensus nodes, allowing them to focus on processing transactions and providing efficient access to historical data without impacting network performance.
  * **Historical data:** Mirror nodes store complete transaction history and balance snapshots - ideal for analytics, auditing, and monitoring past activity.

  📚 ***For more details, please read our [blog post on querying data](https://hedera.com/blog/querying-data-on-hedera-sdk-vs-mirror-node-rest-api).***
</Note>

**Query Fees**

* Please see the transaction and query [fees](/learn/networks/mainnet/fees#transaction-and-query-fees) table for the base transaction fee
* Please use the [Hedera fee estimator](https://hedera.com/fees) to estimate your query fee cost

**Query Signing Requirements**

* The client operator private key is required to sign the query request.

### Methods

<table><thead><tr><th>Method</th><th>Type</th><th>Requirement</th></tr></thead><tbody><tr><td><code>setAccountId(\<accountId>)</code></td><td>AccountId</td><td>Required</td></tr><tr><td><code>\<AccountInfo>.accountId</code></td><td>AccountId</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.contractAccountId</code></td><td>String</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.isDeleted</code></td><td>boolean</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.key</code></td><td>Key</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.balance</code></td><td>HBAR</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.isReceiverSignatureRequired</code></td><td>boolean</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.ownedNfts</code></td><td>long</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.maxAutomaticTokenAssociations</code></td><td>int</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.accountMemo</code></td><td>String</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.expirationTime</code></td><td>Instant</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.autoRenewPeriod</code></td><td>Duration</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.ledgerId</code></td><td>LedgerId</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.ethereumNonce</code></td><td>long</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.stakingInfo</code></td><td>StakingInfo</td><td>Optional</td></tr><tr><td><code>\<AccountInfo>.tokenRelationships</code></td><td>Map\<TokenId, TokenRelationships></td><td>Optional</td></tr><tr><td /><td /><td /></tr></tbody></table>

<CodeGroup>
  ```java Java theme={null}
  //Create the account info query
  AccountInfoQuery query = new AccountInfoQuery()
      .setAccountId(newAccountId);

  //Submit the query to a Hedera network
  AccountInfo accountInfo = query.execute(client);
      
  //Print the account key to the console
  System.out.println(accountInfo);

  //v2.0.0
  ```

  ```javascript JavaScript theme={null}
  //Create the account info query
  const query = new AccountInfoQuery()
      .setAccountId(newAccountId);

  //Sign with client operator private key and submit the query to a Hedera network
  const accountInfo = await query.execute(client);

  //Print the account info to the console
  console.log(accountInfo);

  //v2.0.0
  ```

  ```go Go theme={null}
  //Create the account info query
  query := hedera.NewAccountInfoQuery().
       SetAccountID(newAccountId)

  //Sign with client operator private key and submit the query to a Hedera network
  accountInfo, err := query.Execute(client)
  if err != nil {
      panic(err)
  }

  //Print the account info to the console
  fmt.Println(accountInfo)

  //v2.0.0
  ```

  ```rust Rust theme={null}
  // Create the account info query
  let query = AccountInfoQuery::new()
      .account_id(new_account_id);

  // Submit the query to a Hedera network
  let account_info = query.execute(&client).await?;

  // Print the account info to the console
  println!("{:?}", account_info);

  // v0.34.0
  ```
</CodeGroup>

<CodeGroup />
