Skip to content
TraceFast Docs

Bytecode of a contract

Open the contract on its entity page →

The current runtime bytecode of a contract as hex, with its code hash and a structural fingerprint that is equal across contracts sharing the same logic.

GET https://tracefast.xyz/api/v1/chains/1/contracts/{address}/bytecode
ParameterInTypeNotes
addresspathstring0x-prefixed, 40 hex characters, any case

Access — an API key on the Enriched Data plan or higher (plans), or no key at all: pay per call with x402 at the same path on https://mpp.tracefast.xyz/api/v1, at the price its 402 states. As a tool for AI agents: get_contract_bytecode on the MCP server. Stable — see stability.

chains/1 is a literal: other chain ids answer 404 chain_not_supported. The method takes no query parameters — an unknown one is refused rather than ignored.

What it covers, and what it does not

  • Runtime code, current state. This is the code stored at the address now — not the creation code, and not earlier versions. When the code changed, the contract method says so in lifecycle.
  • Up to 24 576 bytes of code, the EVM's contract size limit — at most 49 154 characters of hex.
  • codeHash and fingerprint answer different questions. Two contracts with equal codeHash have byte-identical code. Two with equal fingerprint share their logic even when their compiler metadata differs.
  • An address with no indexed code answers 404.

Response

200 application/json, WETH. The bytecode value is shortened here; the real one is 6 250 characters:

{
  "data": {
    "chainId": 1,
    "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "codeHash": "0xd0a06b12ac47863b5c7be4185c2deaad1c61557033f56c7d4ea74429cbb25e23",
    "bytecode": "0x6060604052600436106100af576000357c0100…",
    "bytecodeSize": 3124,
    "fingerprint": "0xc58b77064884ea1d696b177387c2300f3a12e58857ed2a07e588d8543f8f2a89"
  },
  "meta": {
    "chain": "ethereum",
    "timestamp": 1789047628707,
    "cached": false,
    "docs": "https://docs.tracefast.xyz/api/contract-bytecode"
  }
}

data

FieldMeaning
chainId1 — Ethereum mainnet
addressthe contract, lowercase
codeHashKeccak-256 hash of the code
bytecodethe runtime code, 0x-prefixed hex. Empty when the code for this hash is not available — codeHash and bytecodeSize are still stated
bytecodeSizesize of the code in bytes: half the hex length, without 0x
fingerprinta structural fingerprint of the code, stable across metadata-only differences. Equal fingerprints mean shared logic

What the bytecode is and how the EVM runs it: ethereum.org — the EVM.

Errors

StatuscodeWhendetails
404not_foundno contract code is indexed at this address—
422block_not_availablereason: coverage_gap — recent blocks are in a coverage gap, and a contract deployed in them cannot be seen right now. Retry latercoverageGapFromBlock, coverageGapToBlock, maxAvailableBlock

Malformed input, unknown parameters and the key check's 401/403/429 are the same for every method — see conventions and API keys.


Last updated 22 Oct 2026, 08:06 UTC · verified against TraceFast v1.0.261 · Markdown