$ man erc20-balance
/erc20-balance(1)
PRICE / CALL
$0.002
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarketCATEGORY
uncategorized
STATUS
● live
NAME
erc20-balance — erc-20 balance reader / balanceof / on-chain token balance / wallet balance lookup / multi-chain erc20 balance / read base / read ethereu…
SYNOPSIS
POST https://x402.org/v1/erc20-balance
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
ERC-20 balance reader / balanceOf / on-chain token balance / wallet balance lookup / multi-chain ERC20 balance / read Base / read Ethereum / read Arbitrum / read Optimism / read Polygon. Reads balanceOf(wallet) on a token contract across any supported EVM chain via public RPC (no API key needed). Co-fetches decimals to return both raw bigint and decimal-formatted balance. Supports historical block parameter. Useful for agent wallet introspection, payment reconciliation, treasury monitoring.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| token | string | ERC-20 contract address (0x...). | required |
| wallet | string | Wallet address to query (0x...). | required |
| chain | any | Chain id or slug. 8453|'base' (default), 1|'ethereum', 42161|'arbitrum', 10|'optimism', 137|'polygon', 56|'bsc', 43114|'avalanche'. | optional |
| block | any | 'latest' default, or hex/decimal block number for historical reads. | optional |
OUTPUT — response shape
| field | type | description |
|---|---|---|
| chain | string | Echoed EVM chain name the balance was read from (e.g. base, ethereum, arbitrum, optimism, polygon). |
| chain_id | string | Numeric EVM chain ID as a string, matching the resolved chain (e.g. 8453 for Base, 1 for Ethereum). |
| token | string | ERC-20 contract address whose balanceOf was called, echoed back in lowercase hex. |
| wallet | string | Wallet address whose token balance was queried, echoed back in lowercase hex. |
| block | string | Block tag or number at which balanceOf was evaluated (latest, or a specific block height as string). |
| balance_raw | string | Raw balanceOf return value as a base-10 bigint string, before decimals scaling. |
| balance_hex | string | Raw balanceOf return value as a 0x-prefixed hex string straight from the eth_call response. |
| decimals | string | Token decimals fetched from the contract's decimals() call, used to format the human-readable balance. |
| balance | string | Decimal-formatted token balance as a string, scaled by decimals (e.g. 1234.5678 instead of raw units). |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.org/v1/erc20-balance \
-H 'Content-Type: application/json' \
-d '{ }'first response =
402 Payment Required with payment requirements; sign + retry with X-PAYMENT.EXAMPLE 2 · mcp
# install once claude mcp add x402 --command "npx x402-deployer-mcp" # then ask Claude Code: # "use the erc20-balance tool to ..."
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
- tags
- erc20balance-oftoken-balancewallet-balanceonchain-readevm-rpcmulti-chainerc20-balance
- methods
- POST
- cluster
- edgemarket
- price
- $0.002 USDC per call
ADJACENT — other endpoints in edgemarket
| endpoint | description | price |
|---|---|---|
| erc20-metadata | ERC-20 metadata reader / token info / token symbol lookup / token decimals / total supply / multi-chain ERC20 reader / Base / Ethereum /… | $0.002 |
| funding-rates | Perp funding rates / Binance USD-M futures funding / next-funding-time / 24h history / perp basis. | $0.002 |
| safe-tx-decode | Gnosis Safe execTransaction decoder. | $0.003 |
| agent-card-resolve | Agent card resolver / ERC-8004 Identity Registry lookup / Trustless Agents / agentId → owner + agentURI / A2A identity / agent.json fetch… | $0.005 |
| arbitrage-spread | Cross-exchange arbitrage spread / max-min price / CEX price dispersion / spread % calculator. | $0.005 |
| basename-resolve | Basename resolver / Coinbase Basenames / .base.eth lookup / Base name service / on-chain name resolution. | $0.005 |
| defi-yield-pools | DeFi yield pools / APY aggregator / yield-farming opportunities / DeFiLlama yields / cross-protocol APY ranking / stablecoin yields / LP… | $0.005 |
| ipfs-fetch | IPFS fetch / IPFS gateway / Web3 storage retrieval / NFT metadata fetcher / Filecoin gateway / decentralized content / pinned-content reader. | $0.005 |
SEE ALSO