> ## 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.

# eth_getCode

> Returns code at a given address.

### Parameters

<ParamField query="chainId" type="string" default="10143" 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="eth_getCode" required>
  JSON-RPC method name.
</ParamField>

<ParamField body="params" type="object" default={["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","0x2"]} placeholder="[&#x22;0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b&#x22;,&#x22;0x2&#x22;]" required>
  Parameters for eth\_getCode: \[address, defaultBlock].

  Positional parameters for <code>eth\_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">
  The code from the given address. Example: <code>"0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f35b600060078202905091905056"</code>.
</ResponseField>

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

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