NAV Navbar
cURL

Introduction

WhatOnChain provides access to Bitcoin SV blocks, transactions, address activity, On Chain data, stats and much more via simple REST API.

You can also use this API to broadcast transactions.

Supported Networks:

Run in Postman

      #####         #####  ,,,,,,,,,,,,,,,   #################           
    ######          ######  ,,,,,,,,,,,,,  #####################         
   #####              ##### ,,,,,,,,,,,,, #######################       
  #####              ,,, ###             ### ,,,             ####        
  #####      ####   ,,,, ###             ### ,,,,                       
  #####      ####   ,,,, ###             ### ,,,,                       
   #####     ####    ,,,, #               # ,,,,             ####        
    ################# ,,,,,,,,,,,,,,,,,,,,,,,,,, ################        
     #################  ,,,,,,,,,,,,,,,,,,,,,,, ################         
       #################  ,,,,,,,,,,,,,,,,,,,  ###############            

Authentication

At this stage no authentication is required.

Rate Limits

Up to 3 requests/sec. Need more? Drop us a messaage.

Health

Get api status

curl "https://api.whatsonchain.com/v1/bsv/main/woc"

The above request returns below plain text response:

"Whats On Chain"

Simple endpoint to show API server is up and running

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/woc

URL Parameters

Parameter Description
network Selected network: main , test or stn

Chain Info

Get blockhain info

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/chain/info"

Response JSON structure:

{
    "chain": "main",
    "blocks": 635302,
    "headers": 635299,
    "bestblockhash": "000000000000000002a40d7410a6c08109521c14f4cf354e7b352b4eab8aa4ea",
    "difficulty": 287310033717.7086,
    "mediantime": 1589703256,
    "verificationprogress": 0.9999754124031851,
    "pruned": false,
    "chainwork": "0000000000000000000000000000000000000000010969f724913e0fe59377f4"
}

This endpoint retrieves various state info of the chain for the selected network.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/chain/info

URL Parameters

Parameter Description
network Selected network: main , test or stn

Get Circulating Supply

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/circulatingsupply"

Response:

18227675

This endpoint provides circulating supply of BSV.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/circulatingsupply

URL Parameters

Parameter Description
network Selected network: main

Block

Get by hash

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/hash/000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb"

Response JSON structure:

{
    "hash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
    "confirmations": 89,
    "size": 14421,
    "height": 575045,
    "version": 536928256,
    "versionHex": "2000e000",
    "merkleroot": "4ebcba09addd720991d03473f39dce4b9a72cc164e505cd446687a54df9b1585",
    "txcount": 5,
    "tx": [
        "bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a",
        "c7e8317b48e72644e2b83c87c54f61bcda82326392f969a097fb801aed69b500",
        "fd39debc631cf1a97702052fa60303d53062d6f2c1b624ab1f5fc0d20233736f",
        "65cb37947ccb7c5b7cc4ac36a200613bfc39a7f7c6c0314a23dbcc5b3908b5b8",
        "0f9d562702259822778193ff46f0c6d5e4aa744a433982770d3134e2bf454d10"
    ],
    "time": 1553416668,
    "mediantime": 1553414858,
    "nonce": 87914848,
    "bits": "180997ee",
    "difficulty": 114608607557.4425,
    "chainwork": "000000000000000000000000000000000000000000ddf5d385546872bab7dc01",
    "previousblockhash": "00000000000000000988156c7075dc9147a5b62922f1310862e8b9000d46dd9b",
    "nextblockhash": "00000000000000000112b36a37c10235fa0c991f680bc5482ba9692e0ae697db",
    "coinbaseTx": {
        "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff220345c6082f626d67706f6f6c2e636f6d2f473173717918707a8aae4a936f101e0000ffffffff018ed9814a000000001976a91485770ad0ee64a4f3ee4027e199c32f876e03a2d988ac00000000",
        "txid": "bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a",
        "hash": "bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a",
        "size": 119,
        "version": 1,
        "locktime": 0,
        "vin": [
            {
                "txid": "",
                "vout": 0,
                "scriptSig": {
                    "asm": "",
                    "hex": ""
                },
                "sequence": 4294967295,
                "coinbase": "0345c6082f626d67706f6f6c2e636f6d2f473173717918707a8aae4a936f101e0000"
            }
        ],
        "vout": [
            {
                "value": 12.50023822,
                "n": 0,
                "scriptPubKey": {
                    "asm": "OP_DUP OP_HASH160 85770ad0ee64a4f3ee4027e199c32f876e03a2d9 OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a91485770ad0ee64a4f3ee4027e199c32f876e03a2d988ac",
                    "reqSigs": 1,
                    "type": 0,
                    "addresses": [
                        "1DAhUiQxHzL1oAusoUDdUM89spXuAG1sqy"
                    ],
                    "opReturn": null
                }
            }
        ],
        "blockhash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
        "confirmations": 89,
        "time": 1553416668,
        "blocktime": 1553416668
    },
    "totalFees": 0.0002382199999999557,
    "miner": "Bmgpool",
    "pages": null
}

