Skip to main content
POST
/
finalized-stream
curl --compressed -X POST 'https://portal.sqd.dev/datasets/bitcoin-mainnet/finalized-stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "bitcoin",
    "fromBlock": 880000,
    "toBlock": 880000,
    "fields": {
      "block": {
        "number": true,
        "timestamp": true
      },
      "input": {
        "transactionIndex": true,
        "inputIndex": true,
        "txid": true,
        "vout": true,
        "prevoutValue": true,
        "prevoutScriptPubKeyType": true,
        "prevoutScriptPubKeyAddress": true
      }
    },
    "inputs": [{
      "prevoutScriptPubKeyType": ["witness_v1_taproot"]
    }]
  }'
[
  {
    "header": {
      "number": 123,
      "hash": "<string>",
      "parentHash": "<string>",
      "timestamp": 123,
      "medianTime": 123,
      "version": 123,
      "merkleRoot": "<string>",
      "nonce": 123,
      "target": "<string>",
      "bits": "<string>",
      "difficulty": 123,
      "chainWork": "<string>",
      "strippedSize": 123,
      "size": 123,
      "weight": 123
    },
    "transactions": [
      {
        "transactionIndex": 123,
        "hex": "<string>",
        "txid": "<string>",
        "hash": "<string>",
        "size": 123,
        "vsize": 123,
        "weight": 123,
        "version": 123,
        "locktime": 123
      }
    ],
    "inputs": [
      {
        "transactionIndex": 123,
        "inputIndex": 123,
        "type": "<string>",
        "txid": "<string>",
        "vout": 123,
        "scriptSigHex": "<string>",
        "scriptSigAsm": "<string>",
        "sequence": 123,
        "coinbase": "<string>",
        "txInWitness": [
          "<string>"
        ],
        "prevoutGenerated": true,
        "prevoutHeight": 123,
        "prevoutValue": 123,
        "prevoutScriptPubKeyHex": "<string>",
        "prevoutScriptPubKeyAsm": "<string>",
        "prevoutScriptPubKeyDesc": "<string>",
        "prevoutScriptPubKeyType": "<string>",
        "prevoutScriptPubKeyAddress": "<string>"
      }
    ],
    "outputs": [
      {
        "transactionIndex": 123,
        "outputIndex": 123,
        "value": 123,
        "scriptPubKeyHex": "<string>",
        "scriptPubKeyAsm": "<string>",
        "scriptPubKeyDesc": "<string>",
        "scriptPubKeyType": "<string>",
        "scriptPubKeyAddress": "<string>"
      }
    ]
  }
]

Body

application/json

Data query to filter and retrieve blocks

fromBlock
integer<int64>
default:880000
required

The number of the first block to fetch. If unsure how far into the past this can go consult /metadata

type
enum<string>
default:bitcoin
Available options:
bitcoin
toBlock
integer<int64>
default:880000

The number of the last block to fetch (inclusive)

parentBlockHash
string

Expected hash of the parent of the first requested block

includeAllBlocks
boolean
default:true

If true, includes blocks with no matching data

fields
object

Field selector. See the HTTP 200 response description for details on fields that aren't self-explanatory

transactions
object[]

Transaction data requests. An empty object matches all transactions

inputs
object[]

Input data requests. Filter by prevout address, type, or coinbase status

outputs
object[]

Output data requests. Filter by address or script type

Response

A stream of finalized blocks in JSON lines format, optionally gzipped. Never returns blocks above the finalized head.

header
object
required
transactions
object[]
inputs
object[]
outputs
object[]