Transaction
Get by Tx Hash
This endpoint retrieves the transaction details for a given transaction hash.
In the response body, if any output's hex size (vout[x].scriptPubKey.hex) exceeds 100KB, then the data for vout[x].scriptPubKey.hex and vout[x].scriptPubKey.asm is truncated and a flag vout[x].scriptPubKey.isTruncated is set to true.
For unconfirmed transactions, block and confirmations info won't be returned, as it doesn't exist.
A separate endpoint Get Raw Transaction Output Data can be used to fetch the full hex data, if required by the client application.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/hash/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96"
{
"txid": "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
"hash": "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
"size": 113,
"version": 1,
"locktime": 0,
"vin": [
{
"txid": "",
"vout": 0,
"scriptSig": {
"asm": "... ",
"hex": "..."
},
"sequence": 4294967295,
"coinbase": "03d7c6082f7376706f6f6c2e636f6d2f3edff034600055b8467f0040"
}
],
"vout": [
{
"value": 12.5000042,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 492558fb8ca71a3591316d095afc0f20ef7d42f7 OP_EQUALVERIFY OP_CHECKSIG", // (max 100 KB)
"hex": "76a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac", // (max 100 KB)
"reqSigs": 1,
"type": 0,
"addresses": ["17fm4xevwDh3XRHv9UoqYrVgPMbwcGHsUs"],
"opReturn": null,
"isTruncated": false
}
}
],
"blockhash": "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3",
"confirmations": 2,
"time": 1553501874,
"blocktime": 1553501874
URL Parameters
network
The selected network: main or test.
hash
The hash/txId of the transaction to retrieve.
Get by Tx Index
This endpoint retrieves the transaction details for a given block height and transaction index in that block. Works only for confirmed transactions.
In the response body, if any output's hex size (vout[x].scriptPubKey.hex) exceeds 100KB, then the data for vout[x].scriptPubKey.hex and vout[x].scriptPubKey.asm is truncated and a flag vout[x].scriptPubKey.isTruncated is set to true.
A separate endpoint Get Raw Transaction Output Data can be used to fetch the full hex data, if required by the client application.
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
},
...
],
"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": 1707,
"time": 1744376748,
"blocktime": 1744376748,
"blockheight": 892006
}
URL Parameters
network
The selected network: main or test.
height
The block height.
txindex
The index of the transaction in the associated block.
Get Transaction Propagation Status
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.
If the transaction has been found on zero peers, possible reasons may include:
Propagation is still in progress;
The transaction fee rate, or that of a preceding transaction, is relatively low, making it invisible to peers that are configured to accept only higher fee rates.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>/propagation
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>/propagation"
{
"queried_peers": 16,
"found_on_peers": 16
}
URL Parameters
network
The selected network: main or test.
hash
The hash/txId of the transaction.
Broadcast Transaction
You can broadcast a transaction using this endpoint. Returns the txId in 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
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/tx/raw" \
--header "Content-Type: application/json" \
--data "{\"txhex\": \"hex...\" }"
{
"txhex": "hex..."
}
URL Parameters
network
The selected network: main or test.
Request Body
txhex
The raw transaction data in hex.
Bulk Transaction Details
You can fetch details for multiple transactions in a single request.
Max 20 transactions per request.
POST https://api.whatsonchain.com/v1/bsv/<network>/txs
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
{
"txids": [
"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
]
}
URL Parameters
network
The selected network: main or test.
Bulk Transaction Status
You can get the status of multiple transactions in a single request.
Max 20 transactions per request.
POST https://api.whatsonchain.com/v1/bsv/<network>/txs/status
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs/status" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
{
"txids": [
"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
]
}
[
{
"txid": "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"blockhash": "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5",
"blockheight": 612251,
"blocktime": 1575841517,
"confirmations": 86479
},
{
"txid": "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258",
"blockhash": "000000000000000002e8d4b4c0385abd195709c82f16d9917f081b70000e8804",
"blockheight": 617279,
"blocktime": 1578837295,
"confirmations": 81451
}
]
URL Parameters
network
The 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
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/tx/decode" \
--header "Content-Type: application/json" \
--data "{\"txhex\": \"hex...\" }"
{
"txhex": "hex..."
}
{
"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
The selected network: main or test.
Request Body
txhex
The raw transaction data in hex.
Download Receipt
You can download the transaction receipt (in PDF).
GET https://<network>.whatsonchain.com/receipt/<hash>
curl --location --request GET "https://main.whatsonchain.com/receipt/4bdbdb7483c1c7ef48cda78ee4141af7cf15f94e10324e0bcac43c29394ea4a9"
URL Parameters
network
The selected network: main or test.
hash
The hash/txId of the transaction.
Get a Transaction as Binary
This endpoint returns the transaction as a binary for a given hash.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/bin
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/bin"
c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96.bin
URL Parameters
network
The selected network: main or test.
hash
The hash/txId of the transaction.
Get Raw Transaction Data
This endpoint returns the raw hex of a transaction for a given hash.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/hex
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/hex"
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1c03d7c6082f7376706f6f6c2e636f6d2f3edff034600055b8467f0040ffffffff01247e814a000000001976a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac00000000
URL Parameters
network
The selected network: main or test.
hash
The hash/txId of the transaction.
Bulk Raw Transaction Data
You can get the raw data of multiple transactions in hex in a single request.
Max 20 transactions per request.
POST https://api.whatsonchain.com/v1/bsv/<network>/txs/hex
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs/hex" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
{
"txids": [
"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
]
}
[
{
"txid": "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
"hex": "0100000001...00000000",
"blockhash": "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5",
"blockheight": 612251,
"blocktime": 1575841517,
"confirmations": 86479
},
{
"txid": "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258",
"hex": "0100000001...00000000",
"blockhash": "000000000000000002e8d4b4c0385abd195709c82f16d9917f081b70000e8804",
"blockheight": 617279,
"blocktime": 1578837295,
"confirmations": 81451
}
]
URL Parameters
network
The 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/<hash>/out/<index>/hex
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/out/0/hex"
76a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac
URL Parameters
network
The selected network: main or test.
hash
The hash/txId of the transaction.
index
The 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/bsv/main/txs/vouts/hex
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
]
}
]
}'
{
"txids": [
{
"txid": "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f",
"vouts": [0,1]
}
]
}
[
{
"txid": "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f",
"vout": {
"0": {
"scriptPubKey": {
"hex": "76a9146b7f6a5d5677d1f3635e589b2eacc75d08dc6c4588ac"
}
},
"1": {
"scriptPubKey": {
"hex": "006a036478733575453364693965487a6e6b47666865696d6863636434673d3d2c6d392c74622c613738362e39332c6535363430302c7332382e333704746578740142"
}
}
}
}
]
URL Parameters
network
The 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
This endpoint returns the Merkle root of the branch for a confirmed transaction, in the TSC format. Returns null for unconfirmed transactions.
The old, non-TSC-format endpoint is no longer supported.
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/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
The selected network: main or test.
hash
The hash/txId of the transaction.
Last updated
Was this helpful?