> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sx.bet/llms.txt
> Use this file to discover all available pages before exploring further.

# Querying Balances

> How to check your USDC balance on SX Bet using the blockchain explorer API.

## Overview

SX Bet provides a blockchain explorer API that lets you query your USDC balance.

## Base URL

```
https://explorerl2.sx.technology/api
```

For testnet:

```
https://explorerl2.toronto.sx.technology/api
```

## Check your USDC balance

Query your ERC-20 token balance using the `tokenbalance` action. You need the token contract address and your wallet address.

<CodeGroup>
  ```python Python theme={null}
  import requests

  EXPLORER_API = "https://explorerl2.sx.technology/api"
  USDC_ADDRESS = "0x6629Ce1Cf35Cc1329ebB4F63202F3f197b3F050B"
  WALLET = "0xYourWalletAddress"

  response = requests.get(EXPLORER_API, params={
      "module": "account",
      "action": "tokenbalance",
      "contractaddress": USDC_ADDRESS,
      "address": WALLET,
  })

  result = response.json()
  raw_balance = int(result["result"])
  usdc_balance = raw_balance / 10**6  # USDC has 6 decimals
  print(f"USDC balance: {usdc_balance:.2f}")
  ```

  ```javascript JavaScript theme={null}
  const EXPLORER_API = "https://explorerl2.sx.technology/api";
  const USDC_ADDRESS = "0x6629Ce1Cf35Cc1329ebB4F63202F3f197b3F050B";
  const WALLET = "0xYourWalletAddress";

  const data = await fetch(
    `${EXPLORER_API}?${new URLSearchParams({
      module: "account",
      action: "tokenbalance",
      contractaddress: USDC_ADDRESS,
      address: WALLET,
    })}`
  ).then((r) => r.json());

  const rawBalance = BigInt(data.result);
  const usdcBalance = Number(rawBalance) / 1e6; // USDC has 6 decimals
  console.log(`USDC balance: ${usdcBalance.toFixed(2)}`);
  ```
</CodeGroup>

Response:

```json theme={null}
{
  "message": "OK",
  "status": "1",
  "result": "135499"
}
```

The `result` is the raw token balance. Divide by `10^decimals` to get the human-readable amount (USDC = 6 decimals). See [Unit Conversion](/api-reference/unit-conversion) for more on token decimals.

## Token addresses

| Token | Mainnet                                      | Testnet                                      |
| ----- | -------------------------------------------- | -------------------------------------------- |
| USDC  | `0x6629Ce1Cf35Cc1329ebB4F63202F3f197b3F050B` | `0x1BC6326EA6aF2aB8E4b6Bc83418044B1923b2956` |

See [References](/api-reference/references) for the full list of addresses and network details.

## Related

<CardGroup cols={2}>
  <Card title="Unit Conversion →" icon="arrows-rotate" href="/api-reference/unit-conversion">
    Converting between raw token values and human-readable amounts.
  </Card>

  <Card title="References →" icon="link" href="/api-reference/references">
    Contract addresses, RPC URLs, and chain IDs.
  </Card>

  <Card title="Approve Token Spending →" icon="toggle-on" href="/api-reference/post-approve">
    Approve the TokenTransferProxy before placing bets.
  </Card>

  <Card title="Filling Orders →" icon="hand-pointer" href="/developers/filling-orders">
    Use your balance to fill orders as a taker.
  </Card>
</CardGroup>
