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

# getblockhash | Bitcoin

> The getblockhash method returns the hash of the block at the given height in the blockchain. getblockhash on Bitcoin via Chainstack.

The `getblockhash` method returns the hash of the block at the given height in the blockchain.

## Parameters

* `height` (required) — the height of the block whose hash should be returned

## Response

* `result` — a string representing the hash of the block at the given height
* `error` — an object containing an error message if an error occurred, otherwise `null`
* `id` — an integer representing the ID of the request, used to match requests with responses

## Use case

The `getblockhash` method is useful for retrieving the hash of a block at a specific height in the blockchain. This can be used in conjunction with other methods like `getblock` to retrieve detailed information about a particular block.

For example, a block explorer application might use `getblockhash` to get the hash of the latest block, and then use that hash with `getblock` to retrieve and display the contents of the latest block.


## OpenAPI

````yaml openapi/bitcoin_node_api/getblockhash.json POST /788f110831fe13808302bd79796d55e8
openapi: 3.0.0
info:
  title: getblockhash example
  version: 1.0.0
  description: >-
    This is an API example for getblockhash, a method to retrieve the hash of
    the block at a given height.
servers:
  - url: https://nd-202-842-353.p2pify.com
security: []
paths:
  /788f110831fe13808302bd79796d55e8:
    post:
      tags:
        - Blockchain Operations
      summary: getblockhash
      operationId: getBlockHash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '1.0'
                method:
                  type: string
                  default: getblockhash
                params:
                  type: array
                  items:
                    type: integer
                    description: The block height
                    example: 836491
                  default:
                    - 836491
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The hash of the block at the given height
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    description: The block hash
                  error:
                    type: object
                  id:
                    type: integer

````