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.
Copy GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>
Copy curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/hash/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96"
Copy {
"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
The selected network: main or test.
The hash/txId of the transaction to retrieve.
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.
Copy GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>/propagation
Copy curl --location --request GET "https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>/propagation"
Copy {
"queried_peers" : 16 ,
"found_on_peers" : 16
}
URL Parameters
The selected network: main or test.
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 (beta) , which are built for those types of use cases.
Copy POST https://api.whatsonchain.com/v1/bsv/<network>/tx/raw
Copy curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/tx/raw" \
--header "Content-Type: application/json" \
--data "{\"txhex\": \"hex...\" }"
The JSON structure for the above post request:
Copy {
"txhex" : "hex..."
}
URL Parameters
The selected network: main or test.
Request Body
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.
Copy POST https://api.whatsonchain.com/v1/bsv/<network>/txs
Copy curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
The JSON structure for the above post request:
Copy {
"txids" : [
"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa" ,
"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
]
}
URL Parameters
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.
Copy POST https://api.whatsonchain.com/v1/bsv/<network>/txs/status
Copy curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs/status" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
The JSON structure for the above post request:
Copy {
"txids" : [
"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa" ,
"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
]
}
Copy [
{
"txid" : "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa" ,
"blockhash" : "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5" ,
"blockheight" : 612251 ,
"blocktime" : 1575841517 ,
"confirmations" : 86479
} ,
{
"txid" : "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258" ,
"blockhash" : "000000000000000002e8d4b4c0385abd195709c82f16d9917f081b70000e8804" ,
"blockheight" : 617279 ,
"blocktime" : 1578837295 ,
"confirmations" : 81451
}
]
URL Parameters
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.
Copy POST https://api.whatsonchain.com/v1/bsv/<network>/tx/decode
Copy curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/tx/decode" \
--header "Content-Type: application/json" \
--data "{\"txhex\": \"hex...\" }"
Post request body JSON structure
Copy {
"txhex" : "hex..."
}
Copy {
"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
The selected network: main or test.
Request Body
The raw transaction data in hex.
Download Receipt
You can download the transaction receipt (in PDF).
Copy GET https://<network>.whatsonchain.com/receipt/<hash>
Copy curl --location --request GET "https://main.whatsonchain.com/receipt/4bdbdb7483c1c7ef48cda78ee4141af7cf15f94e10324e0bcac43c29394ea4a9"
URL Parameters
The selected network: main or test.
The hash/txId of the transaction.
Get a Transaction as Binary
This endpoint returns the transaction as a binary for a given hash.
Copy GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/bin
Copy curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/bin"
Copy c 1 d 32 f 28 baa 27 a 376 ba 977 f 6 a 8 de 6 ce 0 a 87041157 cef 0274 b 20 bfda 2 b 0 d 8 df 96 .bin
URL Parameters
The selected network: main or test.
The hash/txId of the transaction.
Get Raw Transaction Data
This endpoint returns the raw hex of a transaction for a given hash.
Copy GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/hex
Copy curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/hex"
Response with header content-type: text/plain:
Copy 01000000010000000000000000000000000000000000000000000000000000000000000000 ffffffff 1 c 03 d 7 c 6082 f 7376706 f 6 f 6 c 2e636 f 6 d 2 f 3 edff 034600055 b 8467 f 0040 ffffffff 01247e814 a 000000001976 a 914492558 fb 8 ca 71 a 3591316 d 095 afc 0 f 20 ef 7 d 42 f 788 ac 00000000
URL Parameters
The selected network: main or test.
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.
Copy POST https://api.whatsonchain.com/v1/bsv/<network>/txs/hex
Copy curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs/hex" \
--header "Content-Type: application/json" \
--data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"
The JSON structure for the above post request:
Copy {
"txids" : [
"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa" ,
"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
]
}
Copy [
{
"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
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.
Copy GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/out/<index>/hex
Copy curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/out/0/hex"
Response with header content-type: text/plain:
Copy 76 a 914492558 fb 8 ca 71 a 3591316 d 095 afc 0 f 20 ef 7 d 42 f 788 ac
URL Parameters
The selected network: main or test.
The hash/txId of the transaction.
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.
Copy POST https://api.whatsonchain.com/v1/bsv/main/txs/vouts/hex
Copy 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
]
}
]
}'
The JSON structure for the above post request:
Copy {
"txids" : [
{
"txid" : "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f" ,
"vouts" : [ 0 , 1 ]
}
]
}
Copy [
{
"txid" : "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f" ,
"vout" : {
"0" : {
"scriptPubKey" : {
"hex" : "76a9146b7f6a5d5677d1f3635e589b2eacc75d08dc6c4588ac"
}
} ,
"1" : {
"scriptPubKey" : {
"hex" : "006a036478733575453364693965487a6e6b47666865696d6863636434673d3d2c6d392c74622c613738362e39332c6535363430302c7332382e333704746578740142"
}
}
}
}
]
URL Parameters
The selected network: main or test.
Errors
If a given txID is unknown.
If a given output is unknown.
Get Merkle Proof
This endpoint returns the Merkle root of the branch for a confirmed transaction. Returns null for unconfirmed transactions.
Copy GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/proof
Copy curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/proof"
Copy [
{
"blockHash" : "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3" ,
"branches" : [
{
"hash" : "7e0ba1980522125f1f40d19a249ab3ae036001b991776813d25aebe08e8b8a50" ,
"pos" : "R"
} ,
{
"hash" : "1e3a5a8946e0caf07006f6c4f76773d7e474d4f240a276844f866bd09820adb3" ,
"pos" : "R"
}
] ,
"hash" : "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96" ,
"merkleRoot" : "95a920b1002bed05379a0d2650bb13eb216138f28ee80172f4cf21048528dc60"
}
]
To get the response in the TSC format, add "/tsc " to the request at the end.
Copy GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/proof/tsc
Copy curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/proof/tsc"
Copy [
{
"index" : 0 ,
"txOrId" : "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96" ,
"target" : "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3" ,
"nodes" : [
"7e0ba1980522125f1f40d19a249ab3ae036001b991776813d25aebe08e8b8a50" ,
"1e3a5a8946e0caf07006f6c4f76773d7e474d4f240a276844f866bd09820adb3"
]
}
]
URL Parameters
The selected network: main or test.
The hash/txId of the transaction.