SVDB

This API lets developers send queries to examine the blockchain. This API is currently free and limited to 10,000 queries per day.

Get a free token

Param Type Required Description
appid string YES Application ID
appsecret string YES Application secret key

Success:

Note: "code" here is the error response code. 0 means success

{
  "code": 0,
  "msg": "",
  "data": "xxxxxxxxxxxxxxxxxxxxx"
}

Return params description:

Param Type Description
data string token

Check remaining queries

Check how many queries you can still make with your free token

Param Type Required Description
token string YES Access token

Success:

{
  "code": 0,
  "msg": "",
  "data": 1000
}

Return params description:

Param Type Description
data int Remaining queries

Query merkle-tree

Query a transaction's merkle-tree path using it's txid

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
txid string YES The transaction's txid

Success:

{
  "code": 0,
  "msg": "",
  "data": {
    "txs": 156,
    "hashes": [
      "7ae2ab185a6e501753f6e29e5b6a98ba040098acb7c11ffed9430f22ed5263a3",
      "cf2a9a7d357a90dc1aad8740f45c60f5f6b878c198153be197a76486382546d2",
      "95843caf747674b117111bd850ffdf8ae2b0297618d7cd5227c65ff11978c15e",
      "c96833b5711cdcd1c615b1b037618bbd8f9cea57d147768e94b2e32a190dba6b",
      "637f452dbceaca1f184ebc385ac675d40e0fc2cca1d5cafa9a908ce3b62e9290",
      "5a0bc3772c7510405781b4856085eb9f2f3ccfa5a7c67830f7b6d64d15a056b1",
      "b1918268ba355b551fee2e55292f48292a2b7ff8bbc951a7acb6db97d8223765",
      "e4eaecd1de4594749a816042d7d80d66c64d5b801f0830e726874aab8345233a",
      "e64e32e120aced23171e71f99b56bcea3d24e5d18a475792fbe3d41cebb31c76"
    ],
    "flags": "ff0200",
    "blockhash": "000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214"
  }
}

Return params description:

Param Type Description
txs int The number of transactions in the block containing the transaction
flags string The hex-encoded bip37 flag, used with the hash array to calculate the mekle root
blockhash string The block hash
hashes array The hashes along the merkle tree path

Query block header

Get the raw block header using a block's hash

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
blockhash string YES The block's hash

Success:

{
  "code": 0,
  "msg": "",
  "data": "02000000028f2cb75e0b6b2bcaba83efa34cb6af4a7bc04e882de8c2090000000000000023d7fee87f54bfb980f383b80742ac060bb5294ff9cb82d159caa8acaf1eec1647f9fc51f2db721961769100"
}

Return params description:

Param Type Description
data string Block header (hex)

Query a transaction

Query a transaction by it's txid

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
txid string YES The transaction's txid

Success:

{
  "code": 0,
  "msg": "",
  "data": {
    "txid": "016a195a865e57a24d2f606aef89d8775ed2f8ae9016419542b9ad798574f6f6",
    "vins": [
      {
        "index": 0,
        "script": "4730440220493447148876bb55b63712c93004384ad0e0b35500ce96949751682afe8e7d4d022050ff787468c73a3ca51207a93805e96de032a2fa2a6fd8a0153c5d99daf92ae6412103396952494b704fd57dbadfb22951c83f700f6dba06d6bcc32da608d4807067e8",
        "value": 1110213
      },
      {
        "index": 1,
        "script": "4730440220449daee99fd72d026864fa084ec5a338be4e3c355ff3a7f6d01951c25957b6b702200fe26fb621da1c2df8d870a5bf6029bb6fb775a58c320f5589e90fb7039bbdf5412102e44bf284602e8d6b3cd2492c783a03ee44cd6965c3f91c07f6c2bbe9d8c6ff46",
        "value": 3602800
      },
      {
        "index": 2,
        "script": "483045022100c3d55580d62ac027676e5d352be4cc710051726c68d5ff76085682dd4b3636fb02203b5ff2f5b298a42efbabde5273efda8329547de469f32279cae25d5b3984edfd41210286f4ff4da872b42529007bbbfe6bef8368b601874f6e34610028d7e54614c0a4",
        "value": 1424703
      },
      {
        "index": 3,
        "script": "473044022047ae5c1c2ac3211418708141633fe6952f8dd8e7d9baa878d2323323f25c3c38022076af30794eabb63dc9d840152c1b29921adeb67c93e8eb39efaa246367524492412102b25439ce52f3b0114575afc12dccffa0583f911a5d99a569d1c3aacb808f0c1c",
        "value": 254000
      },
      {
        "index": 4,
        "script": "483045022100d9522a1e107375b184459091855c36c0a2fff577d9270ca140c4f6a253986a1e02200cd4934de777f188fe5d85fc8bbe111569c58b48cb46c0b3cfdc7efad8ce802841210248b88693adf60fbce82045a6885ceba6840d0977f1a64c3504a76a63b024574c",
        "value": 144110712
      }
    ],
    "vouts": [
      {
        "index": 0,
        "script": "76a9142fa431e514155b7d36955a7b204aca593043128288ac",
        "value": 149500000
      },
      {
        "index": 1,
        "script": "76a914cb13d2b179851b7b37a34763a698fabfe401c7bf88ac",
        "value": 1001610
      }
    ],
    "height": 625876,
    "size": 815,
    "timestamp": 1583995981,
    "confirmation": 6
  }
}

