Bitcoin

Authentication

Requesting a blockit resource requires authentication.

Request path: http://blockit.top/api/cloud/auth?auth_key=x

Parameter Description: auth_key consists of three parameters:

  1. accessId user can get in the background management page
  2. Timestmap timestamp
  3. Md5('accessId-accessKey-timestamp') md5 value of three parameters

E.g:

accessId = 'accessId'
accessKey = 'accessKey'
Timestamp = 1540000000
Strmd5 = md5('accessId-accessKey-1540000000') // '425164b33963021ad34f40b7a2ff143d'
Auth_key = 'accessId-1540000000-425164b33963021ad34f40b7a2ff143d'

Return results:

{
    "code": 0,
    "data": {
        "auth": "b5753b811cab571cdda9583651643238"
    },
    "msg": ""
}

The auth field needs to be filled in Authorization which is in the header of all access resource HTTP requests.

Query Bitcoin Address UTXO

Request path: http://btc.blockit.top/api/address/utxo/{addr0, addr1}

Request example: http://btc.blockit.top/api/address/utxo/3Nxwenay9Z8Lc9JBiywExpnEFiLp6Afp8v

Return results:

{
    "code": 0,
    "data": {
        "has_next": true,
        "has_prev": false,
        "page": 1,
        "pages": 31,
        "per_page": 5,
        "total": 155,
        "utxos": [
            {
                "address": "3Nxwenay9Z8Lc9JBiywExpnEFiLp6Afp8v",
                "height": 383872,
                "outputIndex": 0,
                "satoshis": 100000,
                "script": "a914e95dbb25283cc35d4a6aefa76c0382e63ce0fa3687",
                "txid": "dfe6291b13bd236257dab7baef90b160da085717fc04807b4cbb4ca60ea62f2c"
            }
        ]
    }
}

Query Bitcoin Address Balance

Request path: http://btc.blockit.top/api/address/balance/{addr0, addr1}

Request example: http://btc.blockit.top/api/address/balance/3Nxwenay9Z8Lc9JBiywExpnEFiLp6Afp8v

Return results:

{
    "code": 0,
    "data": {
        "balance": 10784828504252,
        "received": 78428890504252
    },
    "msg": ""
}

Query Bitcoin Address Transaction History

Request path: http://btc.blockit.top/api/address/utxo/{addr0, addr1}

Request example: http://btc.blockit.top/api/address/tx/18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX?sh=500010&eh=500030

Return results:

{
    "code": 0,
    "data": [
        "9d62709a039579c04d5c1a81a5b60792e0024a85bf02fd0e5c261953a07c39c5",
        "a96c872a13f4b20b756154742709d5cead2a3dbd9686cff28e75046376c00167",
        "6d8663eb22c3c5355d3de73081df1ad7fb0f4b5e79ed158f1d3ea3eaeb0f6453",
        "0dfbb7644d58b13a2921bfa658acd82a77ecc8c51457a0018dab4801c8691cf1",
        "f34b702245c0aac8f3c15c4ac4f3d7a2bf70324872ee8b14cab10e6f767edeb3"
    ],
    "msg": ""
}

Universal Error Code

Error Code Meaning
10000 Authentication failure
50000 Service Overload

Bitcoin-sv(BSV)

You only need to modify the domain name btc.blockit.top to bsv.blockit.top to access the bsv related interface.

Will support more public chain APIs soon

Links
Contact Us