bitcoind.app
CommandsGuidesContact ↗
Home/Blockchain/getblock
Blockchain

getblock

Returns data about a block given its hash. Verbosity controls the detail level.

Parameters

blockhashstringREQUIRED
The block hash to look up
verbositynumberoptional
0 for hex-encoded data, 1 for JSON object, 2 for JSON with full tx data. Default: 1

Returns

objectBlock data (varies by verbosity)

Code Examples

curl --user myuser --data-binary '{"jsonrpc":"1.0","id":"1","method":"getblock","params":["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type:text/plain;' http://127.0.0.1:8332/

Example Response

{
  "hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09",
  "confirmations": 872561,
  "height": 1000,
  "version": 1,
  "nTx": 1,
  "time": 1232346882,
  "nonce": 2595206198,
  "bits": "1d00ffff",
  "difficulty": 1
}
← Previous
getbestblockhash
Next →
getblockchaininfo

More Blockchain Commands

getbestblockhashgetblockchaininfogetblockcountgetblockfiltergetblockhashgetblockheader

bitcoind.app — Bitcoin Core RPC Reference

GuidesContact ↗