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

# starknet_getClassHashAt | Starknet

> Starknet API method that returns the hash of the class at a given address. It provides the hash of the class at the specified address.

<Note>
  **Starknet OpenRPC spec**

  For the latest version of the publicly maintained OpenRPC spec, see the [Starknet specs GitHub repo](https://github.com/starkware-libs/starknet-specs).
</Note>

Starknet API method that returns the hash of the class at a given address.

It provides the hash of the class at the specified address. This can be useful for verifying the type of contract deployed at a given address.

## Parameters

* `address` — the address of the contract.
* `block_id` — the hash of the requested block, or number (height) of the requested block, or a block tag:

  * `latest` — the most recent block in the blockchain and the current state of the blockchain at the most recent block. A chain reorganization is to be expected.
  * `safe` — the block that received justification from the beacon chain. Although this block could be involved in a chain reorganization, it would necessitate either a coordinated attack by the majority of validators or an instance of severe propagation latency.
  * `finalized` — the block accepted as canonical by more than 2/3 of the validators. A chain reorganization is extremely unlikely, and it would require at least 1/3 of the staked ETH to be burned.
  * `earliest` — the earliest available or genesis block
  * `pending` — the pending state and transactions block. The current state of transactions that have been broadcast to the network but have not yet been included in a block.

## Response

* `result` — the hash of the class at the given address, represented as a hexadecimal string.

## Use case

A practical use case for `starknet_getClassHashAt` is to verify the type of contract deployed at a given address. This can be useful for developers to ensure that the correct contract has been deployed at the expected address.

## Deprecated feeder gateway method

The feeder gateway was deprecated on [December 11, 2023](https://community.starknet.io/t/feeder-gateway-deprecation/100233).

Example of the call you had to make to the feeder gateway before the deprecation:

```Text Shell theme={"system"}
curl 'https://alpha-mainnet.starknet.io/feeder_gateway/get_class_hash_at?contractAddress=0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82'
```


## OpenAPI

````yaml openapi/starknet_node_api/starknet_getClassHashAt.json POST /365cf697a3ad6d950b4c4a911e2e4f4d
openapi: 3.0.0
info:
  title: starknet
  version: 1.0.0
  contact: {}
servers:
  - url: https://starknet-mainnet.core.chainstack.com
security: []
paths:
  /365cf697a3ad6d950b4c4a911e2e4f4d:
    post:
      summary: starknet_getClassHashAt
      description: starknet_getClassHashAt
      operationId: starknetGetClassHashAt
      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: starknet_getClassHashAt
                params:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          block_number:
                            type: integer
                            default: 385940
                      - type: string
                        default: >-
                          0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82
              default:
                id: 1
                jsonrpc: '2.0'
                method: starknet_getClassHashAt
                params:
                  - block_number: 385940
                  - >-
                    0x073314940630fd6dcda0d772d4c972c4e0a9946bef9dabf4ef84eda8ef542b82
      responses:
        '200':
          description: Successful response

````