Return params description:

Param Type Description
vouts json All of the vouts
vins json All of the vins
index int vin or vout index
confirmation int Number of confirmations
timestamp int Timestamp
size int Transaction size (unit: bytes)
value int Transaction amount (unit: satoshis)
script string rawhex script
txid string Transaction ID
height int Blockheight (-1 means unconfirmed)

Query address info

Query an address' transactions amount and remaining balance. Only p2pkh addresses are supported.

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
address string YES Bitcoin SV address

Success:

{
  "code": 0,
  "msg": "",
  "data": {
    "transactions": 161,
    "balance": 10000000000
  }
}

Return params description:

Param Type Description
transactions int Number of transactions this address has been involved in
balance int Address remaining balance

Query address UTXO

Inpect an address' utxo. Only p2pkh addresses are supported.

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
address string string Bitcoin SV address
offset int int Query offset. Example: [1,2,3,4,5] offset: 2, limit: 3 result: [3,4,5]
limit int int Limit on number of results (max 100)

Success:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "value": 10000000000,
      "txid": "35f81304c4966b3be6ee750069071005810c2006adf962bbca368840f7561581",
      "index": 3,
      "height": 625881,
      "sigscript": "dqkUEqpEM1Ja8xNPxBD/Uu7TcZLllEeIrA=="
    }
  ]
}

Return params description:

Param Type Description
txid string The transaction ID
index int Index of the utxo (order out of outputs)
height int Blockheight (-1 means unconfirmed)
value int Transaction value (unit: satoshis)
sigscript string utxo script

Query address transaction records

Query an address' transactions by looking up its address. Only p2pkh addresses are supported.

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
address string string Bitcoin SV address
offset int int Query offset. Example: [1,2,3,4,5] offset: 2, limit: 3 result: [3,4,5]
limit int int Limit on number of results (max 100)

Success:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "txid": "b064989072bab185984b0106b7f7d3588083f2e2e148a5eb4000f554c9508f66",
      "value": -10000000000,
      "height": -1
    },
    {
      "txid": "35f81304c4966b3be6ee750069071005810c2006adf962bbca368840f7561581",
      "value": 10000000000,
      "height": 625881
    },
    {
      "txid": "24c4c256cc609596af588fd68100c2ca97f5b8fdea7bbce8f510e9ce4ee6d9ee",
      "value": -10000000000,
      "height": 625852
    }
  ]
}

Return params description:

Param Type Description
txid string The transaction ID
height int Blockheight (-1 means unconfirmed)
value int Transaction value (unit: satoshis)
sigscript string utxo script

Query block info by block hash

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
hash string string Block hash

Success:

{
  "code": 0,
  "msg": "",
  "data": {
    "height": 625882,
    "reward": 1250601893,
    "timestamp": 1583999952,
    "transaction_count": 1771,
    "size": 1015875,
    "hex_coinbase": "03da8c092f68747470733a2f2f636f696e6765656b2e636f6d2f6d696e65722d6f757472656163682f2f4b37633144d892a7db975fcb22337800c0",
    "hash": "0000000000000000017d4326a7232eaefde92465ae77d762c6d1892914e5f0e5"
  }
}

Return params description:

