Public docs
WebsiteTAAL PlatformWhatsOnChain
  • Welcome
  • Introduction
    • Get an API Key
  • Core Products
    • WhatsOnChain
      • Health
      • Chain Info
      • Block
      • Transaction
      • Mempool
      • (Un)Spent Transaction Outputs
      • Address
      • Script
      • Exchange Rate
      • Search
      • WoC Widgets
      • WoC Plugins
      • On-Chain Data
      • Output Tags
      • Stats
      • WebSockets
        • WoC Sockets V1 (Deprecated)
        • WoC Sockets V2 (Beta)
      • Tokens
        • 1Sat Ordinals (Beta)
        • BSV-21 (Beta)
        • STAS Tokens (Beta)
      • Change Log
      • Community Libraries
    • Transaction Processing
      • ARC Endpoints
      • Transaction format and fee rate
    • TAAL Wallet
      • Introduction
      • Architecture
      • Terminology
      • UI Elements
      • Tutorial
    • 1Sat Ordinals tokens API
      • Introduction
      • Terminology
      • Flow Diagram
      • Basic Tutorial - Node
      • Basic Tutorial - Postman
      • API
  • Resources
    • FAQ
    • Support
    • Glossary
    • Acronyms and Abbreviations
Powered by GitBook
On this page
  • Get by Tx Hash
  • Get by Tx Index
  • Get Transaction Propagation Status
  • Broadcast Transaction
  • Bulk Transaction Details
  • Bulk Transaction Status
  • Decode Transaction
  • Download Receipt
  • Get a Transaction as Binary
  • Get Raw Transaction Data
  • Bulk Raw Transaction Data
  • Get Raw Transaction Output Data
  • Bulk Raw Transaction Output Data
  • Get Merkle Proof

Was this helpful?

Export as PDF
  1. Core Products
  2. WhatsOnChain

Transaction

PreviousBlockNextMempool

Last updated 15 days ago

Was this helpful?

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 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/<hash>
cURL
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/hash/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96"
Response JSON structure
{
  "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

Parameter
Description

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.

HTTP Request
GET https://api.whatsonchain.com/v1/bsv/main/block/height/<height>/txindex/<txindex>
cURL
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/block/height/892006/txindex/32891"
Response JSON structure
{
    "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

Parameter
Description

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.

HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>/propagation
cURL
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>/propagation"
Response JSON structure
{
  "queried_peers": 16,
  "found_on_peers": 16
}

URL Parameters

Parameter
Description

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.

HTTP Request
POST https://api.whatsonchain.com/v1/bsv/<network>/tx/raw
cURL
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:
{
  "txhex": "hex..."
}

URL Parameters

Parameter
Description

network

The selected network: main or test.

Request Body

Parameter
Description

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.

HTTP Request
POST https://api.whatsonchain.com/v1/bsv/<network>/txs
cURL
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:
{
  "txids": [
    "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
    "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
  ]
}

URL Parameters

Parameter
Description

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.

HTTP Request
POST https://api.whatsonchain.com/v1/bsv/<network>/txs/status
cURL
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:
{
  "txids": [
    "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
    "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
  ]
}
Response JSON structure
[
  {
    "txid": "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
    "blockhash": "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5",
    "blockheight": 612251,
    "blocktime": 1575841517,
    "confirmations": 86479
  },
  {
    "txid": "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258",
    "blockhash": "000000000000000002e8d4b4c0385abd195709c82f16d9917f081b70000e8804",
    "blockheight": 617279,
    "blocktime": 1578837295,
    "confirmations": 81451
  }
]

URL Parameters

Parameter
Description

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.

HTTP Request
POST https://api.whatsonchain.com/v1/bsv/<network>/tx/decode
cURL
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
{
  "txhex": "hex..."
}
Response JSON structure
{
  "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

Parameter
Description

network

The selected network: main or test.

Request Body

Parameter
Description

txhex

The raw transaction data in hex.

Download Receipt

You can download the transaction receipt (in PDF).

HTTP Request
GET https://<network>.whatsonchain.com/receipt/<hash>
cURL
curl --location --request GET  "https://main.whatsonchain.com/receipt/4bdbdb7483c1c7ef48cda78ee4141af7cf15f94e10324e0bcac43c29394ea4a9"

URL Parameters

Parameter
Description

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.

HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/bin
cURL
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/bin"
Response (file)
c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96.bin

URL Parameters

Parameter
Description

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.

HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/hex
cURL
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/hex"
Response with header content-type: text/plain:
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1c03d7c6082f7376706f6f6c2e636f6d2f3edff034600055b8467f0040ffffffff01247e814a000000001976a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac00000000

URL Parameters

Parameter
Description

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.

HTTP Request
POST https://api.whatsonchain.com/v1/bsv/<network>/txs/hex
cURL
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:
{
  "txids": [
    "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
    "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
  ]
}
Response JSON structure:
[
  {
    "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

Parameter
Description

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.

HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/out/<index>/hex
cURL
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/out/0/hex"
Response with header content-type: text/plain:
76a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac

URL Parameters

Parameter
Description

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.

HTTP Request
POST https://api.whatsonchain.com/v1/bsv/main/txs/vouts/hex
cURL
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:
{
    "txids": [
        {
            "txid": "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f",
            "vouts": [0,1]
        }
    ]
}
Response JSON structure:
[
    {
        "txid": "e8022f0904e636a7f4c1e561ca0af794b354f6fb71bdfb57b5ac3528e3f40e2f",
        "vout": {
            "0": {
                "scriptPubKey": {
                    "hex": "76a9146b7f6a5d5677d1f3635e589b2eacc75d08dc6c4588ac"
                }
            },
            "1": {
                "scriptPubKey": {
                    "hex": "006a036478733575453364693965487a6e6b47666865696d6863636434673d3d2c6d392c74622c613738362e39332c6535363430302c7332382e333704746578740142"
                }
            }
        }
    }
]

URL Parameters

Parameter
Description

network

The 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

The old, non-TSC-format endpoint is no longer supported.

HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/proof/tsc
cURL
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/proof/tsc"
Response JSON structure
[
    {
        "index": 0,
        "txOrId": "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
        "target": "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3",
        "nodes": [
            "7e0ba1980522125f1f40d19a249ab3ae036001b991776813d25aebe08e8b8a50",
            "1e3a5a8946e0caf07006f6c4f76773d7e474d4f240a276844f866bd09820adb3"
        ]
    }
]

URL Parameters

Parameter
Description

network

The selected network: main or test.

hash

The hash/txId of the transaction.

A separate endpoint can be used to fetch the full hex data, if required by the client application.

Keep in mind that this endpoint is meant for small-scale usage. For commercial or enterprise usage, please take a look at , which are built for those types of use cases.

This endpoint returns the Merkle root of the branch for a confirmed transaction, in the format. Returns null for unconfirmed transactions.

ARC Endpoints
TSC
Get Raw Transaction Output Data
Get Raw Transaction Output Data