BTC-testnet Blockbook WSS

Get Info

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"2","method":"getInfo","params":{}}	

Response: 200

{
    "id": "2",
    "data": {
        "name": "Bitcoin",
        "shortcut": "BTC",
        "decimals": 8,
        "version": "devel",
        "bestHeight": 2585865,
        "bestHash": "000000000025ed79a9a1663139741d9eb98600bb0090614249fb3ee47a93ef99",
        "block0Hash": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
        "testnet": true,
        "backend": {
            "version": "230000",
            "subversion": "/Satoshi:23.0.0/"
        }
    }
}

Ping

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"3","method":"ping","params":{}}	

Response: 200

{
    "id": "3",
    "data": {}
}

Get block hash

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"4","method":"getBlockHash","params":{"height":100000}}

Response: 200

{
    "id": "4",
    "data": {
        "hash": "00000000009e2958c15ff9290d571bf9459e93b19765c6801ddeccadbb160a1e"
    }
}

Get account info

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{
  "id": "5",
  "method": "getAccountInfo",
  "params": {
    "descriptor": "bc1qrhsext2jjaczc26etu58fry28ycatznn2zv706",
    "details": "basic",
    "tokens": "derived",
    "page": null,
    "pageSize": 10,
    "from": null,
    "to": null,
    "contractFilter": ""
  }
}	

Response: 200

{
    "id": "5",
    "data": {
        "address": "tb1qrhsext2jjaczc26etu58fry28ycatznnqyhd5f",
        "balance": "0",
        "totalReceived": "0",
        "totalSent": "0",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 0
    }
}

Get balance history

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{
  "id": "7",
  "method": "getBalanceHistory",
  "params": {
    "descriptor": "tb1p4nel7wkc34raczk8c4jwk5cf9d47u2284rxn98rsjrs4w3p2sheqvjmfdh",
    "from": null,
    "to": null,
    "currencies": [
      ""
    ],
    "groupBy": null
  }
}

Response: 200

{
    "id": "7",
    "data": [
        {
            "time": 1699966800,
            "txs": 1,
            "received": "546",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1699995600,
            "txs": 2,
            "received": "1092",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1699999200,
            "txs": 1,
            "received": "546",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1700006400,
            "txs": 1,
            "received": "546",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1700013600,
            "txs": 1,
            "received": "546",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1700017200,
            "txs": 1,
            "received": "546",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1700028000,
            "txs": 2,
            "received": "1092",
            "sent": "0",
            "sentToSelf": "0"
        },

Get transaction

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"9","method":"getTransaction","params":{"txid":"74211b11015e3de56399ad4a7881925f6db38c246885caeb01dc265142202153"}}	

Response: 200

{
    "id": "9",
    "data": {
        "txid": "74211b11015e3de56399ad4a7881925f6db38c246885caeb01dc265142202153",
        "version": 2,
        "vin": [
            {
                "sequence": 4294967295,
                "n": 0,
                "isAddress": false,
                "coinbase": "0308752704b0ad16664d65726d61696465722046545721010000007da3220000000000"
            }
        ],
        "vout": [
            {
                "value": "546",
                "n": 0,
                "hex": "5120acf3ff3ad88d47dc0ac7c564eb53092b6bee2947a8cd329c7090e157442a85f2",
                "addresses": [
                    "tb1p4nel7wkc34raczk8c4jwk5cf9d47u2284rxn98rsjrs4w3p2sheqvjmfdh"
                ],
                "isAddress": true
            },
            {
                "value": "2420859",
                "n": 1,
                "hex": "0014c035e789d9efffa10aa92e93f48f29b8cfb224c2",
                "addresses": [
                    "tb1qcq670zweall6zz4f96flfrefhr8myfxz9ll9l2"
                ],
                "isAddress": true
            },
            {
                "value": "0",
                "n": 2,
                "hex": "6a24aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d",
                "addresses": [
                    "OP_RETURN aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d"
                ],
                "isAddress": false
            }
        ],
        "blockHash": "00000000000000087f43aa50232d7ee6c37ed9d398b3aabaed8e9d28e7847f40",
        "blockHeight": 2585864,
        "confirmations": 3,
        "blockTime": 1712762288,
        "size": 243,
        "vsize": 216,
        "value": "2421405",
        "valueIn": "0",
        "fees": "0",
        "hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff230308752704b0ad16664d65726d61696465722046545721010000007da3220000000000ffffffff032202000000000000225120acf3ff3ad88d47dc0ac7c564eb53092b6bee2947a8cd329c7090e157442a85f27bf0240000000000160014c035e789d9efffa10aa92e93f48f29b8cfb224c20000000000000000266a24aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d0120000000000000000000000000000000000000000000000000000000000000000000000000"
    }
}

Get transaction specific

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"10","method":"getTransactionSpecific","params":{"txid":"74211b11015e3de56399ad4a7881925f6db38c246885caeb01dc265142202153"}}	

