> ## Documentation Index
> Fetch the complete documentation index at: https://hedera-0c6e0218-docs-smart-contract-pectra-updates-v2.mintlify.site/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

| 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>.ownedNfts`                     | long                              | Optional    |
| `<AccountInfo>.maxAutomaticTokenAssociations` | int                               | Optional    |
| `<AccountInfo>.accountMemo`                   | String                            | Optional    |
| `<AccountInfo>.expirationTime`                | Instant                           | Optional    |
| `<AccountInfo>.autoRenewPeriod`               | Duration                          | Optional    |
| `<AccountInfo>.ledgerId`                      | LedgerId                          | Optional    |
| `<AccountInfo>.ethereumNonce`                 | long                              | Optional    |
| `<AccountInfo>.stakingInfo`                   | StakingInfo                       | Optional    |
| `<AccountInfo>.tokenRelationships`            | Map\<TokenId, TokenRelationships> | Optional    |
| `<AccountInfo>.delegationAddress`             | EvmAddress                        | Optional    |

<Info>
  **`delegationAddress` ([HIP-1340](https://hips.hedera.com/hip/hip-1340))**

  Returns the 20-byte EVM address (`EvmAddress`) the account is currently delegating execution to under EOA Code Delegation, or `null` if no delegation is configured. In JavaScript, read it as a property: `info.delegationAddress`. When set, EVM calls to the account's address execute the bytecode at this address in the account's storage context. See [EOA Code Delegation](/evm/development/eoa-code-delegation).
</Info>

<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 />
