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>GET https://api.whatsonchain.com/v1/<chain>/<network>/tx/<txid>Example Request
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96"curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/tx/b1ec43184ff57a3143e2ad5ed646916030324bf41fec7f41aaeba86125cea660"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.
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.
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.
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.
Example Request
Example Response
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.
Example Request
Example Response
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.
Example Request
Example Response
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.
Example Request
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.
Example Request
Example Response
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.
Example Request
Example Response
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.
Example Request
Example Response
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.
Example Request
Example Response
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.
URL Parameters
network
Selected network: main or test.
txid
Transaction ID.
Last updated
Was this helpful?