# Contract Bytecode API
> Fetch any smart contract's deployed EVM bytecode live from the chain's public JSON-RPC, disassemble it into human-readable opcodes, and extract the 4-byte function selectors from its dispatcher. Unlike source-verification or 4-byte directories, this works on ANY deployed contract — verified or not — so it reveals the raw on-chain logic of contracts nobody has published source for. Give it a chain and an address and get the runtime bytecode, a full offset-by-offset opcode disassembly (paged), and the detected function selectors. The reverse-engineering layer for auditors, MEV searchers and security tooling. Reads straight from the chain across Ethereum, Base, Arbitrum, Optimism, BNB, Polygon and more. Live, short cache only.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/bytecode-api/..."
```

## Pricing
- **Free** (Free) — 4,200 calls/Mo, 3 req/s
- **Starter** ($13/Mo) — 98,000 calls/Mo, 8 req/s
- **Pro** ($42/Mo) — 640,000 calls/Mo, 20 req/s
- **Business** ($125/Mo) — 4,400,000 calls/Mo, 50 req/s

## Endpoints

### Bytecode

#### `GET /v1/bytecode` — Deployed runtime bytecode of a contract

**Parameters:**
- `address` (query, required, string) — Contract address (0x + 40 hex) Example: `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`
- `chain` (query, optional, string) — Chain name or id Example: `ethereum`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bytecode-api/v1/bytecode?address=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&chain=ethereum"
```

**Response:**
```json
{
    "data": {
        "note": "The contract's deployed runtime bytecode read live via eth_getCode. EOAs and undeployed addresses return 404.",
        "chain": "ethereum",
        "source": "public JSON-RPC (publicnode)",
        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "bytecode": "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146100775780634f1ef286146100ba5780635c60da1b146101085780638f2839701461015f578063f851a440146101a2575b6100756101f9565b005b34801561008357600080fd5b506100b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610213565b005b610106600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610268565b005b34801561011457600080fd5b5061011d610308565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016b57600080fd5b506101a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610360565b005b3480156101ae57600080fd5b506101b761051e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610201610576565b61021161020c610651565b610682565b565b61021b6106a8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561025c57610257
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/disassemble` — Full opcode disassembly (paged)

**Parameters:**
- `address` (query, required, string) — Contract address (0x + 40 hex) Example: `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`
- `chain` (query, optional, string) — Chain name or id Example: `ethereum`
- `limit` (query, optional, string) — Instructions per page (1-5000) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bytecode-api/v1/disassemble?address=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&chain=ethereum&limit=50"
```

**Response:**
```json
{
    "data": {
        "note": "EVM disassembly of the runtime bytecode. Each instruction has its byte offset, opcode, mnemonic and (for PUSH) the immediate data. Page with limit/offset.",
        "chain": "ethereum",
        "count": 50,
        "limit": 50,
        "offset": 0,
        "source": "public JSON-RPC (publicnode) + local EVM decode",
        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "truncated": true,
        "size_bytes": 2186,
        "instructions": [
            {
                "push": "0x80",
                "offset": 0,
                "opcode": "0x60",
                "mnemonic": "PUSH1"
            },
            {
                "push": "0x40",
                "offset": 2,
                "opcode": "0x60",
                "mnemonic": "PUSH1"
            },
            {
                "offset": 4,
                "opcode": "0x52",
                "mnemonic": "MSTORE"
            },
            {
                "push": "0x04",
                "offset": 5,
                "opcode": "0x60",
                "mnemonic": "PUSH1"
            },
            {
                "offset": 7,
                "opcode": "0x36",
                "mnemonic": "CALLDATASIZE"
            },
            {
                "offset": 8,
                "opcode": "0x10",
                "mnemonic": "LT"
            },
            {
                "push": "0x006d",
                "offset": 9,
                "opcode": "0x61",
                "mnemon
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/selectors` — 4-byte function selectors from the contract dispatcher

**Parameters:**
- `address` (query, required, string) — Contract address (0x + 40 hex) Example: `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`
- `chain` (query, optional, string) — Chain name or id (ethereum, base, arbitrum, optimism, bsc, polygon...) Example: `ethereum`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bytecode-api/v1/selectors?address=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&chain=ethereum"
```

**Response:**
```json
{
    "data": {
        "note": "4-byte function selectors extracted from the contract dispatcher (DUP1 PUSH4 <sel> EQ pattern). Resolve names via a 4-byte signature directory. Proxies and unusual dispatchers may expose fewer.",
        "chain": "ethereum",
        "count": 5,
        "source": "public JSON-RPC (publicnode) + local EVM decode",
        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "selectors": [
            "0x3659cfe6",
            "0x4f1ef286",
            "0x5c60da1b",
            "0x8f283970",
            "0xf851a440"
        ]
    },
    "meta": {
        "timestamp": "2026-06-14T08:04:12.384Z",
        "request_id": "48e98237-2950-467f-8547-bf06ae8672e5"
    },
    "status": "ok",
    "message": "Selectors retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata, supported chains & live sample

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bytecode-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "chains": [
            "ethereum",
            "base",
            "arbitrum",
            "optimism",
            "bsc",
            "polygon",
            "avalanche",
            "gnosis",
            "fantom",
            "linea",
            "scroll",
            "blast"
        ],
        "sample": {
            "chain": "ethereum",
            "selectors_found": 5
        },
        "source": "public JSON-RPC nodes (publicnode.com) via eth_getCode; EVM disassembly computed locally",
        "service": "bytecode-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/bytecode": "Deployed runtime bytecode of a contract (chain, address).",
            "GET /v1/selectors": "4-byte function selectors from the contract dispatcher (chain, address).",
            "GET /v1/disassemble": "Full opcode disassembly, paged (chain, address, limit, offset)."
        },
        "description": "Fetch any contract's deployed EVM bytecode live via public JSON-RPC, disassemble it into opcodes, and extract its 4-byte function selectors — works on verified AND unverified contracts. The reverse-engineering layer for auditors, MEV searchers and security tools. Live, short cache only.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-14T08:04:12.463Z",
        "request_id": "9294c2c6-a8b7-43f7-9002-c6778cfa2107"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/bytecode-api
OpenAPI spec: https://www.oanor.com/api/bytecode-api/openapi.json
