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

# eth_getCode | Arc

> Arc API method that returns the bytecode at a given address. This is commonly used to verify if an address is a contract. On Arc.

Arc API method that returns the bytecode at a given address. This is commonly used to verify if an address is a contract.

## Parameters

* `address` — the address to get the code from
* `blockParameter` — the block number (hex) or tag (`latest`, `earliest`, `pending`)

## Response

* `result` — the bytecode at the given address, or `0x` if no code exists (EOA)

## `eth_getCode` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const PATHUSD = "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f";

  const getCode = async () => {
      const code = await provider.getCode(PATHUSD);
      console.log(`Is contract: ${code !== '0x'}`);
    };

  getCode();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))

  PATHUSD = "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f"
  code = web3.eth.get_code(PATHUSD)
  print(f"Is contract: {code != b''}")
  ```

  ```bash cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f", "latest"], "id": 1}'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/arc_node_api/accounts_info/eth_getCode.json POST /
openapi: 3.0.0
info:
  title: Chainstack Node API
  version: 1.0.0
  description: This is an API for interacting with a Chainstack node.
servers:
  - url: https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c
security: []
paths:
  /:
    post:
      tags:
        - upload
      summary: eth_getCode
      operationId: eth_getCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getCode
                params:
                  type: array
                  default:
                    - '0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f'
                    - latest
      responses:
        '200':
          description: Returns the result of eth_getCode.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
              example:
                jsonrpc: '2.0'
                id: 1
                result: >-
                  0x608060405236156054577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f35b3d90fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f3fea26469706673582212203a03c53e62063406d2b425c2ed497305ba7a6718e884d256aeb3ce0f4965111264736f6c63430008180033

````