From May 19, gateways will require an API key. Read the announcement
curl --compressed -X POST 'https://portal.sqd.dev/datasets/bitcoin-mainnet/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": 880000,
"hash": "00000000000000000000a3b049e5e4e16c539c9a0b3c7d8f1e2a4b6c8d0e1f2a",
"parentHash": "00000000000000000000b4c150f6f5f27d640a0b1c4d8e9f2f3b5c7d9e1f0a3b",
"timestamp": 1738000000
},
"transactions": [],
"inputs": [
{
"transactionIndex": 1,
"inputIndex": 0,
"txid": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
"vout": 0,
"prevoutValue": 50000,
"prevoutScriptPubKeyType": "witness_v1_taproot",
"prevoutScriptPubKeyAddress": "bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297"
},
{
"transactionIndex": 2,
"inputIndex": 0,
"txid": "b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3",
"vout": 1,
"prevoutValue": 125000,
"prevoutScriptPubKeyType": "witness_v1_taproot",
"prevoutScriptPubKeyAddress": "bc1pxyz0987654321abcdefghijklmnopqrstuvwxyz012345678901234"
}
],
"outputs": []
}
]Returns blocks matching the query. May include unfinalized blocks.
curl --compressed -X POST 'https://portal.sqd.dev/datasets/bitcoin-mainnet/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": 880000,
"hash": "00000000000000000000a3b049e5e4e16c539c9a0b3c7d8f1e2a4b6c8d0e1f2a",
"parentHash": "00000000000000000000b4c150f6f5f27d640a0b1c4d8e9f2f3b5c7d9e1f0a3b",
"timestamp": 1738000000
},
"transactions": [],
"inputs": [
{
"transactionIndex": 1,
"inputIndex": 0,
"txid": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
"vout": 0,
"prevoutValue": 50000,
"prevoutScriptPubKeyType": "witness_v1_taproot",
"prevoutScriptPubKeyAddress": "bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297"
},
{
"transactionIndex": 2,
"inputIndex": 0,
"txid": "b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3",
"vout": 1,
"prevoutValue": 125000,
"prevoutScriptPubKeyType": "witness_v1_taproot",
"prevoutScriptPubKeyAddress": "bc1pxyz0987654321abcdefghijklmnopqrstuvwxyz012345678901234"
}
],
"outputs": []
}
]Documentation Index
Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
Use this file to discover all available pages before exploring further.
Data query to filter and retrieve blocks. Request body may be gzipped (Content-Encoding: gzip).
The number of the first block to fetch. If unsure how far into the past this can go consult /metadata
bitcoin The block number to fetch up to (inclusive). Optional; if omitted, streams until dataset height or timeout.
Expected hash of the parent of the first requested block
If true, includes blocks with no matching data
Field selector. See the HTTP 200 response description for details on fields that aren't self-explanatory
Show child attributes
Transaction data requests. An empty object matches all transactions
Show child attributes
Input data requests. Filter by prevout address, type, or coinbase status
Show child attributes
Output data requests. Filter by address or script type
Show child attributes
A stream of blocks in JSON lines format, optionally gzipped. Can be empty if the data query has a bounded range and all blocks in the range have been skipped. May include X-Sqd-Finalized-Head-Number and X-Sqd-Finalized-Head-Hash headers, indicating the latest finalized block that's on the same chain as the returned blocks.
Was this page helpful?