{"uid":"cap_DhwbCAsHJ8JvTisOKRbK4","slug":"erc-20-token-balance-on-base-7c9701d6","name":"ERC-20 Token Balance on Base","description":"Live ERC-20 balance on Base: token=0x..&wallet=0x.. -> balance (decimals applied), raw, symbol, block.","url":"https://kr-x402-mvp.kgy5612.workers.dev/crypto/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_w8Bt3s4jNRk_hwjF70uiD","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 live ERC-20 token balance for a wallet on the Base chain, including decimal-adjusted balance, raw balance, symbol, and current block number.","exampleAgentPrompt":"What's the current USDC balance (token contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) for wallet 0xe4be4d0bd82d8e68203deff81f79ede0529f2617 on Base right now?","exampleUseCases":[{"title":"Pre-swap balance check for DeFi agent","prompt":"Before executing the swap, check how much USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) is currently sitting in wallet 0xe4be4d0bd82d8e68203deff81f79ede0529f2617 on Base so we know if there's enough to cover the trade."},{"title":"Portfolio balance snapshot","prompt":"Pull the live token balance for the WETH contract 0x4200000000000000000000000000000000000006 in my wallet 0xabc1234567890abcdef1234567890abcdef123456 on Base and tell me the decimal-adjusted amount and the block it was fetched at."},{"title":"Onchain payment verification","prompt":"Can you confirm how many tokens of 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 are currently in wallet 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef on Base — I want to verify a payment was received."}],"resultDescription":"Returns a JSON object with: decimal-adjusted balance (float), balance_raw (string integer before decimals), token symbol, number of decimals, token contract address, wallet address, chain name ('base'), and the block number at which the balance was read.","failureModes":["Invalid token or wallet address format (must be 0x + 40 hex chars) returns a 400/validation error","Token contract does not exist on Base returns zero balance or an error","Payment not included or insufficient (x402 payment required, $0.003 USDC on Base)","RPC node timeout or Base chain congestion causing delayed or failed response","Wallet address is valid but has never interacted with the token — returns balance of 0"],"whenToPreferThis":"Choose this endpoint when you need a live, single-call ERC-20 token balance on the Base chain with decimals already applied, raw balance, and block context — particularly useful for DeFi agents that need to verify wallet holdings before executing swaps, transfers, or payment checks. Prefer over generic block explorers when you need structured JSON output ready for agent consumption at a predictable per-call cost via x402.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:42:27.218Z","isFirstParty":false,"canonicalSlug":"erc-20-token-balance-on-base-7c9701d6"}