Response: 200

{
    "id": "10",
    "data": {
        "txid": "74211b11015e3de56399ad4a7881925f6db38c246885caeb01dc265142202153",
        "hash": "d90319a4f5d7b7d7068237f11901c9bb863af75a6869e1cb2d948ccb89182541",
        "version": 2,
        "size": 243,
        "vsize": 216,
        "weight": 864,
        "locktime": 0,
        "vin": [
            {
                "coinbase": "0308752704b0ad16664d65726d61696465722046545721010000007da3220000000000",
                "txinwitness": [
                    "0000000000000000000000000000000000000000000000000000000000000000"
                ],
                "sequence": 4294967295
            }
        ],
        "vout": [
            {
                "value": 0.00000546,
                "n": 0,
                "scriptPubKey": {
                    "asm": "1 acf3ff3ad88d47dc0ac7c564eb53092b6bee2947a8cd329c7090e157442a85f2",
                    "desc": "addr(tb1p4nel7wkc34raczk8c4jwk5cf9d47u2284rxn98rsjrs4w3p2sheqvjmfdh)#c5krze20",
                    "hex": "5120acf3ff3ad88d47dc0ac7c564eb53092b6bee2947a8cd329c7090e157442a85f2",
                    "address": "tb1p4nel7wkc34raczk8c4jwk5cf9d47u2284rxn98rsjrs4w3p2sheqvjmfdh",
                    "type": "witness_v1_taproot"
                }
            },
            {
                "value": 0.02420859,
                "n": 1,
                "scriptPubKey": {
                    "asm": "0 c035e789d9efffa10aa92e93f48f29b8cfb224c2",
                    "desc": "addr(tb1qcq670zweall6zz4f96flfrefhr8myfxz9ll9l2)#whefl5al",
                    "hex": "0014c035e789d9efffa10aa92e93f48f29b8cfb224c2",
                    "address": "tb1qcq670zweall6zz4f96flfrefhr8myfxz9ll9l2",
                    "type": "witness_v0_keyhash"
                }
            },
            {
                "value": 0.00000000,
                "n": 2,
                "scriptPubKey": {
                    "asm": "OP_RETURN aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d",
                    "desc": "raw(6a24aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d)#que35mm6",
                    "hex": "6a24aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d",
                    "type": "nulldata"
                }
            }
        ],
        "hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff230308752704b0ad16664d65726d61696465722046545721010000007da3220000000000ffffffff032202000000000000225120acf3ff3ad88d47dc0ac7c564eb53092b6bee2947a8cd329c7090e157442a85f27bf0240000000000160014c035e789d9efffa10aa92e93f48f29b8cfb224c20000000000000000266a24aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d0120000000000000000000000000000000000000000000000000000000000000000000000000",
        "blockhash": "00000000000000087f43aa50232d7ee6c37ed9d398b3aabaed8e9d28e7847f40",
        "confirmations": 3,
        "time": 1712762288,
        "blocktime": 1712762288
    }
}