This endpoint retrieves block details with given hash.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/block/hash/<hash>

URL Parameters

Parameter Description
network Selected network: main , test or stn
hash The hash of the block to retrieve

Get by height

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/height/575191"

Response JSON structure:

{
    "hash": "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3",
    "confirmations": 1,
    "size": 611,
    "height": 575191,
    "version": 536870912,
    "versionHex": "20000000",
    "merkleroot": "95a920b1002bed05379a0d2650bb13eb216138f28ee80172f4cf21048528dc60",
    "txcount": 3,
    "tx": [
        "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
        "7e0ba1980522125f1f40d19a249ab3ae036001b991776813d25aebe08e8b8a50",
        "5c4d44b9b8d2ec6e0835ac90f206cecb26bf51033f31d4c659975b7534853409"
    ],
    "time": 1553501874,
    "mediantime": 1553499038,
    "nonce": 2482491775,
    "bits": "180978d5",
    "difficulty": 116078424449.9863,
    "chainwork": "000000000000000000000000000000000000000000de04fc280ef3a599fbadde",
    "previousblockhash": "00000000000000000012ce7f4bbce3346ac438ab7fdcb6fa5440db9857856a7f",
    "nextblockhash": "",
    "coinbaseTx": {
        "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1c03d7c6082f7376706f6f6c2e636f6d2f3edff034600055b8467f0040ffffffff01247e814a000000001976a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac00000000",
        "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",
                    "hex": "76a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac",
                    "reqSigs": 1,
                    "type": 0,
                    "addresses": [
                        "17fm4xevwDh3XRHv9UoqYrVgPMbwcGHsUs"
                    ],
                    "opReturn": null
                }
            }
        ],
        "blockhash": "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3",
        "confirmations": 1,
        "time": 1553501874,
        "blocktime": 1553501874
    },
    "totalFees": 0.000004199999999343618,
    "miner": "SVpool",
    "pages": null
}

This endpoint retrieves block details with given block height.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/block/height/<height>

URL Parameters

Parameter Description
network Selected network: main , test or stn
height The height of the block to retrieve

Get block pages

If the block has more that 1000 transactions the page URIs will be provided in the pages element when getting a block by hash or height.

Example pages element in Get block by height or hash response

{
    "hash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
    ...
    "pages": {
        "uri": [
            "/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/1",
            "/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/2",
            ...
    ],
        "size": 50000
    }
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/1"

Response JSON structure:

[
    "89b4e01ea1ab27edb6ea66899637b526faebeb42ca0302ff9ed916670f1330fe",
    "1097bfc9b1f586352a1ab29afd27c1f89e0a5d9790ea08a2b2a7d988ea6f2cfe",
    ....
]

HTTP Request

GET https://api.whatsonchain.com/getblocktxids/v1/bsv/<network>/block/hash/<hash>/page/<number>

URL Parameters

Parameter Description
network Selected network: main , test or stn
hash The hash of the block to retrieve
number Page number

Transaction

Get by tx hash

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
}

This endpoint retrieves transaction details with given transaction hash.

In the response body, if any output hex size (vout[x].scriptPubKey.hex) exceeds 100KB then 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 full hex data if required by the client application.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/tx/hash/<hash>

URL Parameters

Parameter Description
network Selected network: main , test or stn
hash The hash/txId of the transaction to retrieve

Broadcast transaction

curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/tx/raw" \
  --header "Content-Type: application/json" \
  --data "{\"txhex\": \"hex...\" }"

The JSON structured for above post request:

{
    "txhex": "hex..."
}

Broadcast transaction using this endpoint. Get txid in response or error msg from node with header content-type: text/plain.

HTTP Request

POST https://api.whatsonchain.com/v1/bsv/<network>/tx/raw

URL Parameters

Parameter Description
network Selected network: main , test or stn

Request Body

Parameter Description
txhex Raw transaction data in hex

Bulk Broadcast

curl --location --request POST "https://api.whatsonchain.com/v1/bsv/tx/broadcast?feedback=false" \
  --header "Content-Type: application/json" \
  --data "[\"..rawTx1..\",\"..rawTx2..\", ..., \"..rawTx100\"]"

The JSON structured for above post request:

[
    "rawTx1",
    "rawTx2",
     .....
     "rawTx100"
]

You can bulk broadcast transactions using this endpoint.

HTTP Request

POST https://api.whatsonchain.com/v1/bsv/tx/broadcast?feedback=<feedback>

URL Parameters

Parameter Description
feedback true/false: true if response from the node is required for each transaction, otherwise, set it to false. (For stress testing set it to false). When set to true a unique url is provided to check the progress of the submitted transactions, eg 'QUEUED' or 'PROCESSED', with response data from node. You can poll the provided unique url until all transactions are marked as 'PROCESSED'. Progress of the transactions are tracked on this unique url for up to 5 hours.

Bulk transaction details

curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/txs" \
  --header "Content-Type: application/json" \
  --data "{\"txids\" : [\"294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa\",\"91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258\" ] }"

The JSON structured for above post request:

{
    "txids": 
    [
        "294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa",
        "91f68c2c598bc73812dd32d60ab67005eac498bef5f0c45b822b3c9468ba3258"
    ]
}

Fetch details for multiple transactions in single request

HTTP Request

POST https://api.whatsonchain.com/v1/bsv/tx/main/txs

URL Parameters

Parameter Description
network Selected network: main , test or stn

Decode transaction

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"
}

Decode raw transaction using this endpoint. Get json in response or error msg from node.

HTTP Request

POST https://api.whatsonchain.com/v1/bsv/<network>/tx/decode

URL Parameters

Parameter Description
network Selected network: main , test or stn

Request Body

Parameter Description
txhex Raw transaction data in hex

Download receipt

curl --location --request GET  "https://main.whatsonchain.com/receipt/4bdbdb7483c1c7ef48cda78ee4141af7cf15f94e10324e0bcac43c29394ea4a9"

Download transaction receipt (PDF)

HTTP Request

GET https://<network>.whatsonchain.com/receipt/<hash>

URL Parameters

Parameter Description
network Selected network: main , test or stn
hash The hash/txId of the transaction

Get raw transaction data

curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/hex"

Get raw transaction data in hex

Response with header content-type: text/plain:

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1c03d7c6082f7376706f6f6c2e636f6d2f3edff034600055b8467f0040ffffffff01247e814a000000001976a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac00000000

This endpoint returns raw hex for the transaction with given hash

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/hex

URL Parameters

Parameter Description
network Selected network: main or test
hash The hash/txId of the transaction

Get raw transaction output data

curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/out/0/hex"

Get raw transaction vout data in hex

Response with header content-type: text/plain:

76a914492558fb8ca71a3591316d095afc0f20ef7d42f788ac

This endpoint returns raw hex for the transaction output with given hash and index

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/out/<index>/hex

URL Parameters

Parameter Description
network Selected network: main or test
hash The hash/txId of the transaction
index Output/Vout index

Get merkle proof

curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/tx/c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96/proof"

Response JSON structure:

[
    {
        "blockHash": "0000000000000000091216c46973d82db057a6f9911352892b7769ed517681c3",
        "branches": [
            {
                "hash": "7e0ba1980522125f1f40d19a249ab3ae036001b991776813d25aebe08e8b8a50",
                "pos": "R"
            },
            {
                "hash": "1e3a5a8946e0caf07006f6c4f76773d7e474d4f240a276844f866bd09820adb3",
                "pos": "R"
            }
        ],
        "hash": "c1d32f28baa27a376ba977f6a8de6ce0a87041157cef0274b20bfda2b0d8df96",
        "merkleRoot": "95a920b1002bed05379a0d2650bb13eb216138f28ee80172f4cf21048528dc60"
    }
]

This endpoint returns merkle branch to a confirmed transaction

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<hash>/proof

URL Parameters

Parameter Description
network Selected network: main
hash The hash/txId of the transaction

Mempool

Get mempool info

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/mempool/info"

Response JSON structure:

{
    "bytes": 444832,
    "maxmempool": 8196000000,
    "mempoolminfee": 0,
    "size": 142,
    "usage": 647072
}

This endpoint retrieves various info about the node's mempool for the selected network.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/mempool/info

URL Parameters

Parameter Description
network Selected network: main , test or stn

Get mempool transactions

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/mempool/raw"

Response JSON structure:

[
    "0b0911bcb1f762634ed3ee171694d68049420c730296a7a592b29d46919c7739", 
    "195c95162a7f73f2ff9d4a5d8894f63ec44712b3b69fe1c3e53464048c6a39e3",
    ...
]

This endpoint retrieve list of transaction ids from the node's mempool for the selected network.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/mempool/raw

URL Parameters

Parameter Description
network Selected network: main , test or stn

Address

Get address info

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/16ZqP5Tb22KJuvSAbjNkoiZs13mmRmexZA/info"

Response JSON structure:

{
    "address": "16ZqP5Tb22KJuvSAbjNkoiZs13mmRmexZA",
    "ismine": false,
    "isscript": false,
    "isvalid": true,
    "iswatchonly": false,
    "scriptPubKey": "76a9143d0e5368bdadddca108a0fe44739919274c726c788ac"
}

This endpoint retrieves various address info.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/info

URL Parameters

Parameter Description
network Selected network: main or test
address address

Get balance

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/1GJ3x5bcEnKMnzNFPPELDfXUCwKEaLHM5H/balance"

Response JSON structure:

{   
    "confirmed":533134093647,
    "unconfirmed":0
}

This endpoint retrieves confirmed and unconfirmed address balance.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/balance

URL Parameters

Parameter Description
network Selected network: main or test
address address

Get history

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/1GJ3x5bcEnKMnzNFPPELDfXUCwKEaLHM5H/history"

Response JSON structure:

[
    {
        "tx_hash": "2b5ccedd76ba0d524d95ecce1c8a76e5888e0f13591734be0169ba0220c69208",
        "height": 573216
    },
    {
        "tx_hash": "7fe815e14b32aaaecc2cca7ed605ed612b532765710917cb711ea71cf55e36b5",
        "height": 573229
    },
    {
        "tx_hash": "b28dd1723d0d1fa6e4b2875f7419028c1c1441fc02469aebc444c0a42d0bac3f",
        "height": 573230
    },
    ...
]    

This endpoint retrieves confirmed and unconfirmed address transactions.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/history

URL Parameters

Parameter Description
network Selected network: main or test
address address

Get unspent transactions

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/1GJ3x5bcEnKMnzNFPPELDfXUCwKEaLHM5H/unspent"

Response JSON structure:

[
    {
        "height": 578325,
        "tx_pos": 0,
        "tx_hash": "62824e3af3d01113e9bce8b73576b833990d231357bd718385958c21d50bbddd",
        "value": 1250020815
    },
    {
        "height": 578326,
        "tx_pos": 0,
        "tx_hash": "4b008a10eebcf70f384442e4e3147bc76c6e4f764b516b208e148d700b965deb",
        "value": 1251827826
    },
    ...
]    

This endpoint retrieves ordered list of UTXOs.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/unspent

URL Parameters

Parameter Description
network Selected network: main or test
address address

Download statement

curl --location --request GET  "https://main.whatsonchain.com/statement/16ZqP5Tb22KJuvSAbjNkoiZs13mmRmexZA"

Download address statement (PDF)

HTTP Request

GET https://<network>.whatsonchain.com/statement/<address>

URL Parameters

Parameter Description
network Selected network: main or test
address address

Script

Get script history

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/script/995ea8d0f752f41cdd99bb9d54cb004709e04c7dc4088bcbbbb9ea5c390a43c3/history"

Response JSON structure:

[
    {
        "tx_hash": "52dfceb815ad129a0fd946e3d665f44fa61f068135b9f38b05d3c697e11bad48",
        "height": 620539
    },
    {
        "tx_hash": "4ec3b63d764558303eda720e8e51f69bbcfe81376075657313fb587306f8a9b0",
        "height": 620539
    }
]    

This endpoint retrieves confirmed and unconfirmed script transactions.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/script/<scriptHash>/history

URL Parameters

Parameter Description
network Selected network: main or test
scriptHash Script hash: Sha256 hash of the binary bytes of the locking script (ScriptPubKey), expressed as a hexadecimal string.

Get script unspent transactions

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/script/995ea8d0f752f41cdd99bb9d54cb004709e04c7dc4088bcbbbb9ea5c390a43c3/unspent"

Response JSON structure:

[
    {
        "height": 578325,
        "tx_pos": 0,
        "tx_hash": "62824e3af3d01113e9bce8b73576b833990d231357bd718385958c21d50bbddd",
        "value": 1250020815
    },
    {
        "height": 578326,
        "tx_pos": 0,
        "tx_hash": "4b008a10eebcf70f384442e4e3147bc76c6e4f764b516b208e148d700b965deb",
        "value": 1251827826
    },
    ...
]    

This endpoint retrieves ordered list of UTXOs.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/script/<scriptHash>/unspent

URL Parameters

Parameter Description
network Selected network: main or test
scriptHash Script hash: Sha256 hash of the binary bytes of the locking script (ScriptPubKey), expressed as a hexadecimal string.

Exchange Rate

Get exchange rate

curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/exchangerate"

Response:

{
    "currency": "USD",
    "rate": "229.31633333333335"
}

This endpoint provides exchange rate for BSV.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/exchangerate

URL Parameters

Parameter Description
network Selected network: main

Merchant API (BETA)

Fee quotes

curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/mapi/feeQuotes"

Response JSON structure:

{
    "quotes": [
        {
            "providerName": "taal",
            "providerId": "ba001df8",
            "quote": {
                "apiVersion": "0.1.0",
                "timestamp": "2020-05-14T20:47:17.543Z",
                "expiryTime": "2020-05-14T20:57:17.543Z",
                "minerId": "03e92d3e5c3f7bd945dfbf48e7a99393b1bfb3f11f380ae30d286e7ff2aec5a270",
                "currentHighestBlockHash": "0000000000000000014862c7c933fbcef1d9f12f58d3cbd934d1b67cf2f4e282",
                "currentHighestBlockHeight": 634915,
                "minerReputation": null,
                "fees": [
                    {
                        "feeType": "standard",
                        "miningFee": {
                            "satoshis": 5,
                            "bytes": 10
                        },
                        "relayFee": {
                            "satoshis": 25,
                            "bytes": 100
                        }
                    },
                    {
                        "feeType": "data",
                        "miningFee": {
                            "satoshis": 5,
                            "bytes": 10
                        },
                        "relayFee": {
                            "satoshis": 25,
                            "bytes": 100
                        }
                    }
                ]
            },
            "payload": "{\"apiVersion\":\"0.1.0\",\"timestamp\":\"2020-05-14T20:47:17.543Z\",\"expiryTime\":\"2020-05-14T20:57:17.543Z\",\"minerId\":\"03e92d3e5c3f7bd945dfbf48e7a99393b1bfb3f11f380ae30d286e7ff2aec5a270\",\"currentHighestBlockHash\":\"0000000000000000014862c7c933fbcef1d9f12f58d3cbd934d1b67cf2f4e282\",\"currentHighestBlockHeight\":634915,\"minerReputation\":null,\"fees\":[{\"feeType\":\"standard\",\"miningFee\":{\"satoshis\":5,\"bytes\":10},\"relayFee\":{\"satoshis\":25,\"bytes\":100}},{\"feeType\":\"data\",\"miningFee\":{\"satoshis\":5,\"bytes\":10},\"relayFee\":{\"satoshis\":25,\"bytes\":100}}]}",
            "signature": "3044022065f39254a2b5d7bbfc327c21bf0bed369cb24219a30c30cb98ce814d039c0b9e0220116d049d7e77283bd0693a6af0446192a8dacf78db8e7c4bfeed95fb0d8409ee",
            "publicKey": "03e92d3e5c3f7bd945dfbf48e7a99393b1bfb3f11f380ae30d286e7ff2aec5a270",
            "txSubmissionUrl": "/mapi/ba001df8/tx",
            "txStatusUrl": "/mapi/ba001df8/tx/{hash:[0-9a-fA-F]+}"
        },
        {
            "providerName": "mempool",
            "providerId": "ab398390",
            "quote": {
                "apiVersion": "0.1.0",
                "timestamp": "2020-05-14T20:47:18.171Z",
                "expiryTime": "2020-05-14T20:57:18.171Z",
                "minerId": null,
                "currentHighestBlockHash": "0000000000000000014862c7c933fbcef1d9f12f58d3cbd934d1b67cf2f4e282",
                "currentHighestBlockHeight": 634915,
                "minerReputation": null,
                "fees": [
                    {
                        "feeType": "standard",
                        "miningFee": {
                            "satoshis": 500,
                            "bytes": 1000
                        },
                        "relayFee": {
                            "satoshis": 250,
                            "bytes": 1000
                        }
                    },
                    {
                        "feeType": "data",
                        "miningFee": {
                            "satoshis": 500,
                            "bytes": 1000
                        },
                        "relayFee": {
                            "satoshis": 250,
                            "bytes": 1000
                        }
                    }
                ]
            },
            "payload": "{\"apiVersion\":\"0.1.0\",\"timestamp\":\"2020-05-14T20:47:18.171Z\",\"expiryTime\":\"2020-05-14T20:57:18.171Z\",\"minerId\":null,\"currentHighestBlockHash\":\"0000000000000000014862c7c933fbcef1d9f12f58d3cbd934d1b67cf2f4e282\",\"currentHighestBlockHeight\":634915,\"minerReputation\":null,\"fees\":[{\"feeType\":\"standard\",\"miningFee\":{\"satoshis\":500,\"bytes\":1000},\"relayFee\":{\"satoshis\":250,\"bytes\":1000}},{\"feeType\":\"data\",\"miningFee\":{\"satoshis\":500,\"bytes\":1000},\"relayFee\":{\"satoshis\":250,\"bytes\":1000}}]}",
            "signature": null,
            "publicKey": null,
            "txSubmissionUrl": "/mapi/ab398390/tx",
            "txStatusUrl": "/mapi/ab398390/tx/{hash:[0-9a-fA-F]+}"
        }
    ]
}

This endpoint provides fee quotes from multiple transaction processors. Each quote also contains transaction processor specific txSubmissionUrl and txStatusUrl. These unique URLs can be used to submit transactions to the selected transaction processor and check the status of the submitted transaction.
Any post request to txSubmissionUrl is forwarded to the selected transaction processor ‘AS IS’ and is ‘NOT’ broadcast from any WoC nodes.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/main/mapi/feeQuotes

Submit transaction

curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/mapi/ba001df8/tx" \
  --header "Content-Type: application/json" \
  --data "{\"rawtx\": \"hex...\" }"

The JSON structured for above post request:

{
    "rawtx": "hex..."
}

Response JSON structure:

{
    "providerName": "taal",
    "providerId": "ba001df8",
    "error": {
        "status": 0,
        "code": 0,
        "error": ""
    },
    "response": {
        "apiVersion": "0.1.0",
        "timestamp": "2020-05-17T10:30:39.597Z",
        "txid": "",
        "returnResult": "failure",
        "resultDescription": "ERROR: 257: txn-already-known",
        "minerId": "03e92d3e5c3f7bd945dfbf48e7a99393b1bfb3f11f380ae30d286e7ff2aec5a270",
        "currentHighestBlockHash": "000000000000000001bcb3aa96178cd8a022a9ed2cd30cb11c38181ada9f8e87",
        "currentHighestBlockHeight": 635304,
        "txSecondMempoolExpiry": 0
    },
    "payload": "{\"apiVersion\":\"0.1.0\",\"timestamp\":\"2020-05-17T10:30:39.597Z\",\"txid\":\"\",\"returnResult\":\"failure\",\"resultDescription\":\"ERROR: 257: txn-already-known\",\"minerId\":\"03e92d3e5c3f7bd945dfbf48e7a99393b1bfb3f11f380ae30d286e7ff2aec5a270\",\"currentHighestBlockHash\":\"000000000000000001bcb3aa96178cd8a022a9ed2cd30cb11c38181ada9f8e87\",\"currentHighestBlockHeight\":635304,\"txSecondMempoolExpiry\":0}",
    "signature": "30440220540c3154e6452eac92c2100242f9d1c52027630b969f4b4af497a4701caa68940220026683f3e3155842e6827149331559f6b819ef25570fc5401bffdddc36310299",
    "publicKey": "03e92d3e5c3f7bd945dfbf48e7a99393b1bfb3f11f380ae30d286e7ff2aec5a270"
}

Submit a transaction to a specific transaction processor using the txSubmissionUrl provided with each quote in the Fee quotes response.

HTTP Request

POST https://api.whatsonchain.com/v1/bsv/<network>/mapi/<providerId>/tx

URL Parameters

Parameter Description
network Selected network: main
providerId Unique providerId from the Fee quotes response

Request Body

Parameter Description
rawtx Raw transaction data in hex

Transaction status

curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/mapi/ab398390/tx/294cd1ebd5689fdee03509f92c32184c0f52f037d4046af250229b97e0c8f1aa" \
  --header "Content-Type: application/json" \
  --data "{\"txhex\": \"hex...\" }"

Response JSON structure:

{
    "providerName": "mempool",
    "providerId": "ab398390",
    "status": {
        "apiVersion": "0.1.0",
        "timestamp": "2020-05-14T22:17:32.422Z",
        "returnResult": "success",
        "resultDescription": "",
        "blockHash": "000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5",
        "blockHeight": 612251,
        "confirmations": 22670,
        "minerId": null,
        "txSecondMempoolExpiry": 0
    },
    "payload": "{\"apiVersion\":\"0.1.0\",\"timestamp\":\"2020-05-14T22:17:32.422Z\",\"returnResult\":\"success\",\"resultDescription\":\"\",\"blockHash\":\"000000000000000004b5ce6670f2ff27354a1e87d0a01bf61f3307f4ccd358b5\",\"blockHeight\":612251,\"confirmations\":22670,\"minerId\":null,\"txSecondMempoolExpiry\":0}",
    "signature": null,
    "publicKey": null
}

Get a transaction's status from a specific transaction processor using the txStatusUrl provided with each quote in Fee quotes response.

HTTP Request

GET https://api.whatsonchain.com/v1/bsv/<network>/mapi/<providerId>/tx/<hash>

URL Parameters

Parameter Description
network Selected network: main
providerId Unique providerId from the Fee quotes response
hash The hash/txId of the transaction

Search

curl -X POST https://api.whatsonchain.com/v1/bsv/main/search/links   -H 'Content-Type: application/json' -d '{    "query": "1GJ3x5bcEnKMnzNFPPELDfXUCwKEaLHM5H"
}'

Response JSON structure:

{
    "results": [
        {
            "type": "address",
            "url": "https://whatsonchain.com/address/1GJ3x5bcEnKMnzNFPPELDfXUCwKEaLHM5H"
        }
    ]
}   

This endpoint identifies whether the posted query text is a block hash, txid or address and responds with WoC links. Ideal for extending customized search in apps.

HTTP Request

POST https://api.whatsonchain.com/v1/bsv/<network>/search/links

URL Parameters

Parameter Description
network Selected network: main , test or stn
address address

Request Body

Parameter Description
query Text to search

On Chain Data

Coming Soon... Stay tuned!!

Get OP_RETURN data by tx hash

Coming Soon... Stay tuned!!

Stats

Coming Soon... Stay tuned!!

WebSockets

Coming Soon... Stay tuned!!

Change log

Community Libraries

Awesome community-maintained libraries

       .---.                   .---.
   .---|___|           .-.     |~~~|
.--|===| B |_          |_|     |~~~|--.
|  |===| I |'\     .---!~|  .--|   |--|
|  |   | T |.'\    |===| |--|%%| W |  |
|  |   | C |\.'\   | S | |__|  | O |py|
|go|   | O | \  \  |===| |==|  | C |  |
|  |   | I |  \.'\ | V |_|__|  |~~~|__|
|  |===| N |   \.'\|===|~|--|%%|~~~|--|
^--^---'---^    `-'`---^-^--^--^---'--' 

Golang

Description Link
Go Wrapper for WOC API by MrZ GitHub
Go Wrapper for bitcoin RPC by Simon Ordish GitHub

Python

Description Link
Python3 Wrapper for WOC API by AustEcon GitHub

Node.js

Description Link
Example: How to verify merkle proofs by Simon Ordish Gist