Skip to main content

New blocks — blocks

Subscribe to the blocks channel to receive an event for every new block. By default you get a compact summary; add full: true to receive the entire block instead. No address required.

{ "action": "subscribe", "channel": "blocks" }
{ "action": "subscribe", "channel": "blocks", "full": true }

block — summary

{
"type": "block",
"data": {
"height": 840002,
"hash": "0000...abc",
"previous_hash": "0000...def",
"num_txs": 2841
}
}
FieldTypeDescription
typestringAlways "block".
data.heightintegerBlock height.
data.hashstringBlock hash.
data.previous_hashstringPrevious block's hash.
data.num_txsintegerNumber of transactions in the block.

block_full — full block (full: true)

With full: true you receive the entire block: every transaction, every input with the output it spends already resolved, and every output.

High volume

The full block carries every transaction in the block. Subscribe with full: true only if you genuinely need them all — to follow a specific address use balance or history instead.

{
"type": "block_full",
"data": {
"height": 840002,
"hash": "0000...abc",
"previous_hash": "0000...def",
"num_txs": 2841,
"tx": [
{
"block_n": 0,
"txid": "e3b0c4...",
"vin": [
{ "txid": "e3b0c4...", "n": 0, "prev_txid": "0000...0000", "prev_n": 0, "prev_out": null }
],
"vout": [
{ "txid": "e3b0c4...", "n": 0, "amount": "625000000" }
]
},
{
"block_n": 1,
"txid": "4a5e1e...",
"vin": [
{
"txid": "4a5e1e...",
"n": 0,
"prev_txid": "1f3c2b...",
"prev_n": 2,
"prev_out": { "txid": "1f3c2b...", "n": 2, "amount": "70000" }
}
],
"vout": [
{ "txid": "4a5e1e...", "n": 0, "amount": "50000" },
{ "txid": "4a5e1e...", "n": 1, "amount": "19000" }
]
}
]
}
}

dataheight, hash, previous_hash, num_txs (as in the summary), plus tx (the transactions).

Transaction (each item of tx)

FieldTypeDescription
block_nintegerPosition of the transaction within the block (0 = coinbase).
txidstringTransaction id.
vinarrayInputs (see below).
voutarrayOutputs (see below).

Input (each item of vin)

FieldTypeDescription
txidstringId of the transaction this input belongs to.
nintegerIndex of this input.
prev_txidstringTransaction of the output being spent. All-zero for coinbase.
prev_nintegerOutput index being spent.
prev_outobject | nullThe output being spent, resolved (fields below). null for coinbase.

Output (each item of vout, and prev_out)

FieldTypeDescription
txidstringTransaction that created the output.
nintegerOutput index within that transaction.
amountstringValue in the smallest unit (satoshis), as a string.