> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uniblock.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# klay_getCode

> Returns code stored at a given address at the specified block.

### Parameters

<ParamField query="chainId" type="string" default="1001" required>
  Unique identifier for a blockchain network.
</ParamField>

<ParamField body="id" type="number" default={1} required>
  Request identifier used to match responses.
</ParamField>

<ParamField body="jsonrpc" type="string" default="2.0" required>
  JSON-RPC version.
</ParamField>

<ParamField body="method" type="string" default="klay_getCode" required>
  JSON-RPC method name.
</ParamField>

<ParamField body="params" type="object" default={["0xf482f03d3cf03f568c2f3d2b2043614d8d24aa79","latest"]} placeholder="[&#x22;0xf482f03d3cf03f568c2f3d2b2043614d8d24aa79&#x22;,&#x22;latest&#x22;]" required>
  Parameters: \[address, block parameter].

  Positional parameters for <code>klay\_getCode</code>:

  <ul>
    <li><code>params\[0]</code>: The address.</li>
    <li><code>params\[1]</code>: Block identifier. Can be an integer block number or a string tag: "latest", "earliest", or "pending".</li>
  </ul>
</ParamField>

### Returns

<ResponseField name="result" type="string">
  Hex-encoded contract code (0x if no code). Example: <code>"0x6080604052..."</code>.
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl --request POST \
    --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=1001 \
    --header 'content-type: application/json' \
    --data '{
      "id": 1,
      "jsonrpc": "2.0",
      "method": "klay_getCode",
      "params": [
        "0xf482f03d3cf03f568c2f3d2b2043614d8d24aa79",
        "latest"
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x6080604052..."
  }
  ```
</ResponseExample>
