# EVM Contract Bytecode Fetcher

> EVM Contract Bytecode Fetcher is a paid API for AI agents from chain.openverbs.com, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-10).

Fetches the deployed runtime bytecode and Keccak-256 code hash of any EVM smart contract address across Ethereum, Base, Arbitrum, Optimism, and Polygon, with optional historical block support.

## Facts

- Endpoint: POST https://chain.openverbs.com/v1/bytecode?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-contract-bytecode-fetcher-47433da4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b_NHet9uc_V4tgUD4qTX3

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-contract-bytecode-fetcher-47433da4 -d '<json body>'
```

Example prompt: Can you fetch the deployed bytecode and code hash for the contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum so I can fingerprint it?

## When to prefer this

Choose this endpoint when you need to retrieve, fingerprint, or compare the deployed runtime bytecode of a smart contract on any of the five supported EVM chains (Ethereum, Base, Arbitrum, Optimism, Polygon). It is ideal for security audits, contract identity verification, detecting proxy upgrades at historical blocks, or feeding raw bytecode to a disassembler. It requires no API key and handles RPC fallback automatically. Prefer it over general block explorers when you need structured, machine-readable bytecode output rather than a human-facing UI.

## Known failure modes

- Invalid address format (not a valid 0x-prefixed 40-hex-char address) returns a validation error
- Unsupported chain name returns an enum validation error
- Block number out of range or not yet mined returns an RPC error
- Address is an EOA — returns 0x bytecode and null hash (not an error, but isContract is false)
- Bytecode exceeds 256 KiB cap — response is truncated or rejected
- RPC node unavailability on the selected chain triggers endpoint fallback; if all fail, returns a service error

## Output

Returns a JSON object containing the full hex-encoded runtime bytecode (capped at 256 KiB), the Keccak-256 hash of that code, the byte length, and a boolean isContract field. For non-contract (EOA) addresses, bytecode is '0x' and the hash is null.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "block": {
   "type": [
    "integer",
    "string"
   ],
   "description": "Non-negative safe integer, decimal/hex block number, or latest/earliest/pending/safe/finalized. Default latest."
  },
  "chain": {
   "enum": [
    "ethereum",
    "base",
    "arbitrum",
    "optimism",
    "polygon"
   ],
   "type": "string",
   "description": "EVM chain to query. One of: ethereum, base, arbitrum, optimism, polygon. Default \"ethereum\"."
  },
  "address": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$",
   "description": "Address whose deployed code to read."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-contract-bytecode-fetcher-47433da4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chain.openverbs.com](https://www.zero.xyz/host/chain.openverbs.com/llms.txt)
