This endpoint retrieves the transaction details for a given transaction ID.
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, blockhash 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.
HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<txid>
GET https://api.whatsonchain.com/v1/<chain>/<network>/tx/<txid>
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.
URL Parameters
Parameter
Description
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.
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.
URL Parameters
Parameter
Description
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
Parameter
Description
network
Selected network: main or test.
Request Parameters
Parameter
Description
txhex
Raw transaction data in hex.
Bulk Transaction Details
You can fetch details for multiple transactions in a single request.
Max 20 transactions per request.
For unconfirmed transactions, blockhash and confirmations info won't be returned, as it doesn't exist.
Example Request
Example Response
URL Parameters
Parameter
Description
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.
Max 20 transactions per request.
Example Request
Example Response
URL Parameters
Parameter
Description
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
Parameter
Description
network
Selected network: main or test.
Request Parameters
Parameter
Description
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
Parameter
Description
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
Parameter
Description
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.
Max 20 transactions per request.
Example Request
Example Response
URL Parameters
Parameter
Description
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
Parameter
Description
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
Parameter
Description
chain
Desired blockchain: bsv or btc.
network
Selected network: main or test.
Errors
Error
Description
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.
Returns null for unconfirmed transactions.
The old, non-TSC-format endpoint is no longer supported.