Transaction
Get by Transaction Hash
This endpoint retrieves the transaction details for a given transaction ID.
HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<txid>
Example Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96"
Example Response
{
"txid": "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
"hash": "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
"version": 1,
"size": 113,
"locktime": 0,
"vin": [{
"coinbase": "03d7c6082f7376706f6f6c2e636f6d2f3edff034600055b8467f0040",
"txid": "",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}],
"vout": [{
"value": 12.5000042,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 492558fb8ca71a3591316d095afc0f20ef7d42f7 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": ["17fm4xevwDh3XRHv9UoqYrVgPMbwcGHsUs"],
"isTruncated": false
}
}],
"blockhash": "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3",
"confirmations": 329877,
"time": 1553501874,
"blocktime": 1553501874,
"blockheight": 575191
}
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
txid
Transaction ID.
Get by Transaction Index (BSV-only)
This endpoint retrieves the transaction details for a given block height and transaction index in that block. Works only for confirmed transactions.
GET https://api.whatsonchain.com/v1/bsv/main/block/height/<height>/txindex/<txindex>
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/height/892006/txindex/32891"
{
"txid": "522804f8b0c19cb51bd3c7d14a64b472bb9797f292393f1abd9d32b9a2946495",
"hash": "522804f8b0c19cb51bd3c7d14a64b472bb9797f292393f1abd9d32b9a2946495",
"version": 1,
"size": 410,
"locktime": 0,
"vin": [{
"coinbase": "",
"txid": "bc5c9aba8003aa0c0ccb64f077310bb945796f8b3aec6648672ddfa8eee1d7eb",
"vout": 0,
"scriptSig": {
"asm": "3045022100fee85b93b63e313950a3c100fb022e8c9990a7104032e7f678a4e36f791c52bd022001c6c022c03db168848a49a95de126cebd5160d4ac4a78277e08795a613cfafe[ALL|FORKID] 0326c692c95e73175795109d2fc90e852e7d725aa25d3d1b783d8c924d3c2be872",
"hex": "483045022100fee85b93b63e313950a3c100fb022e8c9990a7104032e7f678a4e36f791c52bd022001c6c022c03db168848a49a95de126cebd5160d4ac4a78277e08795a613cfafe41210326c692c95e73175795109d2fc90e852e7d725aa25d3d1b783d8c924d3c2be872"
},
"sequence": 4294967295
}, {
"coinbase": "",
"txid": "652d1235d1266d7ccdad981ade1b0169a6d8fdd690d3bac1e17e366935613dd4",
"vout": 2,
"scriptSig": {
"asm": "3045022100a71a7d18cd7c4d441a215a2bb2bfb00a87af17a9ae65a1434dac6c943a5d95ba02203329d2d667175d33f3f097975a5aa0309b43c58f470448a25ed22342616642b7[ALL|FORKID] 0326c692c95e73175795109d2fc90e852e7d725aa25d3d1b783d8c924d3c2be872",
"hex": "483045022100a71a7d18cd7c4d441a215a2bb2bfb00a87af17a9ae65a1434dac6c943a5d95ba02203329d2d667175d33f3f097975a5aa0309b43c58f470448a25ed22342616642b741210326c692c95e73175795109d2fc90e852e7d725aa25d3d1b783d8c924d3c2be872"
},
"sequence": 4294967295
}],
"vout": [{
"value": 0,
"n": 0,
"scriptPubKey": {
"asm": "OP_RETURN 6478732e617070 703a313539363436302c6d617267696e",
"hex": "6a076478732e61707010703a313539363436302c6d617267696e",
"type": "nulldata",
"opReturn": {
"type": "dxs",
"action": "",
"text": "",
"parts": ["\u0007dxs.app\u0010p:1596460,margin"]
},
"isTruncated": false
}
},
...
],
"blockhash": "00000000000000000c20becd473e985688ff2fcb2b234165acb11fbf1024c2bb",
"confirmations": 13062,
"time": 1744376748,
"blocktime": 1744376748,
"blockheight": 892006
}
URL Parameters
network
Selected network: main
or test
.
height
Specified block height.
txindex
Index of the transaction in the associated block.
Get Transaction Propagation Status (BSV-only)
This endpoint returns the propagation status for a given transaction. It queries a random set of peers on the network and returns the number of peers that have the transaction in question.
This is an expensive call, so it's recommended only for critical or high-value transactions that might require checking the network propagation status. It is rate-limited to 10 requests per 10 seconds.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<txid>/propagation
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/hash/<txid>/propagation"
{
"queried_peers": 16,
"found_on_peers": 16
}
URL Parameters
network
The selected network: main
or test
.
txid
Transaction ID.
Broadcast Transaction (BSV-only)
You can broadcast a transaction to the BSV network using this endpoint. Returns the txid
in the response or an error message from the node, with header content-type: text/plain
.
Keep in mind that this endpoint is meant for small-scale usage. For commercial or enterprise usage, please take a look at ARC Endpoints, which are built for those types of use cases.
POST https://api.whatsonchain.com/v1/bsv/<network>/tx/raw
{
"txhex": "<txhex>"
}
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/tx/raw" \
--header "Content-Type: application/json" \
--data "{\"txhex\": \"<txhex>\" }"
URL Parameters
network
Selected network: main
or test
.
Request Parameters
txhex
Raw transaction data in hex.
Bulk Transaction Details
You can fetch details for multiple transactions in a single request.
POST https://api.whatsonchain.com/v1/<chain>/<network>/txs
{
"txids": [
"<txid>",
"<txid>",
...
]
}
Example Request
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
Example Response
[{
"txid": "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"hash": "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"version": 1,
"size": 1044,
"locktime": 0,
"vin": [{
"coinbase": "",
"txid": "57a79dbc0be8225f4d9dc705a91096e60d3da8f3a7fdf009715dc28975a8dbb8",
"vout": 0,
"scriptSig": {
"asm": "304402206b9956a6dd39d7f081f6a2d3731b2b7c875ec563743d7620ea55b37f3c2d1ffd02202594d52b6df818d100a3e721b0d245625cbe200e51a7a846fd37436607e08a0a[ALL|FORKID] 03998489e31affb06deaa6890deea42447ac9b4b31c5fc93d023525de9f850b281",
"hex": "47304402206b9956a6dd39d7f081f6a2d3731b2b7c875ec563743d7620ea55b37f3c2d1ffd02202594d52b6df818d100a3e721b0d245625cbe200e51a7a846fd37436607e08a0a412103998489e31affb06deaa6890deea42447ac9b4b31c5fc93d023525de9f850b281"
},
"sequence": 4294967295
}],
"vout": [{
"value": 0,
"n": 0,
"scriptPubKey": {
"asm": "OP_RETURN 6761746c696e6720626974636f696e626c6f636b732e6c697665",
"hex": "6a1a6761746c696e6720626974636f696e626c6f636b732e6c697665",
"type": "nulldata",
"opReturn": {
"type": "OP_RETURN",
"action": "",
"text": "",
"parts": null
},
"isTruncated": false
}
}, {
"value": 0.000013,
"n": 1,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 8432682cb8f5cbbb36913266fbe84176a999ac99 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9148432682cb8f5cbbb36913266fbe84176a999ac9988ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": ["1D3zaf652ajAPZVC1CrKgMQjesaPuLwcSW"],
"isTruncated": false
}
},
...
],
"blockhash": "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5",
"confirmations": 292813,
"time": 1575841517,
"blocktime": 1575841517,
"blockheight": 612251
}, {
"txid": "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258",
"hash": "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258",
"version": 1,
"size": 118,
"locktime": 0,
"vin": [{
"coinbase": "033f6b092f636f696e6765656b2e636f6d2f7759319af9d4f815e3a2fae5e60000",
"txid": "",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}],
"vout": [{
"value": 12.5133703,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 8460e9a972a8600766a1b38fac4a2cfb8692d3ad OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9148460e9a972a8600766a1b38fac4a2cfb8692d3ad88ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": ["1D4xHwLxA8E9vU87N1ELHtPEZdKeLhywY1"],
"isTruncated": false
}
}],
"blockhash": "000000000000000002e8d4b4c0385abd195709c82f16d9917f081b70000e8804",
"confirmations": 287785,
"time": 1578837295,
"blocktime": 1578837295,
"blockheight": 617279
}]
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
Bulk Transaction Status
You can get the status of multiple transactions in a single request.
POST https://api.whatsonchain.com/v1/<chain>/<network>/txs/status
{
"txids": [
"<txid>",
"<txid>",
...
]
}
Example Request
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs/status" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
Example Response
[{
"txid": "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"blockhash": "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5",
"blockheight": 612251,
"blocktime": 1575841517,
"confirmations": 292814
}, {
"txid": "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258",
"blockhash": "000000000000000002e8d4b4c0385abd195709c82f16d9917f081b70000e8804",
"blockheight": 617279,
"blocktime": 1578837295,
"confirmations": 287786
}]
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
Decode Transaction
You can decode a raw transaction using this endpoint. Returns a json
in response or an error message from the node.
POST https://api.whatsonchain.com/v1/bsv/<network>/tx/decode
{
"txhex": "<txhex>"
}
Example Request
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/tx/decode" \
--header "Content-Type: application/json" \
--data "{\"txhex\": \"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1c03fc3b092f7376706f6f6c2e636f6d2f49a4a636f07dad7dc7c30100ffffffff01eb4aa54a0000000017a9141314c7eace4d4da3f65a1341197bb58038aa9dbc8700000000\" }"
Example Response
{
"txid": "c203094f5bacd5d5dcabb997adab1923b3ec9b91667ff230cac51504e34a382d",
"hash": "c203094f5bacd5d5dcabb997adab1923b3ec9b91667ff230cac51504e34a382d",
"version": 1,
"size": 111,
"locktime": 0,
"vin": [{
"coinbase": "03fc3b092f7376706f6f6c2e636f6d2f49a4a636f07dad7dc7c30100",
"sequence": 4294967295
}],
"vout": [{
"value": 12.52346603,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 1314c7eace4d4da3f65a1341197bb58038aa9dbc OP_EQUAL",
"hex": "a9141314c7eace4d4da3f65a1341197bb58038aa9dbc87",
"reqSigs": 1,
"type": "scripthash",
"addresses": ["33Ruf5AZhSPHSCGbYiuu3xG5V3HvoNFfby"]
}
}],
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1c03fc3b092f7376706f6f6c2e636f6d2f49a4a636f07dad7dc7c30100ffffffff01eb4aa54a0000000017a9141314c7eace4d4da3f65a1341197bb58038aa9dbc8700000000"
}
URL Parameters
network
Selected network: main
or test
.
Request Parameters
txhex
Raw transaction data in hex.
Get a Transaction as Binary
This endpoint returns the transaction as a binary file for a given txid
.
GET https://api.whatsonchain.com/v1/<chain>/<network>/tx/<txid>/bin
Example Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/bin"
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
txid
Transaction ID.
Get Raw Transaction Data
This endpoint returns the raw hex of a transaction for a given txid
.
GET https://api.whatsonchain.com/v1/<chain>/<network>/tx/<txid>/hex
Example Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/hex"
Example Response
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1c03d7c6082f7376706f6f6c2e636f6d2f3edff034600055b8467f0040ffffffff01247e814a000000001976a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac00000000
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
txid
Transaction ID.
Bulk Raw Transaction Data
You can get the raw data of multiple transactions in hex in a single request.
POST https://api.whatsonchain.com/v1/<chain>/<network>/txs/hex
{
"txids": [
"<txid>",
"<txid>",
...
]
}
Example Request
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs/hex" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
Example Response
[{
"txid": "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"hex": "0100000001b8dba87589c25d7109f0fda7f3a83d0de69610a905c79d4d5f22e80bbc9da757000000006a47304402206b9956a6dd39d7f081f6a2d3731b2b7c875ec563743d7620ea55b37f3c2d1ffd02202594d52b6df818d100a3e721b0d245625cbe200e51a7a846fd37436607e08a0a412103998489e31affb06deaa6890deea42447ac9b4b31c5fc93d023525de9f850b281ffffffff1a00000000000000001c6a1a6761746c696e6720626974636f696e626c6f636b732e6c69766514050000000000001976a9148432682cb8f5cbbb36913266fbe84176a999ac9988ac14050000000000001976a914f6b68ada06df7323aca315ec54aa251e806c516888ac14050000000000001976a914d47ab37ea2bcffe4a7bf98086a65d489acdf2fd688ac14050000000000001976a914a20568923f3c65f91c0d7a3be3ca4f8b14c7d04888ac14050000000000001976a9140e80337d887c653d2bd7228281aa7ecf4bf2c9dc88ac14050000000000001976a9147bc3cebb1dc5ee6356931add1f5f1196fce7b53188ac14050000000000001976a914a8854465a2bbefeb1d47c5c79b8aef737d62f06f88ac14050000000000001976a9146c376c6d05ff152e1537667cfb52e628547f620a88ac14050000000000001976a9147c0bd6447ac246f100fec9392a396191a06fcae288ac14050000000000001976a9145221bd8f6901612cb1bf0618a39823229233474988ac14050000000000001976a91432c248707616cd030a3f346aec13c9d5ae8d99b088ac14050000000000001976a914c31eaefc851f6de4830f51d649e1731706159dc888ac14050000000000001976a9143d980ead104586cba895d944280f93ca8323b47588ac14050000000000001976a91473721ce4189c5b996819f81f8cce7366a1bb780488ac14050000000000001976a9141fd249a4cac1a2c95b95ad8ecbbe23129831232e88ac14050000000000001976a914ae4661a1c0f8192e79b5c304cadd39470077c8a488ac14050000000000001976a914e99c1003b189bfe7ababb7cbe2e39b8eb2317ccf88ac14050000000000001976a914e26673b87c7e644688b0a62f1e2cd5e7cc4db63c88ac14050000000000001976a9145cce10f43fa0458b2f8c3982a9349e7a67e6736588ac14050000000000001976a9144f062ff6e6921a8b6f43c79fc0e89f582a22225388ac14050000000000001976a9146dacfcede9e86678de202cb30d17bd1eb656cec388ac14050000000000001976a914fcdaf0d9fd36b2c1dbfa90e659a373290795230b88ac14050000000000001976a91482f1a346d023fd8e5eb976bba6df7e6a2095003288ac14050000000000001976a9142f82e5b519a351b646d23ceed7d43bd53213209488ac14050000000000001976a9143d0e5368bdadddca108a0fe44739919274c726c788ac00000000",
"blockhash": "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5",
"blockheight": 612251,
"blocktime": 1575841517,
"confirmations": 292817
}, {
"txid": "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258",
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff21033f6b092f636f696e6765656b2e636f6d2f7759319af9d4f815e3a2fae5e60000ffffffff0146e3954a000000001976a9148460e9a972a8600766a1b38fac4a2cfb8692d3ad88ac00000000",
"blockhash": "000000000000000002e8d4b4c0385abd195709c82f16d9917f081b70000e8804",
"blockheight": 617279,
"blocktime": 1578837295,
"confirmations": 287789
}]
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
Get Raw Transaction Output Data
This endpoint returns raw hex of the transaction output for a given transaction ID and output index.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<txid>/out/<index>/hex
Example Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/out/0/hex"
Example Response
76a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
txid
Transaction ID.
index
Output / Vout index.
Bulk Raw Transaction Output Data
This endpoint returns raw hex of the transaction output for a list of up to 40 transaction IDs and up to 40 output indexes per transaction.
POST https://api.whatsonchain.com/v1/<chain>/<network>/txs/vouts/hex
{
"txids": [{
"txid": "<txid>",
"vouts": [<vout>,<vout>, ...]
},{
"txid": "<txid>",
"vouts": [<vout>,<vout>, ...]
},
...
]
}
Example Request
curl --location --request POST 'https://api.whatsonchain.com/v1/bsv/main/txs/vouts/hex' \
--header 'Content-Type: application/json' \
--data-raw '{
"txids": [
{
"txid": "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f",
"vouts": [
0,
1
]
}
]
}'
Example Response
[{
"txid": "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f",
"vout": {
"0": {
"scriptPubKey": {
"hex": "76a9146b7f6a5d5677d1f3635e589b2eacc75d08dc6c4588ac"
}
},
"1": {
"scriptPubKey": {
"hex": "006a036478733575453364693965487a6e6b47666865696d6863636434673d3d2c6d392c74622c613738362e39332c6535363430302c7332382e333704746578740142"
}
}
}
}]
URL Parameters
chain
Desired blockchain: bsv
or btc
.
network
Selected network: main
or test
.
Errors
unknown
for that txId
If a given txId is unknown.
(Ignored)
If a given output is unknown.
Get Merkle Proof in TSC (BSV-only)
This endpoint returns the Merkle root of the branch for a confirmed transaction, in the TSC format.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<txid>/proof/tsc
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/proof/tsc"
[{
"index": 0,
"txOrId": "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
"target": "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3",
"nodes": ["7e0ba1980522125f1f40d19a249ab3ae036001b991776813d25aebe08e8b8a50", "1e3a5a8946e0caf07006f6c4f76773d7e474d4f240a276844f866bd09820adb3"]
}]
URL Parameters
network
Selected network: main
or test
.
txid
Transaction ID.
Last updated
Was this helpful?