Param Type Description
height int Block height
hash string Block hash
size int Block size (unit: bytes)
timestamp int timestamp
reward int Block reward (unit: satoshis)
hex_coinbase string hex script
transaction_count int Transaction count

Query block info by block height

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
height int int Block height

Success:

{
  "code": 0,
  "msg": "",
  "data": {
    "height": 625882,
    "reward": 1250601893,
    "timestamp": 1583999952,
    "transaction_count": 1771,
    "size": 1015875,
    "hex_coinbase": "03da8c092f68747470733a2f2f636f696e6765656b2e636f6d2f6d696e65722d6f757472656163682f2f4b37633144d892a7db975fcb22337800c0",
    "hash": "0000000000000000017d4326a7232eaefde92465ae77d762c6d1892914e5f0e5"
  }
}

Return params description:

Param Type Description
height int Block height
hash string Block hash
size int Block size (unit: bytes)
timestamp int timestamp
reward int Block reward (unit: satoshis)
hex_coinbase string hex script
transaction_count int Transaction count

Bulk query block info by block height

Returns a list of blocks' block info in descending order (from smallest height to largest).

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
offset int YES Query offset. Example: [1,2,3,4,5] offset: 2, limit: 3 result: [3,4,5]
limit int YES Limit on number of results (max 100)

Success:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "height": 625890,
      "reward": 1250171398,
      "timestamp": 1584005058,
      "transaction_count": 782,
      "size": 284711,
      "hex_coinbase": "03e28c0904b8ff695e322f537069646572506f6f6c2ffabe6d6dda153ebb0e68d606ba543955fc4aece1fa6ebf31c8dec55114914bb4cfc20a2401000000000000000100076acb69000000000000",
      "hash": "00000000000000000080a268f9d00b7e05a3362884cd525fa540308205af8e04"
    },
    {
      "height": 625889,
      "reward": 1250319195,
      "timestamp": 1584004809,
      "transaction_count": 802,
      "size": 368455,
      "hex_coinbase": "03e18c0904c9fe695e088100079a7606000057617270486173685c30",
      "hash": "00000000000000000226910abdfddb05cea178e3eb7f9086b8600a9970fecd9c"
    }
  ]
}

Return params description:

Param Type Description
height int Block height
hash string Block hash
size int Block size (unit: bytes)
timestamp int timestamp
reward int Block reward (unit: satoshis)
hex_coinbase string hex script
transaction_count int Transaction count

Get a list of a block's transactions

Param Type Required Description
token string YES Access token
  • Body params(JSON):
Param Type Required Description
hash string Block hash
offset int YES Query offset. Example: [1,2,3,4,5] offset: 2, limit: 3 result: [3,4,5]
limit int YES Limit on number of results (max 100)

Success:

{
  "code": 0,
  "msg": "",
  "data": [
    "4ef83acd026495adff7dfb276bfaf271b0e6ba6c2bc462ef105dd8e1c5fc29f4",
    "9de197b307f650835765150bff25220408eb6d2d753990645d38bd085ff72053",
    "1d6982b15f828b77f48146cee3f4f8a4658c0a9dce287e59b27dc14ee9654780",
    "51679f5421403d13b204827f5e09f0c1316a311645f850ec925007d6ae135fe4",
    "81a95fab656ca6fe6060d9d202419e00a34c400d3c8215b33ec06e5f10a4b033"
  ]
}

Return params description:

Param Type Description
data array The transaction list, an array of txids

Get basic info about the blockchain

Get basic info about the BSV blockchain.

Param Type Required Description
token string YES Access token

Success:

{
  "code": 0,
  "msg": "",
  "data": {
    "bestblock": 625891,
    "unconfirm_tx_count": 37525,
    "bestfeerate": {
      "feebyte": 1,
      "feesatoshi": 1
    },
    "hashes_per_sec": 2829162.275754181,
    "diffculty": 415922505851.8293
  }
}

Return params description:

Param Type Description
bestblock int Newest block
unconfirm_tx_count int Number of unconfirmed transactions
bestfeerate json The current best fee rate. As a ratio between bytes to satoshis. BTC is around 4:5, BSV should be set at 1:1
feebyte int Bytes in the byte:satoshi ratio
feesatoshi int Satoshis in the byte:satoshi ratio
hashes_per_sec float The hash rate
diffculty float Mining difficulty