POSTgetblock

Bitcoin Mainnethttps://bitcoin-mainnet.nodit.io/

Returns information about the block with the given block hash. The response format depends on the verbosity value.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameters in order:

  1. blockhash: The hash of the block to look up, as a string. (required)
  2. verbosity: The level of detail in the response, as an integer. (optional, default 1)
    • 0: Returns the serialized block as a hex-encoded string.
    • 1: Returns a JSON object with the block data and the list of transaction ids.
    • 2: Returns a JSON object with the block data and the details of each transaction.
    • 3: Same as 2, and additionally includes the prevout data for each transaction input. Available only for unpruned blocks in the current best chain.
params[0]string

The hash of the block to look up.

params[1]integer

The level of detail in the response. 0 returns a hex-encoded string, 1 the list of transaction ids, 2 the transaction details, and 3 the transaction details including the prevout of each input.

Responses
hashstring

The block hash, identical to the value provided in the request.

confirmationsinteger

The number of confirmations, or -1 if the block is not on the main chain.

sizeinteger

The block size, in bytes.

strippedsizeinteger

The block size excluding witness data, in bytes.

weightinteger

The block weight as defined in BIP 141.

heightinteger

The block height.

versioninteger

The block version.

versionHexstring

The block version in hexadecimal.

merklerootstring

The merkle root of the transactions in the block.

txoneOf[]

The list of transactions included in the block. When verbosity is 1, an array of transaction id strings is returned; when 2 or higher, an array of transaction objects is returned. When verbosity is 3, each input additionally includes its prevout data.

Transaction IDstring
object 2object
in_active_chainboolean

Whether the specified block is in the active chain. Returned only when blockhash is provided.

hexstring

The serialized transaction, hex-encoded.

txidstring

The transaction id.

hashstring

The transaction hash. It differs from txid for witness transactions.

sizeinteger

The serialized transaction size, in bytes.

vsizeinteger

The virtual transaction size as defined in BIP 141. It differs from size for witness transactions.

weightinteger

The transaction weight as defined in BIP 141. The value is between vsize * 4 - 3 and vsize * 4.

versioninteger

The transaction version.

locktimeinteger

The lock time that determines when the transaction becomes valid.

vinobject[]

The list of transaction inputs.

coinbasestring

The coinbase value of the input. Returned only for coinbase inputs.

txidstring

The id of the previous transaction referenced by this input. Returned only for non-coinbase inputs.

voutinteger

The output index of the previous transaction referenced by this input. Returned only for non-coinbase inputs.

scriptSigobject

The signature script (scriptSig) that unlocks the output referenced by the input.

asmstring

Disassembly of the script.

hexstring

The script, hex-encoded.

txinwitnessstring[]

The hex-encoded witness data. Returned only for SegWit inputs.

prevoutobject

The previous output spent by this input. It is returned when verbosity is 2 for getrawtransaction or 3 for getblock, and omitted if the block undo data is not available.

generatedboolean

Whether the output was generated by a coinbase transaction.

heightinteger

The height of the block containing the previous output.

valuenumber

The value of the previous output, denominated in BTC.

scriptPubKeyobject

The output script (scriptPubKey) that defines the conditions for spending the output.

asmstring

Disassembly of the script.

descstring

Inferred descriptor for the script.

hexstring

The raw script bytes, hex-encoded.

addressstring

The Bitcoin address for the script. Returned only when a well-defined address exists.

typestring

The output type.

  • nonstandard: A script that does not match any standard type.
  • anchor: A Pay-to-Anchor (P2A) output.
  • pubkey: An output locked directly by a public key (P2PK).
  • pubkeyhash: An output locked by a public key hash (P2PKH).
  • scripthash: An output locked by a script hash (P2SH).
  • multisig: An output that requires multiple signatures.
  • nulldata: An output that only records data via OP_RETURN.
  • witness_v0_keyhash: A SegWit v0 public key hash output (P2WPKH).
  • witness_v0_scripthash: A SegWit v0 script hash output (P2WSH).
  • witness_v1_taproot: A Taproot output (P2TR).
  • witness_unknown: An output with an unknown witness version.

예: witness_v0_keyhash

sequenceinteger

The script sequence number of the input.

예: 4294967295

voutobject[]

The list of transaction outputs.

valuenumber

The value of the output, denominated in BTC.

예: 0.0125

ninteger

The index of the output within the transaction.

예: 0

scriptPubKeyobject

The output script (scriptPubKey) that defines the conditions for spending the output.

asmstring

Disassembly of the script.

descstring

Inferred descriptor for the script.

hexstring

The raw script bytes, hex-encoded.

addressstring

The Bitcoin address for the script. Returned only when a well-defined address exists.

typestring

The output type.

  • nonstandard: A script that does not match any standard type.
  • anchor: A Pay-to-Anchor (P2A) output.
  • pubkey: An output locked directly by a public key (P2PK).
  • pubkeyhash: An output locked by a public key hash (P2PKH).
  • scripthash: An output locked by a script hash (P2SH).
  • multisig: An output that requires multiple signatures.
  • nulldata: An output that only records data via OP_RETURN.
  • witness_v0_keyhash: A SegWit v0 public key hash output (P2WPKH).
  • witness_v0_scripthash: A SegWit v0 script hash output (P2WSH).
  • witness_v1_taproot: A Taproot output (P2TR).
  • witness_unknown: An output with an unknown witness version.

예: witness_v0_keyhash

feenumber

The transaction fee, denominated in BTC. Returned when verbosity is 2, and omitted if the block undo data is not available.

blockhashstring

The hash of the block containing the transaction.

confirmationsinteger

The number of confirmations of the transaction.

blocktimeinteger

The time of the block containing the transaction, expressed in UNIX epoch time.

timeinteger

Same as blocktime.

timeinteger

The block time expressed in UNIX epoch time.

mediantimeinteger

The median time of the preceding 11 blocks, expressed in UNIX epoch time.

nonceinteger

The nonce used for proof of work.

bitsstring

nBits, the compact representation of the block difficulty target.

targetstring

The difficulty target, in hexadecimal.

difficultynumber

The difficulty of the block.

chainworkstring

The expected number of hashes required to produce the chain up to this block, in hexadecimal.

nTxinteger

The number of transactions in the block.

previousblockhashstring

The hash of the previous block.

nextblockhashstring

The hash of the next block.

X-API-KEY
RequestCU25
cURL
curl -X POST "https://bitcoin-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "getblock",
  "params": [
    "000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d",
    1
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "hash": "000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d",
    "confirmations": 100001,
    "size": 1638745,
    "strippedsize": 812345,
    "weight": 3993780,
    "height": 820000,
    "version": 671088640,
    "versionHex": "28000000",
    "merkleroot": "1a8b0e3d5f9c2b7a4e6d8f1c3b5a7968574635241302f1e0d9c8b7a695847362",
    "tx": [
      "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
      "9b0fc92260312ce44e74ef369f5c66bbb85848f2eddd5a7a1cde251e54ccfdd5"
    ],
    "time": 1701388800,
    "mediantime": 1701386400,
    "nonce": 3216549870,
    "bits": "17038a4f",
    "target": "000000000000000000038a4f0000000000000000000000000000000000000000",
    "difficulty": 67957790298897.88,
    "chainwork": "00000000000000000000000000000000000000005f6bb1e6d0d1a3d5f6a5b8c1",
    "nTx": 3421,
    "previousblockhash": "00000000000000000002a7c4de1f5f9b5a3f8e2d7c6b5a4938271605f4e3d2c1",
    "nextblockhash": "0000000000000000000341b9c2d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0"
  }
}