# Get Token Balance

## Get Token Balance API

This endpoint returns the balance of a specific token for the provided address.

{% tabs %}
{% tab title="Typescript (SDK)" %}

```typescript
const balance = await rango.tokenBalance({
    walletAddress: "0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88",
    blockchain: "BSC", 
    symbol: "BNB",
    address: null,
})
```

{% endtab %}

{% tab title="Node.js (Axios)" %}

```typescript
const response = await axios.get('https://api.rango.exchange/basic/token-balance', {
  params: {
    'walletAddress': '0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88',
    'blockchain': 'BSC',
    'symbol': 'BNB',
    'address': null,
    'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
  }
});
```

{% endtab %}

{% tab title="Bash (cURL)" %}
{% code overflow="wrap" %}

```bash
curl --request GET \
     --url 'https://api.rango.exchange/basic/token-balance?walletAddress=0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88&blockchain=BSC&symbol=BNB&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'
```

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

{% embed url="<https://rango-api.readme.io/reference/gettokenbalance-1>" %}
Token Balance Swagger
{% endembed %}

### Token Balance Request&#x20;

{% tabs %}
{% tab title="API Definition" %}

* **`blockchain`**<mark style="color:red;">\*</mark> String
  * Description: The blockchain which this token belongs to.
  * Example: `BSC`
* **`symbol`**<mark style="color:red;">\*</mark> String&#x20;
  * Description: The token symbol.
  * Example: `BNB`
* **`address`** String&#x20;
  * Description: Smart contract address of token, null for native tokens.
  * Example: `null`
* **`walletAddress`**<mark style="color:red;">\*</mark> String&#x20;
  * Description: User wallet address for the desired blockchain.
    {% endtab %}

{% tab title="SDK Models (Typescript)" %}

```typescript
export type TokenBalanceRequest = {
  blockchain: string
  symbol: string
  address: string | null
  walletAddress: string
}
```

{% endtab %}
{% endtabs %}

### Token Balance Response&#x20;

{% tabs %}
{% tab title="API Definition" %}

* **`balance`**
  * Description: balance amount
  * Example: `46077752529840023`
* **`error`**
  * Description: Error message if there was any problem
* **`errorCode`**
  * Description: Error code if there was any problem
* **`traceId`**
  * Description: Trace id help Rango support to resolve the issue
    {% endtab %}

{% tab title="SDK Models (Typescript)" %}

```typescript
export type TokenBalanceResponse = {
  balance: string | null
  error: string | null
  errorCode: number | null
  traceId: number | null
}
```

{% endtab %}

{% tab title="Sample Response" %}

```typescript
{
  "balance": "46077752529840023",
  "error": null,
  "errorCode": null,
  "traceId": null
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.rango.exchange/api-integration/basic-api-single-step/api-reference/get-token-balance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
