# 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 %}
