Alchemy Logo

eth_getCode

POST
/{apiKey}

Returns the code at a given address.

Path Parameters

apiKeystringrequireddefaults to docs-demo

For higher throughput, create your own API key

Request

Addressstringformat: "^0x[0-9a-fA-F]{40}$"required

The address of the contract to get code from.

Blockstring or enumrequired

The block number, tag, or hash at which to retrieve the code.

Identifies a block by explicit number, a predefined tag (e.g., latest/safe/finalized), or a 32-byte block hash.

Responses

200

The code from the specified address, as a hexadecimal string.

Was this page helpful?