# ETH Mainnet eth_getCode

> ETH Mainnet eth_getCode is a paid API for AI agents from ari001.tailb4ac3a.ts.net, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-27).

Returns the deployed bytecode of a smart contract at a given Ethereum mainnet address using eth_getCode.

## Facts

- Endpoint: GET https://ari001.tailb4ac3a.ts.net/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_getcode?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/eth-mainnet-eth-getcode-03c15ca4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7XWlhXY_wA9tC0kd9qwz9

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 eth-mainnet-eth-getcode-03c15ca4
```

Example prompt: Can you fetch the deployed bytecode for the Ethereum contract at 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 on mainnet?

## When to prefer this

Use this endpoint when you need to verify whether a contract is deployed at a specific Ethereum mainnet address, retrieve raw EVM bytecode for analysis or auditing, or distinguish between EOAs and smart contracts programmatically. Prefer this over general-purpose Ethereum RPC gateways when you want a pay-per-call, agent-friendly interface with no API key setup.

## Known failure modes

- Invalid address format (not matching 0x + 40 hex pattern) returns a validation error
- Address with no deployed contract returns '0x' (empty bytecode, not an error)
- Network or RPC node unavailability causes timeout or 5xx error
- Rate limiting or quota exhaustion may result in 429 or payment-related errors
- Self-destructed contracts may return '0x' even if previously deployed

## How this service works

Takes an address (0x + 40 hex) and returns the contract bytecode on Ethereum mainnet via eth_getCode. Base RPC read of an address, block or transaction.

## Output

Returns the raw hex-encoded bytecode (EVM code) stored at the given Ethereum address on mainnet. If the address is an externally owned account (EOA) with no contract, it returns '0x'. If a contract is deployed there, it returns the full bytecode string.

## 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",
     "properties": {
      "address": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "0x + 40 hex"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "service"
     ],
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "hex": {
       "type": [
        "string",
        "null"
       ]
      },
      "chain": {
       "type": "string"
      },
      "error": {
       "type": "string",
       "description": "present when ok is false"
      },
      "method": {
       "type": "string"
      },
      "result": {
       "type": "string",
       "description": "the bytecode, 0x-hex"
      },
      "service": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/eth-mainnet-eth-getcode-03c15ca4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ari001.tailb4ac3a.ts.net](https://www.zero.xyz/host/ari001.tailb4ac3a.ts.net/llms.txt)
