Eth_getCode

Get Contract Bytecode at Address

post

Returns the contract code stored at a given address. If the address is an externally owned account (EOA), it returns "0x".

Authorizations
api-keystringRequired
Body
jsonrpcstringRequired

JSON-RPC version.

Example: 2.0
methodstringRequired

JSON-RPC method name.

Example: eth_getCode
paramsstring[] · min: 2 · max: 2Required

Parameters array with two elements:

  1. The address to get the code for (hex string, 0x-prefixed).
  2. The block number or block tag (e.g., "latest", "earliest", "pending").
Example: ["0x407d73d8a49eeb85d32cf465507dd71d507100c1","latest"]
idintegerRequired

Request identifier.

Example: 1
Responses
chevron-right
200

Contract bytecode in hex format

application/json
jsonrpcstringOptional

JSON-RPC version.

Example: 2.0
idintegerOptional

Request ID.

Example: 1
resultstringOptional

The contract bytecode as a hex string (0x-prefixed). Returns "0x" if no contract code is found at the address.

Example: 0x6080604052348015600f57600080fd5b5060...
post
/
200

Contract bytecode in hex format

Last updated