{"uid":"cap_PVaZEIlD1MsXicsy-0SVm","slug":"erc20-token-decimals-lookup-ca6c5b84","name":"ERC20 Token Decimals Lookup","description":"Decimals of an ERC20 token — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/erc20-decimals?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"chain":{"enum":["ethereum","base","polygon","arbitrum","optimism","bsc","avalanche","gnosis","linea","scroll"],"type":"string"},"contract":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"erc20-decimals","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.001,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OCOsr5xuq6LdesA6Yri9d","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the decimals value of an ERC20 token contract on a specified EVM-compatible blockchain network.","exampleAgentPrompt":"What are the decimals for the USDC token contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum?","exampleUseCases":[{"title":"Normalize DeFi token transfer amounts","prompt":"I need to display this token balance correctly — can you look up the decimals for the contract 0x6B175474E89094C44Da98b954EedeAC495271d0F on Ethereum so I can convert the raw amount to DAI?"},{"title":"Cross-chain token decimal verification","prompt":"Check the decimals for the USDT contract 0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7 on Avalanche so I know how to interpret the amounts coming from the bridge."},{"title":"Token amount conversion in a trading bot","prompt":"My bot is pulling raw balances from Polygon for the contract 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 — what decimals does that token use so I can format the numbers properly?"}],"resultDescription":"Returns a JSON object with ok=true, the type field 'erc20-decimals', the decimals integer value for the specified contract, a payment receipt containing a transaction hash, USD amount, and receipt ID, and the ISO 8601 timestamp of generation.","failureModes":["Invalid contract address format (not a valid 0x-prefixed 40-hex address) returns an error","Unsupported chain name (outside the allowed enum) returns validation error","Contract address is not an ERC20 token or does not implement the decimals() function","Network node unavailable or RPC timeout for the specified chain","Payment failure via x402 protocol blocks the request"],"whenToPreferThis":"Use this endpoint when you need to programmatically determine the decimal precision of any ERC20 token contract across major EVM chains (Ethereum, Base, Polygon, Arbitrum, Optimism, BSC, Avalanche, Gnosis, Linea, Scroll) and want a simple pay-per-call API without managing your own RPC nodes. Ideal for DeFi agents, wallets, and data pipelines that need to normalize raw token amounts to human-readable values.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:35.694Z","isFirstParty":false,"canonicalSlug":"erc20-token-decimals-lookup-ca6c5b84"}