> ## 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/bitcoin-getblockstats",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# getblockstats | Bitcoin

The `getblockstats` method computes per block statistics based on the specified block hash and the array of stats to include. It returns an object containing various statistics for the specified block.

<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

* `blockhash` (required) — the hash of the block for which statistics are to be computed.
* `stats` (optional) — an array of statistics to include in the response. Possible values include:
  * `avgfee`
  * `avgfeerate`
  * `avgtxsize`
  * `blockhash`
  * `feerate_percentiles`
  * `height`
  * `ins`
  * `maxfee`
  * `maxfeerate`
  * `maxtxsize`
  * `medianfee`
  * `mediantime`
  * `mediantxsize`
  * `minfee`
  * `minfeerate`
  * `mintxsize`
  * `outs`
  * `subsidy`
  * `swtotal_size`
  * `swtotal_weight`
  * `swtxs`
  * `time`
  * `total_out`
  * `total_size`
  * `total_weight`
  * `totalfee`
  * `txs`
  * `utxo_increase`
  * `utxo_size_inc`

## Response

* `result` — an object containing the computed block statistics based on the specified parameters.
* `error` — an object containing an error message if an error occurred.
* `id` — an integer representing the ID of the request, used to match requests with responses.

## Use case

The `getblockstats` method is useful for analyzing and extracting detailed statistics about individual blocks in the blockchain. These statistics can provide valuable insights into block characteristics and transaction data, aiding in blockchain analysis and monitoring.


## OpenAPI

````yaml /openapi/bitcoin_node_api/getblockstats.json POST /788f110831fe13808302bd79796d55e8
openapi: 3.0.0
info:
  title: getblockstats example
  version: 1.0.0
  description: >-
    This is an API example for getblockstats, a method to compute per block
    statistics.
servers:
  - url: https://nd-202-842-353.p2pify.com
security: []
paths:
  /788f110831fe13808302bd79796d55e8:
    post:
      tags:
        - Blockchain Operations
      summary: getblockstats
      operationId: getBlockStats
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '1.0'
                method:
                  type: string
                  default: getblockstats
                params:
                  type: array
                  items:
                    oneOf:
                      - type: string
                        description: The block hash
                        example: >-
                          00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50
                      - type: array
                        description: An array of stats to include
                        items:
                          type: string
                          enum:
                            - avgfee
                            - avgfeerate
                            - avgtxsize
                            - blockhash
                            - feerate_percentiles
                            - height
                            - ins
                            - maxfee
                            - maxfeerate
                            - maxtxsize
                            - medianfee
                            - mediantime
                            - mediantxsize
                            - minfee
                            - minfeerate
                            - mintxsize
                            - outs
                            - subsidy
                            - swtotal_size
                            - swtotal_weight
                            - swtxs
                            - time
                            - total_out
                            - total_size
                            - total_weight
                            - totalfee
                            - txs
                            - utxo_increase
                            - utxo_size_inc
                        default:
                          - avgfee
                          - avgfeerate
                          - avgtxsize
                          - blockhash
                          - feerate_percentiles
                          - height
                          - ins
                          - maxfee
                          - maxfeerate
                          - maxtxsize
                          - medianfee
                          - mediantime
                          - mediantxsize
                          - minfee
                          - minfeerate
                          - mintxsize
                          - outs
                          - subsidy
                          - swtotal_size
                          - swtotal_weight
                          - swtxs
                          - time
                          - total_out
                          - total_size
                          - total_weight
                          - totalfee
                          - txs
                          - utxo_increase
                          - utxo_size_inc
                  default:
                    - >-
                      00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50
                    - - avgfee
                      - avgfeerate
                      - avgtxsize
                      - blockhash
                      - feerate_percentiles
                      - height
                      - ins
                      - maxfee
                      - maxfeerate
                      - maxtxsize
                      - medianfee
                      - mediantime
                      - mediantxsize
                      - minfee
                      - minfeerate
                      - mintxsize
                      - outs
                      - subsidy
                      - swtotal_size
                      - swtotal_weight
                      - swtxs
                      - time
                      - total_out
                      - total_size
                      - total_weight
                      - totalfee
                      - txs
                      - utxo_increase
                      - utxo_size_inc
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The requested block statistics
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    description: An object containing the block statistics
                  error:
                    type: object
                  id:
                    type: integer

````