Estimate fee

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"11","method":"estimateFee","params":{"blocks":[2,5,10,20]}}	

Response: 200

{
    "id": "11",
    "data": [
        {
            "feePerUnit": "1000"
        },
        {
            "feePerUnit": "1000"
        },
        {
            "feePerUnit": "1000"
        },
        {
            "feePerUnit": "1000"
        }
    ]
}

Send transaction

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"1","method":"sendTransaction","params":{"hex":"020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff230308752704b0ad16664d65726d61696465722046545721010000007da3220000000000ffffffff032202000000000000225120acf3ff3ad88d47dc0ac7c564eb53092b6bee2947a8cd329c7090e157442a85f27bf0240000000000160014c035e789d9efffa10aa92e93f48f29b8cfb224c20000000000000000266a24aa21a9ed85c46ba03a20b5b7d439ab169b33bfcce238b735fcccce2ddc6909713c3c6a0d0120000000000000000000000000000000000000000000000000000000000000000000000000"}}		

Response: 200

{
    "id": "1",
    "data": {
        "error": {
            "message": "-27: Transaction already in block chain"
        }
    }
}

Get fiat rates for timestamps

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"13","method":"getFiatRatesForTimestamps","params":{"timestamps":[1575288000,1575550800],"currencies":[""]}}	

Response: 200

{
    "id": "13",
    "data": {
        "tickers": [
            {
                "ts": 1575288000,
                "rates": {}
            },
            {
                "ts": 1575550800,
                "rates": {}
            }
        ]
    }
}

Get fiat rates for tickers list

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"15","method":"getFiatRatesTickersList","params":{"timestamp":1676591569}}

Response: 200

{
    "id": "15",
    "data": {
        "error": {
            "message": "No tickers found for date 2023-02-16 23:52:49 +0000 UTC."
        }
    }
}

Get current fiat rates

wss://btc-testnet.nownodes.ioo/wss/{{api_key}}

Body

{"id":"6","method":"getCurrentFiatRates","params":{"currencies":[""]}}	

Response: 200

{
    "id": "6",
    "data": {
        "error": {
            "message": "No tickers found!"
        }
    }
}

Subscribe new block

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"16","method":"subscribeNewBlock","params":{}}

Response: 200

{
    "id": "17",
    "data": {
        "subscribed": true
    }
}

Unsubscribe new block

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"16","method":"unsubscribeNewBlock","params":{}}	

Response: 200

{
    "id": "16",
    "data": {
        "subscribed": false
    }
}

Subscribe new transaction

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"17","method":"subscribeNewTransaction","params":{}}	

Response: 200

{
    "id": "17",
    "data": {
        "subscribed": true
    }
}

Unsubscribe new transaction

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"17","method":"unsubscribeNewTransaction","params":{}}	

Response: 200

{
    "id": "17",
    "data": {
        "subscribed": false
    }
}

Subscribe address

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"18","method":"subscribeAddresses","params":{"addresses":["bc1qrhsext2jjaczc26etu58fry28ycatznn2zv706","bc1pvan3ka9p3fqln8277hp0m9qts4h7qpcupvz3z2s0v9687tfulcfs9aydm5"]}}	

Response: 200

{
    "id": "18",
    "data": {
        "subscribed": true
    }
}

Unsubscribe address

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"18","method":"unsubscribeAddresses","params":{}}		

Response: 200

{
    "id": "18",
    "data": {
        "subscribed": false
    }
}

Subscribe new fiat rates

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"19","method":"subscribeFiatRates","params":{"currency":"usd"}}		

Response: 200

{
    "id": "19",
    "data": {
        "subscribed": true
    }
}

Unsubscribe new fiat rates

wss://btc-testnet.nownodes.io/wss/{{api_key}}

Body

{"id":"19","method":"unsubscribeFiatRates","params":{}}		

Response: 200

{
    "id": "19",
    "data": {
        "subscribed": false
    }
}

Last updated