{"uid":"cap_xIrnljJQNNW4Us85HI91e","slug":"onesource-erc20-token-balance-ca8b3a79","name":"OneSource ERC20 Token Balance","description":"ERC20 token balance for any Ethereum wallet - USDC, USDT, DAI, or any token - via balanceOf (eth_call) on OneSource live Ethereum RPC","url":"https://api.onesource.io/api/chain/erc20-balance","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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["address","contract"],"properties":{"address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"network":{"enum":["ethereum","sepolia","robinhood"],"type":"string","default":"ethereum"},"contract":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"symbol":{"type":"string"},"account":{"type":"string"},"balance":{"type":"string"},"decimals":{"type":"integer"},"contract_address":{"type":"string"}},"description":"Endpoint-specific response payload"},"meta":{"type":"object","required":["endpoint","request_id"],"properties":{"endpoint":{"type":"string"},"cost_usdc":{"type":"string"},"request_id":{"type":"string"},"payment_chain":{"type":"string"},"payment_token":{"type":"string"}}},"error":{"type":["object","null"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}}}}}},"responseSchema":{"type":"json","example":{"data":{"name":"Tether USD","symbol":"USDT","account":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","balance":"1234567890","decimals":6,"contract_address":"0xdac17f958d2ee523a2206206994597c13d831ec7"},"meta":{"endpoint":"/api/chain/erc20-balance","cost_usdc":"0.001","request_id":"00000000abcdef01","payment_chain":"base","payment_token":"USDC"}}},"example":{"request":{"token":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","account":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","network":"ethereum"},"response":{"data":{"name":"USD Coin","symbol":"USDC","account":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","balance":"31127137","decimals":6,"contract_address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},"meta":{"endpoint":"/api/chain/erc20-balance","request_id":"be23b9a9ff0bda0a"}}},"exampleRequest":{"token":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","account":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","network":"ethereum"},"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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_W0eQUpDuqMvAzpqqUnsYA","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 ERC20 token balance for any Ethereum wallet address by calling balanceOf on-chain via live Ethereum RPC","exampleAgentPrompt":"What's the USDC balance (contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) for wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum mainnet?","exampleUseCases":[{"title":"Verify user has sufficient stablecoin","prompt":"Can you check if the wallet 0x742d35Cc6634C0532925a3b844Bc927e4F5e9cE3 holds at least 5000 USDC on Ethereum mainnet before we process their payment?"},{"title":"Monitor DeFi protocol token holdings","prompt":"What's the current balance of UNI tokens (0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984) for the Uniswap governance vault at 0x1a9c8182c09db50e33aa9b7075033bd9dfb5a5a9?"},{"title":"Cross-chain bridge readiness check","prompt":"How many USDT tokens (0xdac17f958d2ee523a2206206994597c13d831ec7) does this Sepolia testnet wallet 0x8ba1f109551bD432803012645Ac136ddd64DBA72 have before initiating the bridge?"}],"resultDescription":"Returns the raw on-chain ERC20 token balance for the specified wallet address, retrieved via a live eth_call (balanceOf) against the OneSource Ethereum RPC. The balance is typically in the token's smallest unit (e.g. wei or 6-decimal units for USDC/USDT).","failureModes":["Invalid token address format (not a valid 0x hex address) — returns 400 or validation error","Invalid account address format — returns 400 or validation error","Token contract does not implement ERC20 balanceOf — may return zero or an RPC error","Network value not in enum (ethereum, sepolia) — returns validation error","RPC node temporarily unavailable — returns 5xx error","Wallet has no balance — returns 0 (not an error)"],"whenToPreferThis":"Use this endpoint when you need to check the on-chain ERC20 token balance for a specific wallet address on Ethereum mainnet or Sepolia testnet. Prefer this over the combined live wallet endpoint when you only need a single token's balance and want a lightweight, targeted eth_call rather than a multi-asset query.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:54:37.423Z","isFirstParty":false}