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

# eth_getCode

> Get the code stored at an address.

export const chain = '1';

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


## OpenAPI

````yaml openapi/api-reference/endpoint/ethgetcode.json GET /v2/api
openapi: 3.1.0
info:
  title: eth_getCode
  version: 2.0.0
  description: Get the code stored at an address.
  license:
    name: Etherscan API Terms
    url: https://etherscan.io/terms
servers:
  - url: https://api.etherscan.io
    description: Etherscan API.
security:
  - apiKey: []
paths:
  /v2/api:
    get:
      summary: eth_getCode
      description: Get the code stored at an address.
      operationId: getEthgetcode
      parameters:
        - name: chainid
          in: query
          required: true
          description: >-
            Chain ID to query, eg 1 for Ethereum, 42161 for Arbitrum from our
            [supported chains](/supported-chains).
          schema:
            type: string
          example: '1'
        - name: module
          in: query
          required: true
          description: Set to proxy for this endpoint.
          schema:
            type: string
            default: proxy
          example: proxy
        - name: action
          in: query
          required: true
          description: Set to eth_getCode for this endpoint.
          schema:
            type: string
            default: eth_getCode
          example: eth_getCode
        - name: address
          in: query
          required: true
          description: The address to query.
          schema:
            type: string
          example: '0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c'
        - name: tag
          in: query
          required: false
          description: Use latest, earliest, pending, or a block number in hex.
          schema:
            type: string
          example: latest
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC protocol version.
                  id:
                    type: integer
                    description: Request identifier, echoed back from the request.
                  result:
                    type: string
                    description: Contract bytecode at the given address, as a hex string.
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: apikey
      description: >-
        Enter your Etherscan API key, or [set one up](/set-up-your-api-key) if
        you don't have one.

````