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
}
}
| Field | Type | Description |
|---|---|---|
type | string | Always "block". |
data.height | integer | Block height. |
data.hash | string | Block hash. |
data.previous_hash | string | Previous block's hash. |
data.num_txs | integer | Number 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
{
"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" }
]
}
]
}
}
data — height, hash, previous_hash, num_txs (as in the summary), plus tx (the transactions).
Transaction (each item of tx)
| Field | Type | Description |
|---|---|---|
block_n | integer | Position of the transaction within the block (0 = coinbase). |
txid | string | Transaction id. |
vin | array | Inputs (see below). |
vout | array | Outputs (see below). |
Input (each item of vin)
| Field | Type | Description |
|---|---|---|
txid | string | Id of the transaction this input belongs to. |
n | integer | Index of this input. |
prev_txid | string | Transaction of the output being spent. All-zero for coinbase. |
prev_n | integer | Output index being spent. |
prev_out | object | null | The output being spent, resolved (fields below). null for coinbase. |
Output (each item of vout, and prev_out)
| Field | Type | Description |
|---|---|---|
txid | string | Transaction that created the output. |
n | integer | Output index within that transaction. |
amount | string | Value in the smallest unit (satoshis), as a string. |