# Get Address Assets & Balances

## Get Balance API

You can use this API to retrieve a list of all tokens and their respective balances associated with a user's wallet address on the desired blockchain

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

```typescript
const walletDetails = await rango.balance({
    blockchain: "BSC", 
    address: "0xeb2629a2734e272bcc07bda959863f316f4bd4cf"
})
```

{% endtab %}

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

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

{% endtab %}

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

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

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

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

{% hint style="info" %}
Note that this endpoint is slow since it queries for all tokens an address is holding and balance of each one. We recommend to use [single token balance](/api-integration/basic-api-single-step/api-reference/get-token-balance.md) endpoint whenever possible.
{% endhint %}

### Balance Request&#x20;

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

* **`blockchain`**<mark style="color:red;">\*</mark> String
  * Description: The desired blockchain.
* **`address`**<mark style="color:red;">\*</mark> String&#x20;
  * Description: User wallet address for the desired blockchain.
    {% endtab %}

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

```typescript
export type WalletAddress = {
    blockchain: string
    address: string
};
```

{% endtab %}
{% endtabs %}

### Balance Response&#x20;

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

* **`wallets`**
  * Description: List of wallet assets
    {% endtab %}

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

```typescript
export type WalletDetailsResponse = {
  wallets: WalletDetail[]
}

export type WalletDetail = {
  failed: boolean
  blockChain: string
  address: string
  balances: AssetAndAmount[] | null
  explorerUrl: string
}

export type AssetAndAmount = {
  amount: Amount
  asset: Asset
}

export type Amount = {
  amount: string
  decimals: number
}

export type Asset = {
  blockchain: string
  address: string | null
  symbol: string
}
```

{% endtab %}

{% tab title="Sample Response" %}

```typescript
{
  "wallets": [
    {
      "blockChain": "BSC",
      "address": "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
      "failed": false,
      "explorerUrl": "https://bscscan.com/address/0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
      "balances": [
        {
          "asset": {
            "blockchain": "BSC",
            "symbol": "BNB",
            "address": null
          },
          "amount": {
            "amount": "911814661733430075",
            "decimals": 18
          }
        }
      ]
    }
  ]
}
```

{% 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-address-assets-and-balances.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.
