# OneSource eth_getCode Contract Checker

> OneSource eth_getCode Contract Checker is a paid API for AI agents from api.onesource.io, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Returns deployed bytecode for an Ethereum address to determine whether it is a smart contract or an externally owned account (EOA)

## Facts

- Endpoint: GET https://api.onesource.io/api/chain/code/:address
- 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/onesource-eth-getcode-contract-checker-8d0c3a7f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RI14FOeLdHKZKQlET7eMf

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 onesource-eth-getcode-contract-checker-8d0c3a7f
```

Example prompt: Can you check if 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 is a smart contract or just a regular wallet on Ethereum mainnet?

## When to prefer this

Use this endpoint when you need to programmatically distinguish smart contracts from EOAs, verify that a deployment succeeded, or retrieve raw bytecode for a known Ethereum address. Ideal for pre-flight checks before calling contract methods, or for security workflows that need to confirm an address is (or is not) a contract. Supports both mainnet and Sepolia, making it useful in test and production pipelines.

## Known failure modes

- Invalid address format (not 0x + 40 hex chars) — likely returns 400 or validation error
- Unsupported network value — returns error since only 'ethereum' and 'sepolia' are accepted
- Node/RPC unavailability — may return 5xx or timeout
- Address with no code (EOA) returns '0x' which is valid but may be misread as failure

## How this service works

Check if an Ethereum address is a contract via eth_getCode - returns deployed bytecode

## Output

Returns the deployed bytecode (hex-encoded) at the given Ethereum address as retrieved via eth_getCode. If the address is a smart contract, the bytecode will be a non-empty hex string; if it is an externally owned account (EOA), the result will be '0x' (empty). Supports Ethereum mainnet and Sepolia testnet.

## Example request

```json
{
 "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
 "network": "ethereum"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-eth-getcode-contract-checker-8d0c3a7f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.onesource.io](https://www.zero.xyz/host/api.onesource.io/llms.txt)
