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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/base-getcode",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# eth_getCode | Base

Base API method `eth_getCode` retrieves the code stored at a specific address. This method is typically used to inspect the bytecode of smart contracts on the Base blockchain.

This example retrieves the bytecode of the [USDC token](https://basescan.org/address/0x833589fcd6edb6e08f4c7c32d4f71b54bda02913) on the Base Mainnet.

<Note>
  When called against a block older than the latest \~128 blocks, this method is treated as an archive request (2 RUs instead of 1 RU). See [request units](/docs/request-units#archive-state-methods).
</Note>

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `address` — the address to get the code from.
* `block` — the block number (in hexadecimal) or one of the strings `"earliest"`, `"latest"`, or `"pending"`, indicating the state to consider. The default is `"latest"`.

## Response

* `result` — the code from the specified address, returned as a hexadecimal string.

## Use case

The `eth_getCode` method is essential for:

* Developers and auditors who need to verify the deployed bytecode of smart contracts.
* DApps that interact with contracts dynamically based on their code.
* Tools and services that monitor and analyze contract deployments and updates.


## OpenAPI

````yaml /openapi/base_node_api/eth_getCode.json POST /2fc1de7f08c0465f6a28e3c355e0cb14
openapi: 3.0.0
info:
  title: eth_getCode example
  version: 1.0.0
  description: >-
    This is an API example for eth_getCode, a method to get the code at a
    specific address.
servers:
  - url: https://base-mainnet.core.chainstack.com
security: []
paths:
  /2fc1de7f08c0465f6a28e3c355e0cb14:
    post:
      tags:
        - Ethereum Operations
      summary: eth_getCode
      operationId: getCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - id
                - params
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getCode
                id:
                  type: integer
                  default: 1
                params:
                  type: array
                  default:
                    - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
                    - latest
                  items:
                    type: string
      responses:
        '200':
          description: The code from the specified address
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````