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:

{
    "bestblockhash": "00000000000000000527e504cabf6ae699e5d895cdfdb6150810d3fcd59d695c",
    "bip9_softforks": {
        "csv": {
            "since": 419328,
            "startTime": 1462060800,
            "status": "active",
            "timeout": 1493596800
        }
    },
    "blocks": 579072,
    "chain": "main",
    "chainwork": "000000000000000000000000000000000000000000df826cd0b53300378d0a8a",
    "difficulty": 102342217616.7564,
    "headers": 578817,
    "mediantime": 1555842446,
    "pruned": false,
    "softforks": [
        {
            "id": "bip34",
            "reject": {
                "status": true
            },
            "version": 2
        },
        {
            "id": "bip66",
            "reject": {
                "status": true
            },
            "version": 3
        },
        {
            "id": "bip65",
            "reject": {
                "status": true
            },
            "version": 4
        }
    ],
    "verificationprogress": 0.9999969170988151
}

This endpoint retrives 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

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 heigh.

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:

{
    "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": 2,
    "time": 1553501874,
    "blocktime": 1553501874
}

This endpoint retrieves transaction details with given transaction hash

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.

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

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

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 retrives 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": {
        "ancestorcount": 9,
        "ancestorfees": 1728,
        "ancestorsize": 1725,
        "currentpriority": 0,
        "depends": [
            "e0bf803ba3f9f68716d55cec7b844a1c70c578e1c0f4f1be528b883bc95b2dbe"
        ],
        "descendantcount": 2,
        "descendantfees": 384,
        "descendantsize": 384,
        "fee": 0.00000192,
        "height": 579400,
        "modifiedfee": 0.00000192,
        "size": 192,
        "startingpriority": 0,
        "time": 1556045283
    },
    "195c95162a7f73f2ff9d4a5d8894f63ec44712b3b69fe1c3e53464048c6a39e3": {
        "ancestorcount": 1,
        "ancestorfees": 75735,
        "ancestorsize": 75730,
        "currentpriority": 2178.585916165125,
        "depends": [],
        "descendantcount": 1,
        "descendantfees": 75735,
        "descendantsize": 75730,
        "fee": 0.00075735,
        "height": 579400,
        "modifiedfee": 0.00075735,
        "size": 75730,
        "startingpriority": 2178.585916165125,
        "time": 1556045312
    },
    ...
}

This endpoint retrives list of trsnsation 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 retrives various address info.

HTTP Request

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

URL Parameters

Parameter Description
network Selected network: main , test or stn
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 retrives 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 , test or stn
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 retrives 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 , test or stn
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 retrives 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 , test or stn
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 , test or stn
address address

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 reponds 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