getblock | Bitcoin

The getblock method retrieves a block from the blockchain by its hash or height. If the verbosity parameter is omitted, the method returns a serialized block in hex format. If the verbosity parameter is set to 1, the method returns an Object with information about the block. If the verbosity parameter is set to 2, the method returns an Object with information about the block and information about each transaction.

πŸ‘

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • blockhash (required) β€” a string representing the hash of the block to retrieve.
  • verbosity (optional, default=1) β€” an integer specifying the level of detail to include in the response:
    • 0 β€” returns a serialized block in hex format.
    • 1 β€” returns an Object with information about the block.
    • 2 β€” returns an Object with information about the block and information about each transaction.

Response

  • result β€” the requested block data, either as a serialized block in hex format, or as a JSON object with the following fields:
    • hash β€” the block hash.
    • confirmations β€” the number of confirmations.
    • size β€” the block size in bytes.
    • strippedsize β€” the block size excluding witness data.
    • weight β€” the block weight.
    • height β€” the block height or index.
    • version β€” the block version.
    • versionHex β€” the block version formatted in hexadecimal.
    • merkleroot β€” the merkle root.
    • tx β€” the transaction ids (verbosity=1) or full transaction details (verbosity=2).
    • time β€” the block time in seconds since epoch (Jan 1 1970 GMT).
    • mediantime β€” the median block time in seconds since epoch (Jan 1 1970 GMT).
    • nonce β€” the nonce.
    • bits β€” the bits.
    • difficulty β€” the difficulty.
    • chainwork β€” the expected number of hashes required to produce the current chain
Language
Click Try It! to start a request and see the response here!