Your applications can access the data of Bitcoin network via the API provided by CloverPool.
- Telegram: https://t.me/btccomchinese
- Twitter: https://twitter.com/btccom_official
- Discord: https://discord.com/invite/R8HzUvg2eR
- Mail: support@connectbtc.com
- BTC https://tools.api.cloverpool.com/docs/en#overview
- BCH https://bch-chain.api.cloverpool.com
- LTC https://ltc-chain.api.cloverpool.com
Some API calls can handle multiple parameters. For instance, if you request information about a couple of blocks, you can send one API call for all of them. Parameter delimiter is a comman(,).
So instead of doing there separate API calls:
GET /block/1
GET /block/2
GET /block/3
All the response types are application/json
, as follows:
{
"data": ...,
"err_no": 0,
"err_msg": null
}
data
,API Response dataerror_no
Error Number- 0 OK
- 1 Resource Not Found
- 2 Parameter Error
error_msg
Error Message
Block {
height: int
version: int
mrkl_root: string
curr_max_timestamp: int
timestamp: int
bits: int
nonce: int
hash: string
prev_block_hash: string, null if not exists
next_block_hash: string, null if not exists
size: int
pool_difficulty: int
difficulty: int
tx_count: int
reward_block: int
reward_fees: int
created_at: int
confirmations: int
extras: {
relayed_by: string
}
}
Due to the timestamp
recorded in blocks is not increasing strictly with height, we added curr_max_timestamp
field for the max timestamp of blocks, which ensures that the timestamp is not less than the previous block timestamp when the blocks are generated. Some API will use the field to record the date, such as the API accessing block lists by date.
Transaction {
block_height: int
block_time: int
created_at: int
fee: int
hash: string
inputs: [
{
"prev_addresses": Array<String>
"prev_position": int
"prev_tx_hash": string
"prev_value": int
"script_asm": string
"script_hex": string
"sequence": int
},
],
inputs_count: int
inputs_value: int
is_coinbase: boolean
lock_time: int
outputs: [
{
addresses: Array<String>
value: int
}
],
outputs_count: int
outputs_value: int
size: int
version: int
}
Since the size of some transactions is large, the API related to the transactions supports the rating output of transaction info, such as ${ENDPOINT}/block/latest/tx?verbose=2
.
The verbose
is optional and its 2 defaultly. The different output level has its own meaning:
-
Level 1: including transaction info
-
Level 2: including level 1, input, output and balance
-
Level 3: including level 2, input, output script and etc.
{
address: string
received: int
sent: int
balance: int
tx_count: int
unconfirmed_tx_count: int
unconfirmed_received: int
unconfirmed_sent: int
unspent_tx_count: int
}
{
tx_hash: string
tx_output_n: int
tx_output_n2: int
value: int
confirmations: int
}
GET /block/{xxx}
xxx
can be:
- Block height
- Block hash
- String
latest
-
Get the 3rd block
-
Get the latest block
-
Get the latest and 3rd Block
Get block list by date.
GET /block/date/{ymd}
-
Get block list on 12/15/2015
Batch request is not supported now.
GET /block/{xxx}/tx
Parameters:
page
, optional, default to1
pagesize
,optional, default to50
, min1
, max50
-
Get transactions of Latest block
-
Get transaction of single block
GET /tx/{txhash}
-
Get Single Transaction
${ENDPOINT}/tx/0eab89a271380b09987bcee5258fca91f28df4dadcedf892658b9bc261050d96?verbose=3
GET /tx/unconfirmed
GET /tx/unconfirmed/summary
${ENDPOINT}/tx/unconfirmed/summary
GET /address/{address}
-
Get single address
Batch request is not supported now.
GET /address/{address}/tx
Parameters:
page
, optional, default to1
pagesize
,optional, default to50
, min1
, max50
${ENDPOINT}/address/15urYnyeJe3gwbGJ74wcX89Tz7ZtsFDVew/tx
Batch request is not supported now.
GET /address/{address}/unspent
${ENDPOINT}/address/15urYnyeJe3gwbGJ74wcX89Tz7ZtsFDVew/unspent