Bitcoin Cash
Bitcoin cash endpoints
Supported methods for Bitcoin Cash. Please note that to use these methods you must specify both the API token, bch
in this case, and the network on which you want to make the call. For example, if you want to know the balance of a Bitcoin Cash address in the main network, the corresponding endpoint is as follows: http://server/bch/mainnet/getAddressBalance
Return the balance of any address
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
POST /getAddressBalance HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 56
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
}
Successful response
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"balance": {
"confirmed": "10000",
"unconfirmed": "0"
}
}
Return the balance of an array of addresses
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
POST /getAddressesBalance HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 60
{
"addresses": [
"tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
]
}
Successful response
[
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"balance": {
"confirmed": "10000",
"unconfirmed": "0"
}
}
]
Return the transaction history of any address
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
POST /getAddressHistory HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 56
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
}
Successful response
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"txHashes": [
"b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435"
]
}
Return the transaction history of the given addresses
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
POST /getAddressesHistory HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 60
{
"addresses": [
"tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
]
}
Successful response
[
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"txHashes": [
"b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435"
]
}
]
Returns latest block hash and index
POST /getHeight HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 2
{}
{
"latestBlockHash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"latestBlockIndex": "1"
}
Returns the information of any block giving its hash. If verbosity is 0, it returns a string that is serialized, hex-encoded data for block hash. If verbosity is 1, it returns an object with information about the block. If verbosity is 2, it returns an Object with information about the block and each transaction
Bitcoin block hash
217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d
Level of information returned
2
Example: 0
Possible values: POST /getBlockByHash HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 94
{
"blockHash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"verbosity": 0
}
{
"block": {
"hash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"previousblockhash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"nextblockhash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"height": 1,
"nonce": 1,
"nTx": 123,
"confirmations": "5",
"weight": 13123,
"version": 1,
"versionHex": "0x1",
"strippedsize": 54354,
"bits": "207fffff",
"difficulty": 4.656542373906925e-10,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000e9e",
"time": 1641234640,
"mediantime": 1641234640,
"txs": [
{
"hash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"version": 1,
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff05024e070101ffffffff025fa0120000000000160014816e2d40fa18229712228743990670f1f8e0a9fd0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"size": 54354,
"vsize": 54354,
"weight": 13123,
"locktime": 0,
"blockHash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"confirmations": "5",
"blockTime": 1641234640,
"time": 1641234640,
"vin": {
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"vout": 0,
"sequence": 4294967293,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinWitness": [
"30440220736e93615d002848553e4db94331a7a8a7a1e46531af7c6bec8fcbf6ec2d5017022024ef3164704f850a60b96f1bb680903c602537b2b30b6ba9c941db96781626c501",
"023b43d1a6879cc98325d4c79e9169fd5ddaa7f964626c297be3c8e8fdca4d8bc0"
]
},
"vout": {
"value": "100000",
"n": 1,
"scriptPubKey": {
"asm": "0 816e2d40fa18229712228743990670f1f8e0a9fd",
"hex": "0014816e2d40fa18229712228743990670f1f8e0a9fd",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": [
"tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
]
}
}
}
]
}
}
Returns the information of any block giving its height. If verbosity is 0, it returns a string that is serialized, hex-encoded data for block hash. If verbosity is 1, it returns an object with information about the block. If verbosity is 2, it returns an Object with information about the block and each transaction
Bitcoin block height. Supports the param latest to get the last block of the chain. The param can be in decimal or hexadecimal format
1
Level of information returned
2
Example: 0
Possible values: POST /getBlockByNumber HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 33
{
"blockNumber": "1",
"verbosity": 0
}
{
"block": {
"hash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"previousblockhash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"nextblockhash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"height": 1,
"nonce": 1,
"nTx": 123,
"confirmations": "5",
"weight": 13123,
"version": 1,
"versionHex": "0x1",
"strippedsize": 54354,
"bits": "207fffff",
"difficulty": 4.656542373906925e-10,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000e9e",
"time": 1641234640,
"mediantime": 1641234640,
"txs": [
{
"hash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"version": 1,
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff05024e070101ffffffff025fa0120000000000160014816e2d40fa18229712228743990670f1f8e0a9fd0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"size": 54354,
"vsize": 54354,
"weight": 13123,
"locktime": 0,
"blockHash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"confirmations": "5",
"blockTime": 1641234640,
"time": 1641234640,
"vin": {
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"vout": 0,
"sequence": 4294967293,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinWitness": [
"30440220736e93615d002848553e4db94331a7a8a7a1e46531af7c6bec8fcbf6ec2d5017022024ef3164704f850a60b96f1bb680903c602537b2b30b6ba9c941db96781626c501",
"023b43d1a6879cc98325d4c79e9169fd5ddaa7f964626c297be3c8e8fdca4d8bc0"
]
},
"vout": {
"value": "100000",
"n": 1,
"scriptPubKey": {
"asm": "0 816e2d40fa18229712228743990670f1f8e0a9fd",
"hex": "0014816e2d40fa18229712228743990670f1f8e0a9fd",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": [
"tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
]
}
}
}
]
}
}
Returns True if blocks are syncing and returns False if theres no synchronization or is fully sychronize
POST /syncing HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 2
{}
{
"syncing": false,
"syncPercentage": "6.905658629231632%",
"currentBlockIndex": "1",
"latestBlockIndex": "1"
}
Returns the information of any transaction, giving its transaction hash
Bitcoin Cash transaction hash
b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435
POST /getTransaction HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 77
{
"txHash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435"
}
Response succesfull
{
"transaction": {
"txId": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"txHash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"blockNumber": "3",
"fee": "1000",
"inputs": {
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"amount": "text"
},
"outputs": {
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"amount": "text"
},
"data": {
"hash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"version": 1,
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff05024e070101ffffffff025fa0120000000000160014816e2d40fa18229712228743990670f1f8e0a9fd0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"size": 54354,
"vsize": 54354,
"weight": 13123,
"locktime": 0,
"blockHash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"confirmations": "5",
"blockTime": 1641234640,
"time": 1641234640,
"vin": {
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"vout": 0,
"sequence": 4294967293,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinWitness": [
"30440220736e93615d002848553e4db94331a7a8a7a1e46531af7c6bec8fcbf6ec2d5017022024ef3164704f850a60b96f1bb680903c602537b2b30b6ba9c941db96781626c501",
"023b43d1a6879cc98325d4c79e9169fd5ddaa7f964626c297be3c8e8fdca4d8bc0"
]
},
"vout": {
"value": "100000",
"n": 1,
"scriptPubKey": {
"asm": "0 816e2d40fa18229712228743990670f1f8e0a9fd",
"hex": "0014816e2d40fa18229712228743990670f1f8e0a9fd",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": [
"tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
]
}
}
}
}
}
Returns the information of an array of transaction, giving its transactions hash
Bitcoin Cash transaction hash
b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435
POST /getTransactions HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 81
{
"txHashes": [
"b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435"
]
}
Response succesfull
{
"transactions": [
{
"txId": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"txHash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"blockNumber": "3",
"fee": "1000",
"inputs": {
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"amount": "text"
},
"outputs": {
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"amount": "text"
},
"data": {
"hash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"version": 1,
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff05024e070101ffffffff025fa0120000000000160014816e2d40fa18229712228743990670f1f8e0a9fd0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"size": 54354,
"vsize": 54354,
"weight": 13123,
"locktime": 0,
"blockHash": "217ba61bc3921764a218f4607a8905108d2dfa4bb8e6e10af61d06e279fa069d",
"confirmations": "5",
"blockTime": 1641234640,
"time": 1641234640,
"vin": {
"txid": "e8966afcca05dfe8e2fa282658835dcfa9e07eb5ea4eef041fd52dfd7d324992",
"vout": 0,
"sequence": 4294967293,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinWitness": [
"30440220736e93615d002848553e4db94331a7a8a7a1e46531af7c6bec8fcbf6ec2d5017022024ef3164704f850a60b96f1bb680903c602537b2b30b6ba9c941db96781626c501",
"023b43d1a6879cc98325d4c79e9169fd5ddaa7f964626c297be3c8e8fdca4d8bc0"
]
},
"vout": {
"value": "100000",
"n": 1,
"scriptPubKey": {
"asm": "0 816e2d40fa18229712228743990670f1f8e0a9fd",
"hex": "0014816e2d40fa18229712228743990670f1f8e0a9fd",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": [
"tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
]
}
}
}
}
]
}
Watch an address. Everytime the address changes, a http POST is sent to the URL.
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
Endpoint to make callback
http://localhost:8080/path
POST /notify HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 104
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"callBackEndpoint": "http://localhost:8080/path"
}
Response succesfull
{
"success": true
}
Returns the number of pending or confirmed transactions an address has made
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
Get pending or confirmed transactions
true
POST /getAddressTransactionCount HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 71
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"pending": true
}
Response succesfull
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"transactionCount": "12"
}
Returns the number of pending or confirmed transactions several addresses have made
POST /getAddressesTransactionCount HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 87
{
"addresses": [
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"pending": true
}
]
}
Response succesfull
[
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"transactionCount": "12"
}
]
Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within "confirmations" blocks if possible and return the number of blocks for which the estimate is valid.
Number of confirmations, or -1 if the block is not on the main chain
5
POST /getFeePerByte HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 21
{
"confirmations": "5"
}
Response succesfull
{
"feePerByte": "1000"
}
Returns the UTXO list of any address
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
POST /getAddressUnspent HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 56
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
}
Successful response
[
{
"txHash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"vout": "0",
"status": {
"confirmed": true,
"blockHeight": "1"
},
"value": "100000"
}
]
Returns the UTXO list of the given addresses
Bitcoin Cash address
tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp
POST /getAddressesUnspent HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 46
[
"tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp"
]
Successful response
[
{
"address": "tb1qm0xyymv7s07rn00dcpuk2ln890sr3my3cmpfdp",
"outputs": [
{
"txHash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"vout": "0",
"status": {
"confirmed": true,
"blockHeight": "1"
},
"value": "100000"
}
]
}
]
Returns raw schema of any transaction. If verbosity is set to true, transaction object is returned, otherwise raw transaction will be returned
Bitcoin Cash transaction hash
b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435
Level of information returned
false
Example: false
POST /getTransactionHex HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 95
{
"txHash": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435",
"verbosity": false
}
Response succesfull
{
"rawTransaction": "01000000000101c0d72dcba53996705fff03465f23b594ec934c29a7645045abe07385a58470a101000000171600140e2c5153cf335a150df44013c4572cd52a70aa8bfdffffff020100000000000000165114391234a573b02814f03ff59673c86b68c2869537091839000000000017a914004863ca1a414c0a174b2666bf067c69524aabd4870247304402201cc95f4683cf0fc46923b1a7f78454adbd57150268ab4960efd3c7df6fc83e22022035917f815bfd80052812b8b1559d314f2459e5876abe9bf1b36f8d4e0dda6e0e012102c379336fce4796dc9bbaa953ef5003e070853b2bf53bdf00b9cfb83e3e1ef84f00000000"
}
Broadcasts a transaction to the network
Raw transaction (Hex format)
01000000000101c0d72dcba53996705fff03465f23b594ec934c29a7645045abe07385a58470a101000000171600140e2c5153cf335a150df44013c4572cd52a70aa8bfdffffff020100000000000000165114391234a573b02814f03ff59673c86b68c2869537091839000000000017a914004863ca1a414c0a174b2666bf067c69524aabd4870247304402201cc95f4683cf0fc46923b1a7f78454adbd57150268ab4960efd3c7df6fc83e22022035917f815bfd80052812b8b1559d314f2459e5876abe9bf1b36f8d4e0dda6e0e012102c379336fce4796dc9bbaa953ef5003e070853b2bf53bdf00b9cfb83e3e1ef84f00000000
POST /broadcastTransaction HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 513
{
"rawTransaction": "01000000000101c0d72dcba53996705fff03465f23b594ec934c29a7645045abe07385a58470a101000000171600140e2c5153cf335a150df44013c4572cd52a70aa8bfdffffff020100000000000000165114391234a573b02814f03ff59673c86b68c2869537091839000000000017a914004863ca1a414c0a174b2666bf067c69524aabd4870247304402201cc95f4683cf0fc46923b1a7f78454adbd57150268ab4960efd3c7df6fc83e22022035917f815bfd80052812b8b1559d314f2459e5876abe9bf1b36f8d4e0dda6e0e012102c379336fce4796dc9bbaa953ef5003e070853b2bf53bdf00b9cfb83e3e1ef84f00000000"
}
Response succesfull
{
"broadcasted": "b66d096bcb068888d4a6987870647ba9c9d2f1da9e360ddafc73efe1f26f2435"
}
Last updated