> For the complete documentation index, see [llms.txt](https://docs.akashicpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akashicpay.com/sdk/functions/getbalance.md).

# getBalance

## <mark style="color:blue;">Example</mark>

{% tabs %}
{% tab title="TypeScript" %}

```javascript
const balances = await akashicPay.getBalance();
```

{% endtab %}

{% tab title="PHP" %}

```php
$balances = akashicPay->getBalance();
```

{% endtab %}

{% tab title="Java" %}

```java
APBalanceResult balances = akashicPay.getBalance(l2Address);
```

{% endtab %}

{% tab title="C#" %}

```csharp
var balance = await akashicPay.GetBalanceAsync();
```

{% endtab %}

{% tab title="Go" %}

```go
bal, err := ap.GetBalance()
```

{% endtab %}
{% endtabs %}

## <mark style="color:blue;">Return Example</mark>

Returns an array of objects, one for each native currency *and* one for each token with a non-zero balance. In the example below the caller has no USDT balance of ETH, hence there is no object for that instance.

Note: An object is always returned for [native currencies](/introduction/terminology.md#coins). [Tokens](/introduction/terminology.md#tokens) are only shown if you posses a non-zero amount.

{% tabs %}
{% tab title="TypeScript" %}

```javascript
[
  {
    "coinSymbol": NetworkSymbol.Ethereum_Sepolia,
    "balance": "5.000000000000000000"
  },
  {
    "coinSymbol": NetworkSymbol.Tron_Shasta,
    "balance": "34.000000"
  },
  {
    "coinSymbol": NetworkSymbol.Tron_Shasta,
    "tokenSymbol": TokenSymbol.USDT,
    "balance": "100.500000"
  },
]
```

{% endtab %}

{% tab title="PHP" %}

```php
[
  {
    "coinSymbol": NetworkSymbol::ETHEREUM_SEPOLIA,
    "balance": "5.000000000000000000"
  },
  {
    "coinSymbol": NetworkSymbol::TRON_SHASTA,
    "balance": "34.000000"
  },
  {
    "coinSymbol": NetworkSymbol::TRON_SHASTA,
    "tokenSymbol": TokenSymbol::USDT,
    "balance": "100.500000"
  },
]
```

{% endtab %}

{% tab title="Java" %}

```java
[
  {
    "coinSymbol": APNetworkSymbol.SEP,
    "balance": "5.000000000000000000"
  },
  {
    "coinSymbol": APNetworkSymbol.TRX_SHASTA,
    "balance": "34.000000"
  },
  {
    "coinSymbol": APNetworkSymbol.TRX_SHASTA,
    "tokenSymbol": APTokenSymbol.USDT,
    "balance": "100.500000"
  },
]
```

{% endtab %}

{% tab title="C#" %}

```csharp

  "Balances": [
    {
      "NetworkSymbol": EthSepNetworkSymbol,
      "TokenSymbol": ApTokenSymbol.Native,
      "Balance": "0.00123123"
    },
    {
      "NetworkSymbol": EthSepNetworkSymbol,
      "TokenSymbol": ApTokenSymbol.Usdt,
      "Balance": "150.52"
    },
    {
      "NetworkSymbol": TronShastaNetworkSymbol,
      "TokenSymbol": ApTokenSymbol.Native,
      "Balance": "1200.4"
    },
    {
      "NetworkSymbol": TronShastaNetworkSymbol,
      "TokenSymbol": ApTokenSymbol.Usdt,
      "Balance": "353.56"
    }
  ]
}
```

{% endtab %}

{% tab title="Go" %}
{% code overflow="wrap" %}

```go
[
  {
    NetworkSymbol: akashicpay.Ethereum_Sepolia,
    Balance: "5.000000000000000000"
  },
  {
    NetworkSymbol: akashicpay.Tron_Shasta,
    Balance: "34.000000"
  },
  {
    NetworkSymbol: akashicpay.Tron_Shasta,
    TokenSymbol: akashicpay.USDT,
    Balance: "100.500000"
  },
]
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.akashicpay.com/sdk/functions/getbalance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
