> For the complete documentation index, see [llms.txt](https://docs.rango.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rango.exchange/api-integration/basic-api-single-step/api-reference/get-address-assets-and-balances.md).

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