/accounts/{accountId}/asset-balances - Polkadot

This endpoint returns an account's balances for Asset Hub assets. Specific asset IDs can be requested with the assets query parameter.

This endpoint is specific to Asset Hub (assets, foreign assets, and NFTs) and is served on the default network.

Endpoint

GET /accounts/{accountId}/asset-balances

Path Parameters

ParameterTypeDescription
accountIdstringSS58 account address

Query Parameters

ParameterTypeRequiredDescription
assets[]arrayNoAsset IDs to query. Returns all held assets when omitted
atstringNoBlock height or hash to query at

Request

bashcurl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/asset-balances?assets[]=1984'

example.js

javascriptconst response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/asset-balances?assets[]=1984');
const data = await response.json();
console.log(data);

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/asset-balances?assets[]=1984')
print(response.json())

Response

json{
  "at": {
    "hash": "0x255bc00927df8d33d561792635cbc6bde480a0a505eef5ff28630ece3fc15b32",
    "height": "6754362"
  },
  "assets": [
    {
      "assetId": "1984",
      "balance": "25000000",
      "isFrozen": false,
      "isSufficient": true
    }
  ]
}

Response Fields

FieldTypeDescription
assetsarrayPer-asset balance entries
assets[].assetIdstringThe asset's ID on Asset Hub
assets[].balancestringThe account's balance of the asset
assets[].isFrozenbooleanWhether the balance is frozen
assets[].isSufficientbooleanWhether the asset is sufficient for existence

Use Cases

  • Token Wallets: Show an account's Asset Hub token balances
  • Stablecoin UX: Read USDT (asset 1984) or USDC balances
  • Portfolio Tools: Aggregate asset holdings
  • Payments: Confirm an asset balance before a transfer