# Agent402 Contract Code Checker

> Agent402 Contract Code Checker is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Retrieves the deployed bytecode and keccak256 hash for an EVM address, indicating whether it is a smart contract on a specified network.

## Facts

- Endpoint: GET https://agent402.tools/api/contract-code
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-contract-code-checker-004db440
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z3RPSMogJHG6SdAOlPPYP

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 agent402-contract-code-checker-004db440
```

Example prompt: Can you check if the address 0x8335aBc5d73A00c35F3f7C6F5Ea44C52E7a2C90 is a smart contract on Base, and if so give me its bytecode hash and size?

## When to prefer this

Choose this endpoint when you need a fast, pay-per-call, no-signup way to programmatically determine if an EVM address has deployed contract bytecode, get its keccak256 hash, or check contract presence across multiple chains (Ethereum, Base, Polygon, Arbitrum, Optimism). It is ideal for AI agents that need on-chain contract verification without maintaining API keys or subscriptions, paying only $0.002 USDC per call via x402.

## Known failure modes

- Invalid or malformed EVM address (not a valid 0x… hex address) — returns an error
- Address not found or network unavailable — may return isContract: false or an error
- Unsupported network name provided — falls back to Base or returns an error
- Payment failure (insufficient USDC balance or unsupported chain) — 402 response with payment instructions
- Rate limiting or node timeout on the target network — transient error response

## How this service works

Is this address a contract, and what code does it hold? Returns isContract, deployed bytecode size, and the keccak-256 hash of the bytecode (stable fingerprint for comparing deployments) on Ethereum, Base, Polygon, Arbitrum, or Optimism. Keyless multi-endpoint failover. ?address=0x…&network=base

## Output

Returns a JSON object containing the queried EVM address, the network it was checked on, a keccak256 hash of the deployed bytecode, a boolean flag indicating whether the address is a contract, and the size of the bytecode in bytes.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "address": {
       "type": "string",
       "description": "EVM address to check (0x…)."
      },
      "network": {
       "type": "string",
       "description": "ethereum / base / polygon / arbitrum / optimism (default base)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "network",
      "address",
      "isContract",
      "bytecodeBytes",
      "keccak256"
     ],
     "properties": {
      "address": {
       "type": "string"
      },
      "network": {
       "type": "string"
      },
      "keccak256": {
       "type": "string"
      },
      "isContract": {
       "type": "boolean"
      },
      "bytecodeBytes": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "address": "0x8335…",
  "network": "base",
  "keccak256": "0x…",
  "isContract": true,
  "bytecodeBytes": 2148
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-contract-code-checker-004db440/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
