{"uid":"cap_4VVeEc7MYAGBaPWz9Rn5A","slug":"agent402-erc-20-token-allowance-lookup-2bdaf174","name":"Agent402 ERC-20 Token Allowance Lookup","description":"How much of an ERC-20 token a spender contract is approved to move from an owner wallet - the approval check an agent runs before a swap, a bridge, or an x402 transferWithAuthorization flow. Returns the allowance as an exact decimal string scaled by the token's decimals, the raw uint256, and an `unlimited` flag for max-uint style approvals.","url":"https://agent402.tools/api/token-allowance","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"owner":{"type":"string","description":"Wallet that granted (or did not grant) the approval."},"network":{"type":"string","description":"ethereum / base / polygon / arbitrum / optimism (default ethereum)."},"spender":{"type":"string","description":"Contract or wallet whose allowance to read."},"contract":{"type":"string","description":"0x-prefixed 40-char ERC-20 contract address."}}},"responseSchema":{"type":"json","example":{"raw":"0","owner":"0xd8da6bf26964af9d7eed9e03e53415d37aa96045","source":"alchemy","symbol":"USDC","chainId":1,"network":"ethereum","spender":"0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad","contract":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","decimals":6,"allowance":"0","fetchedAt":"2026-08-22T12:00:00.000Z","unlimited":false}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gdSbOsuMn2jRcVGEW1ywC","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the current ERC-20 token allowance granted by an owner wallet to a spender address on a specified EVM network.","exampleAgentPrompt":"Check how much USDC the Uniswap Universal Router (0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD) is allowed to spend from wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum mainnet.","exampleUseCases":[{"title":"Pre-swap allowance check in DeFi agent","prompt":"Before I execute this USDC swap on Uniswap on Ethereum, check if my wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 has already approved the router 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD to spend USDC (contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)."},{"title":"Detect unlimited approval security risk","prompt":"Check if wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 has granted an unlimited USDC allowance to contract 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD on Base — I want to know if I need to revoke it."},{"title":"Cross-chain allowance audit for portfolio tool","prompt":"For my DeFi dashboard, look up the current DAI allowance that 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 has given to the Aave lending pool spender 0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2 on Polygon."}],"resultDescription":"Returns a JSON object containing the current allowance as both a raw big-integer string and a human-readable decimal string, along with the token symbol, decimals, chain ID, network name, owner, spender, contract address, data source (Alchemy), whether the approval is unlimited, and a timestamp of when the data was fetched.","failureModes":["Invalid or malformed contract address returns an error or zero allowance","Unsupported network name causes a 400 or validation error","Non-ERC-20 contract address (e.g. EOA or NFT contract) may return unexpected results","Network congestion or Alchemy upstream outage causes timeout","Owner or spender address not checksummed may cause parsing issues on some chains"],"whenToPreferThis":"Use this endpoint when an AI agent needs to programmatically verify whether a wallet has already approved a specific spender to move ERC-20 tokens before initiating a DeFi transaction. It is preferable over general blockchain RPC calls because it abstracts away raw contract ABI calls, automatically decodes decimals and symbol, flags unlimited approvals, and returns structured JSON. Best suited for pre-transaction checks, security audits of token approvals, and DeFi workflow automation across Ethereum, Base, Polygon, Arbitrum, and Optimism.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:52:32.912Z","isFirstParty":false}