Quicknode RPC icon

Quicknode RPC

Interact with blockchain via Quicknode RPC

Get Code

AI-generated

Summary

Retrieves the smart contract bytecode at a specific Ethereum address for a given block.

Inputs

  • address (required) — The Ethereum address (42 characters starting with 0x) to query.
  • block — Block identifier: decimal/hex block number or tag (latest, earliest, pending, safe, finalized). Defaults to 'latest'.

Output shape

A single record containing the contract bytecode as a hex string (or null if no contract exists).

The output includes the raw result from the eth_getCode RPC method and the network name from credentials.

Examples

Example 1: Check if an address is a smart contract and see its compiled bytecode.

Operation: Get Code | Address: 0x123... | Block: latest

Links

Discussion