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
| Parameter | In | Type | Notes |
|---|---|---|---|
address | path | string | 0x-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.
codeHashandfingerprintanswer different questions. Two contracts with equalcodeHashhave byte-identical code. Two with equalfingerprintshare 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
| Field | Meaning |
|---|---|
chainId | 1 — Ethereum mainnet |
address | the contract, lowercase |
codeHash | Keccak-256 hash of the code |
bytecode | the runtime code, 0x-prefixed hex. Empty when the code for this hash is not available — codeHash and bytecodeSize are still stated |
bytecodeSize | size of the code in bytes: half the hex length, without 0x |
fingerprint | a 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
| Status | code | When | details |
|---|---|---|---|
| 404 | not_found | no contract code is indexed at this address | — |
| 422 | block_not_available | reason: coverage_gap — recent blocks are in a coverage gap, and a contract deployed in them cannot be seen right now. Retry later | coverageGapFromBlock, 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.
Related pages
- One contract — the code's interfaces, proxy pattern and lifecycle
- Function selectors of a contract — the functions found in this code
- Implementations of a proxy contract — where a proxy's real logic lives
- Contracts on the entity page — the same contract, read in the app
Last updated 22 Oct 2026, 08:06 UTC · verified against TraceFast v1.0.261 · Markdown