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

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

Tempo 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

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

const PATHUSD = "0x20c0000000000000000000000000000000000000";

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 = "0x20c0000000000000000000000000000000000000"
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": ["0x20c0000000000000000000000000000000000000", "latest"], "id": 1}'
```


## OpenAPI

````yaml openapi/tempo_node_api/account_info/eth_getCode.json POST /
openapi: 3.0.0
info:
  title: eth_getCode Tempo example
  version: 1.0.0
  description: This is an API example for eth_getCode for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e
security: []
paths:
  /:
    post:
      tags:
        - Account info
      summary: eth_getCode
      operationId: tempo-eth-getCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getCode
                params:
                  type: array
                  items: {}
                  default:
                    - '0x20c0000000000000000000000000000000000000'
                    - latest
                  description: Contract address and block parameter
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The contract bytecode
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
                    description: The bytecode at the given address, or 0x if no code exists

````