# On-Chain ERC-20 Token Balance Lookup

> On-Chain ERC-20 Token Balance Lookup is a paid API for AI agents from agent-commerce-factory-jm.austriaeast.cloudapp.azure.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Returns the live ERC-20 token balance for a wallet address on a given EVM chain, including raw units, human-readable balance, token name, symbol, and decimals.

## Facts

- Endpoint: POST https://agent-commerce-factory-jm.austriaeast.cloudapp.azure.com/v1/onchain/token-balance
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/on-chain-erc-20-token-balance-lookup-47799253
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JSwMFr-cp6Ma3IF5IwOIe

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability on-chain-erc-20-token-balance-lookup-47799253 -d '<json body>'
```

Example prompt: What's the current USDC balance for wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum? The USDC contract address is 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48.

## When to prefer this

Use this endpoint when you need live, on-chain ERC-20 token balances read directly from the blockchain — not from a centralized index or exchange. Ideal for wallet trackers, DeFi portfolio tools, airdrop verification, and treasury monitoring agents that require exact raw balances and token metadata (name, symbol, decimals) in a single call. Prefer this over exchange-based balance APIs when the wallet is non-custodial or when you need balances for arbitrary ERC-20 tokens by contract address across multiple EVM chains.

## Known failure modes

- Invalid wallet address format (must match 0x + 40 hex chars) returns a validation error
- Invalid or non-ERC-20 contract address may return null balance fields
- Unsupported chain name returns an error or empty response
- Network/RPC timeout causes delayed or failed response
- Token contract with non-standard decimals may produce unexpected balance values

## Output

Returns a JSON object with the wallet address, contract address, chain, and a balance object containing: the raw token balance (in smallest units as a string), the human-readable balance (adjusted for decimals), the token name, symbol, decimals count, and contract address. Also includes economics metadata showing the call price.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "address",
      "contract"
     ],
     "properties": {
      "chain": {
       "type": "string",
       "default": "ethereum",
       "description": "EVM chain (ethereum, base, arbitrum, optimism, polygon, bsc)."
      },
      "address": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "Wallet address."
      },
      "contract": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "ERC-20 token contract address."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "machine",
      "route",
      "balance"
     ],
     "properties": {
      "chain": {
       "type": "string"
      },
      "route": {
       "type": "string"
      },
      "address": {
       "type": "string"
      },
      "balance": {
       "type": "object",
       "properties": {
        "raw": {
         "type": [
          "string",
          "null"
         ]
        },
        "name": {
         "type": [
          "string",
          "null"
         ]
        },
        "chain": {
         "type": [
          "string",
          "null"
         ]
        },
        "symbol": {
         "type": [
          "string",
          "null"
         ]
        },
        "address": {
         "type": [
          "string",
          "null"
         ]
        },
        "balance": {
         "type": [
          "string",
          "null"
         ]
        },
        "contract": {
         "type": [
          "string",
          "null"
         ]
        },
        "decimals": {
         "type": [
          "integer",
          "null"
         ]
        }
       }
      },
      "machine": {
       "type": "string"
      },
      "contract"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/on-chain-erc-20-token-balance-lookup-47799253/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-commerce-factory-jm.austriaeast.cloudapp.azure.com](https://www.zero.xyz/host/agent-commerce-factory-jm.austriaeast.cloudapp.azure.com/llms.txt)
