# EVM Address Code Inspector (Contract vs EOA Detector)

> EVM Address Code Inspector (Contract vs EOA Detector) is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Determines whether an Ethereum-compatible address is a smart contract or an externally owned account (EOA), returning deployed bytecode size and keccak256 code hash across major EVM networks.

## Facts

- Endpoint: GET https://api.agentstools.dev/code
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-address-code-inspector-contract-vs-eoa-detector-b7653f40
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6huSwdl5mvXL8r1lr9jw5

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability evm-address-code-inspector-contract-vs-eoa-detector-b7653f40
```

Example prompt: Can you check whether 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 is a smart contract or a regular wallet on Ethereum, and give me its code size and code hash?

## When to prefer this

Use this endpoint when you need to programmatically distinguish smart contracts from EOAs on Base, Ethereum, Arbitrum, Optimism, Polygon, or BNB — especially when you need the exact bytecode size or code hash for security analysis, contract verification, or on-chain due diligence. Prefer this over general blockchain explorers when you need a simple, structured API response without scraping.

## Known failure modes

- Invalid address format (not a valid 0x hex address) returns an error
- Unsupported network value returns an enum validation error
- Address not found or RPC node unavailable may return a timeout or upstream error
- Rate limiting or payment failure returns 402 Payment Required

## How this service works

Is an address a contract or an EOA on Base, Ethereum, Arbitrum, Optimism, Polygon or BNB (default Base)? Returns is_contract, deployed code size in bytes, and the keccak256 code hash (eth_getCode).

## Output

Returns a JSON object with: is_contract (boolean indicating whether the address has deployed bytecode), code_size (integer number of bytes of deployed code), and code_hash (keccak256 hash of the deployed bytecode via eth_getCode). An EOA returns code_size of 0 and the empty keccak256 hash.

## Request schema (JSON Schema)

```json
{
 "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"
     ],
     "properties": {
      "address": {
       "type": "string",
       "description": "Address (0x..)"
      },
      "network": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon",
        "bnb"
       ],
       "type": "string",
       "description": "EVM network to read from (default base)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-address-code-inspector-contract-vs-eoa-detector-b7653f40/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
