Get contract bytecode at an address
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Returns the contract code stored at a given address. If the address is an externally owned account (EOA), it returns "0x".
State access is limited to recent blocks - these are full nodes, not archive nodes. In practice only the last dozen or so blocks resolve; deeper block parameters return -32000 missing trie node <hash> (path ). earliest also works, since genesis state is kept. Use latest or pending for anything that must not fail: the pruning boundary moves continuously, so a height taken from eth_blockNumber can already be out of range by the time you query it.
Block, transaction and receipt history is complete back to block 1 - only state is pruned.
Block tags accepted by this node: earliest, latest, pending, or a hex block number. safe and finalized are NOT supported and fail with -32602 invalid argument N: hex string without 0x prefix - Lachesis aBFT finalises immediately, so there is no separate safe/finalized head.
Body
jsonrpcstringrequiredJSON-RPC version.
methodstringrequiredJSON-RPC method name.
paramsArray<string>requiredParameters array with two elements:
- The address to get the code for (hex string, 0x-prefixed).
- The block number or block tag (e.g., "latest", "earliest", "pending").
idintegerrequiredRequest identifier.
Response
Contract bytecode in hex format
Method not served by this endpoint. The body is the plain-text string
Method Not Allowed, not JSON.
Missing API key - the api-key header was absent. The body is the
plain-text string Missing API_key, not JSON.