On-chain ERC-20 token balance for a wallet
On-chain ERC-20 token balance for a wallet. Given a chain, a wallet address and a token contract address returns the token balance (exact raw units + decimal), with token name, symbol and decimals, read live from the chain. For wallet trackers, DeFi portfolio valuation, airdrop checks and treasury-monitoring agents.
2000 (raw units)
price
1
calls / 30d
1
unique payers
2026-08-25
updated
Provider
agent-commerce-factory-jm.austriaeast.cloudapp.azure.com · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0xCe339395d7f2ea5a5009022EF1C392Fb208a989E",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "2000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"info": {
"input": {
"body": {
"address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"chain": "ethereum",
"contract": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
"bodyType": "json",
"method": "POST",
"type": "http"
},
"output": {
"example": {
"address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"balance": {
"address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"balance": "1234.56",
"chain": "ethereum",
"contract": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"decimals": 6,
"name": "Tether USD",
"raw": "1234560000",
"symbol": "USDT"
},
"chain": "ethereum",
"contract": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"machine": "portfolio",
"route": "onchain.token-balance"
},
"type": "json"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"properties": {
"address": {
"description": "Wallet address.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
},
"chain": {
"default": "ethereum",
"description": "EVM chain (ethereum, base, arbitrum, optimism, polygon, bsc).",
"type": "string"
},
"contract": {
"description": "ERC-20 token contract address.",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
}
},
"required": [
"address",
"contract"
],
"type": "object"
},
"bodyType": {
"enum": [
"json",
"form-data",
"text"
],
"type": "string"
},
"method": {
"enum": [
"POST"
],
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method",
"bodyType",
"body"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"properties": {
"address": {
"type": "string"
},
"balance": {
"properties": {
"address": {
"type": [
"string",
"null"
]
},
"balance": {
"type": [
"string",
"null"
]
},
"chain": {
"type": [
"string",
"null"
]
},
"contract": {
"type": [
"string",
"null"
]
},
"decimals": {
"type": [
"integer",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"raw": {
"type": [
"string",
"null"
]
},
"symbol": {
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"chain": {
"type": "string"
},
"contract": {
"type": "string"
},
"economics": {
"properties": {
"sellPriceUsd": {
"type": "number"
},
"upstreamCostUsdActual": {
"type": [
"number",
"null"
]
}
},
"type": "object"
},
"machine": {
"type": "string"
},
"route": {
"type": "string"
}
},
"required": [
"machine",
"route",
"balance"
],
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
}
}Use it
curl
curl "https://agent-commerce-factory-jm.austriaeast.cloudapp.azure.com/v1/onchain/token-balance" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://agent-commerce-factory-jm.austriaeast.cloudapp.azure.com/v1/onchain/token-balance");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://agent-commerce-factory-jm.austriaeast.cloudapp.azure.com/v1/onchain/token-balance")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/7425.json, and this resource appears in /discovery/resources and /discovery/search.