{"uid":"cap_WpqflBFV4191_XVQ2WNw3","slug":"erc-20-token-balance-lookup-on-base-x402-0a3d8940","name":"ERC-20 Token Balance Lookup on Base (x402)","description":"Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.","url":"https://kr-x402-mvp.kgy5612.workers.dev/api/erc20-balance?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["token","wallet"],"properties":{"token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","examples":["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"],"description":"Base ERC-20 contract"},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","examples":["0xe4be4d0bd82d8e68203deff81f79ede0529f2617"],"description":"Wallet"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"block":53204016,"chain":"base","token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","symbol":"USDC","wallet":"0xe4be4d0bd82d8e68203deff81f79ede0529f2617","balance":0.061,"decimals":6,"balance_raw":"61000"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_0l_d5fBVADjKakYFzqL8J","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the ERC-20 token balance of a wallet address on the Base chain, including symbol, decimals, raw and human-readable balance, and current block number.","exampleAgentPrompt":"What's the current USDC balance of wallet 0xe4be4d0bd82d8e68203deff81f79ede0529f2617 on Base? The USDC contract address is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.","exampleUseCases":[{"title":"Pre-payment balance verification","prompt":"Before I send USDC to 0xabc123...def456, check whether that wallet already holds any USDC on Base — the USDC contract is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913."},{"title":"Agent self-check before gas-heavy trade","prompt":"Check my own wallet 0xe4be4d0bd82d8e68203deff81f79ede0529f2617 to confirm I have enough USDC on Base to cover the next few micro-payments — token contract is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913."},{"title":"Counterparty due-diligence for DeFi agent","prompt":"I'm about to enter a trade with counterparty wallet 0xdead...beef — can you look up how much of token 0x4200000000000000000000000000000000000006 they're holding on Base right now?"}],"resultDescription":"A JSON object containing the block number at which the balance was read, chain name ('base'), token contract address, token symbol, wallet address, human-readable balance (float), number of decimals, and the raw integer balance string (e.g. '61000' for 0.061 USDC).","failureModes":["Invalid token or wallet address format (must be 0x-prefixed 40-hex-char address) returns a 4xx error","Token contract does not exist on Base returns zero balance or RPC error","Payment not included or insufficient USDC payment via x402 returns HTTP 402","RPC node congestion or Base chain downtime may cause timeouts","Querying an EOA address as a token contract returns nonsensical results"],"whenToPreferThis":"Choose this endpoint when you need a real-time ERC-20 token balance for any wallet on the Base chain without setting up API keys — ideal for AI agents that pay per call in USDC via the x402 protocol. Prefer it over full node RPC calls when you want a simple REST interface with no infrastructure setup, and over free public RPCs when reliability and structured JSON output matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:40:10.497Z","isFirstParty":false,"canonicalSlug":"erc-20-token-balance-lookup-on-base-x402-0a3d8940"}