{"uid":"cap_fFVuUX9TE7O9PKZwqi1EG","slug":"chain-code-size-contract-detection-0c61f4ad","name":"Chain Code Size & Contract Detection","description":"Is an address a smart contract or a regular wallet (EOA)? Returns whether deployed bytecode exists and its size via eth_getCode, across Base, Ethereum, Optimism, Arbitrum, Polygon, Gnosis. The safety/identity read wallet, payment and trading agents make before interacting with an address. Live public RPC; one paid call at $0.001.","url":"https://store.agentexchange.work/chain/code?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":["address"],"properties":{"chain":{"type":"string","description":"base|ethereum|optimism|arbitrum|polygon|gnosis (default base)"},"address":{"type":"string","description":"Address to check (0x...)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"code_size":{"type":"number"},"is_contract":{"type":"boolean"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.09","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.09","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_4vHKDqQDYNllS9unsDB5Q","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.09","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Checks whether an Ethereum-compatible address is a smart contract by returning its on-chain bytecode size across multiple EVM networks","exampleAgentPrompt":"Can you check if 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9 is a smart contract on Ethereum mainnet, and tell me its code size?","exampleUseCases":null,"resultDescription":"Returns a JSON object with the queried chain name, the address, the bytecode code_size in bytes (0 means no code = EOA), and a boolean is_contract field indicating whether deployed contract code exists at that address.","failureModes":["Invalid or malformed address (non-0x format) returns an error","Unsupported chain name returns an error — must be one of base, ethereum, optimism, arbitrum, polygon, gnosis","Payment failure (insufficient USDC balance or x402 protocol error) results in 402 response","Network RPC timeout for the target chain may cause delayed or failed response","Address with no code returns is_contract: false and code_size: 0 (not an error, but may be misinterpreted)"],"whenToPreferThis":"Use this endpoint when you need to programmatically distinguish smart contract addresses from externally owned accounts (EOAs) on EVM chains, especially in a pay-per-call, no-signup context via x402. Prefer this over full blockchain explorers when you only need contract/EOA classification and bytecode size, not full ABI or source code. Ideal for agents doing on-chain due diligence, routing logic, or pre-flight checks before interacting with an address.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:30:59.225Z","isFirstParty":false,"canonicalSlug":"chain-code-size-contract-detection-0c61f4ad"}