Welcome to BlockRead!
Welcome to BlockRead! A blockchain archive, indexer, and UTXO manager dedicated to providing exceptional services for developers and companies working with Bitcoin (BTC), Bitcoin Cash(BCH), and Litecoin(LTC) blockchains.
BlockRead offers a wide range of features, including APIs, sockets, and other developer-friendly tools, designed to streamline your project development process. Our primary goal is to empower developers and companies by offering efficient services that accelerate project development. With BlockRead, you can take advantage of streamlined UTXO management, seamless data transmission to and from supported blockchains, real-time entity monitoring, and effortless application creation.
To access our services and API endpoints for Bitcoin (BTC), Bitcoin Cash (BCH), and Litecoin (LTC), please use the following URL formats:
- Bitcoin (BTC): https://api.blockread.io/btc/docs
- Bitcoin Cash (BCH): https://api.blockread.io/bch/docs
- Litecoin (LTC): https://api.blockread.io/ltc/docs
We are continuously expanding our supported networks, so stay tuned for more updates!
Pricing
Plans(BCH)
Blockread offers a diverse range of flexible pricing plans to meet the unique needs of users. From basic plans ideal for small-scale usage to advanced packages tailored for larger enterprises, Blockread ensures both scalability and affordability.
Plan | Features | Monthly | Yearly |
---|---|---|---|
Free |
|
$0 | $0 |
Basic |
|
$300 | $3300 (1 month free) |
Professional |
|
$500 | $5500 (1 month free) |
Enterprise |
|
Contact us for pricing | Contact us for pricing |
For detailed information on Blockread pricing plans and to discuss a tailored solution that suits your specific requirements, please contact us at [email protected].
Authentication & API Key
To access Blockread API services, users are required to include their unique API key in the request header. For users without an API key, access is limited to 10 transactions per second (TPS) and 1000 daily requests.
curl -X GET "https://api.blockread.io/bch/network/info" -H "apikey: XXXXXXXXXXXXXXXXXXXXXXXXXXX"
The NodeJS example for using the api key in a request.
const request = require('request');
const API_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX';
const ENDPOINT = 'api.blockread.io';
const sampleMethod = `https://${ENDPOINT}/bch/network/info`;
const requestOptions = {
url: sampleMethod,
headers: {
apikey: API_KEY,
},
};
request.get(requestOptions, (err, resp, body) => {
if (err) {
console.log(err);
}
if (resp.statusCode !== 200) {
console.log(resp.statusCode);
}
console.log("Response Body:", body);
});
Swagger
The Swagger is available for the main nets.
BTC: https://btc.blockread.io/swagger
BCH: https://bch.blockread.io/swagger
LTC: https://ltc.blockread.io/swagger
Scripthash
This section covers scripthash API, find the documentation regarding sockets on scripthashes in the 'Socket' section.
Get Unspent of Scripthash
# 9421c806a8f3fd46841241659637d75b944b42af61fabe7b9359349bc50d2ea6
curl `https://api.blockread.io/bch/scripthash/{scripthash}/unspent`
The above command returns JSON structured like this:
[
{
"scripthash": "9421c806a8f3fd46841241659637d75b944b42af61fabe7b9359349bc50d2ea6",
"unspent": [
{
"txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
"vout": 1,
"satoshis": 3522,
"time": "1645960789",
"confirmations": 200,
}
]
}
]
This endpoint retrieves unspent outputs(UTXOs) of a scripthash.
HTTP Request
GET https://api.blockread.io/bch/scripthash/{scripthash}/unspent
Parameter | Description |
---|---|
scripthash | |
from | |
limit |
Get Unspent of Multiple Scripthashes
curl --location --request POST `https://api.blockread.io/bch/scripthash/unspent/multi` \
--header "Content-Type: application/json" \
--data "{\"scripthashes\": [\"213fb7922dc20cae6bd1cbf27f708a15fc089efdac632118fc8fb60ef1899630\", \"bbec6039916d01db85a839e06d84d95415515a7d791393128303707e5dd1c211\"]}"
The above command returns JSON structured like this:
[
{
"scripthash": "bbec6039916d01db85a839e06d84d95415515a7d791393128303707e5dd1c211",
"unspent":
[
{
"txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
"vout": 1,
"satoshis": 3522,
"time": "1645960789",
"confirmations": 200,
}
]
},
{
"scripthash": "213fb7922dc20cae6bd1cbf27f708a15fc089efdac632118fc8fb60ef1899630",
"unspent":
[
{
"txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
"vout": 1,
"satoshis": 3522,
"time": "1645960789",
"confirmations": 200,
}
]
}
]
This endpoint retrieves unspent outputs(UTXOs) of a scripthash.
HTTP Request
GET https://api.blockread.io/bch/scripthash/unspent/multi
Parameter | Description |
---|---|
from | |
limit |
Get Balance of Scripthash
# 6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996
curl `https://api.blockread.io/bch/scripthash/{scripthash}/balance`
The above command returns JSON structured like this:
{
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"confirmed": 36453,
"unconfirmed": 1000,
"summary": 37453,
"count":34,
}
This endpoint retrieves the balance of a scripthash.
HTTP Request
GET https://api.blockread.io/bch/scripthash/{scripthash}/balance
Parameter | Description |
---|---|
scripthash |
Get History of Scripthash
# 6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996
curl `https://api.blockread.io/bch/scripthash/{scripthash}/history`
The above command returns JSON structured like this:
[
{
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"histories": [
{
"txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
"inputSatoshis": 2000,
"outputSatoshis": 0,
"time": 1655049588,
}
]
}
]
This endpoint retrieves the history of a scripthash. Note that the inputSatoshis and outputSatoshis refer to the role of the scripthash in the transaction. In other words, when the inputSatoshis is a non-zero value, it means the scripthash was seen in the inputs of the transaction(Spent), and when the outputSatoshis is non-zero, it implies that the scripthash was seen in the output of the transaction(Received).
GET https://api.blockread.io/bch/scripthash/{scripthash}/history
HTTP Request
URL Parameters
Parameter | Description |
---|---|
scripthash | |
pgkey | |
limit | Maximum 5000 |
Scenario Using pgkey
1. The first request has no pgkey - recommended limit=5000
2. The first response includes 5000 history(the set limit) plus one pgkey which acts as a place holder and points to the last served data.
3. in later requests, the pgkey should be sent to the server as well. Each response has a new pgkey which should be used in the next request.
How do we know when we get to the end of the history?
Good question! when you receive a response which has no pgkey anymore, it means you are at the end of the history. It is like you were scrolling a page and now you are at the end.
Get Details of Scripthash
# 6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996
curl `https://api.blockread.io/bch/scripthash/{scripthash}/details`
The above command returns JSON structured like this:
{
"lastSeen":
{
"txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
"inputSatoshis": 0,
"outputSatoshis": 12120,
"time": 1655049588,
},
"firstSeen":
{
"txid": "c3d6c4b466bc369561fa854cab42a6acd89aeeb528c5ffbde83e7a380dfc7914",
"inputSatoshis": 0,
"outputSatoshis": 12120,
"time": 1655049588,
},
"balance":
{
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"confirmed": 36453,
"unconfirmed": 1000,
"summary": 37453,
"count": 34,
},
}
This endpoint retrieves the details of a scripthash.
HTTP Request
GET https://api.blockread.io/bch/scripthash/{scripthash}/details
Parameter | Description |
---|---|
scripthash |
Address
This section covers address API, find the documentation regarding sockets on addresses in the 'Socket' section.
Get Unspent of Address
# qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8
curl `https://api.blockread.io/bch/address/{address}/unspent`
The above command returns JSON structured like this:
{
"address": "qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8",
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"unspent": [
{
"txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
"vout": 1,
"satoshis": 3522,
"time": 1645960789,
"confirmations": 200,
}
]
}
This endpoint retrieves unspent outputs(UTXO) of an address.
HTTP Request
GET https://api.blockread.io/bch/address/{address}/unspent
Parameter | Description |
---|---|
address | |
from | |
limit |
Get Unspent of Multiple Addresses
curl --location --request POST `https://api.blockread.io/bch/address/unspent/multi` \
--header "Content-Type: application/json" \
--data "{\"addresses\": [\"qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8\", \"17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e\"]}"
The above command returns JSON structured like this:
[
{
"address": "qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8",
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"unspent":
[
{
"txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
"vout": 1,
"satoshis": 3522,
"time": 1645960789,
"confirmations": 200,
}
]
},
{
"address": "qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8",
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"unspent":
[
{
"txid": "1f13d03c29ae4e0b996fd72636087247fcb9326dcc28b4852b7ffa7e5180f619",
"vout": 1,
"satoshis": 3522,
"time": 1645960789,
"confirmations": 200,
}
]
}
]
This endpoint retrieves unspent outputs(UTXO) of multiple addresses.
HTTP Request
POST https://api.blockread.io/bch/address/unspent/multi
Parameter | Description |
---|---|
from | |
limit |
Get Balance of Address
# qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8
curl `https://api.blockread.io/bch/address/{address}/balance`
The above command returns JSON structured like this:
{
"address": "qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8",
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"confirmed": 36453,
"unconfirmed": 1000,
"summary": 37453,
"count": 34,
}
This endpoint retrieves the balance of an address.
HTTP Request
GET https://api.blockread.io/bch/address/{address}/balance
Parameter | Description |
---|---|
address |
Get Balance of Multiple Addresses
curl --location --request POST `https://api.blockread.io/bch/address/balance/multi` \
--header "Content-Type: application/json" \
--data "{\"addresses\": [\"qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8\", \"17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e\"]}"
The above command returns JSON structured like this:
{
"confirmed": 36453,
"unconfirmed": 1000,
"summary": 37453,
"count": 34,
}
This endpoint retrieves the balance of multiple addresses.
HTTP Request
POST https://api.blockread.io/bch/address/balance/multi
Get Balance of Multiple Addresses separately
curl --location --request POST `https://api.blockread.io/bch/address/balance/multi/separate` \
--header "Content-Type: application/json" \
--data "{\"addresses\": [\"qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8\", \"1FWQiwK27EnGXb6BiBMRLJvunJQZZPMcGd\"]}"
The above command returns JSON structured like this:
[
{
"confirmed": 36453,
"unconfirmed": 1000,
"summary": 37453,
"count": 34,
"address": "qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8",
},
{
"confirmed": 36453,
"unconfirmed": 1000,
"summary": 37453,
"count": 34,
"address": "1FWQiwK27EnGXb6BiBMRLJvunJQZZPMcGd",
}
]
This endpoint retrieves the balance of multiple addresses separately.
HTTP Request
POST https://api.blockread.io/bch/address/balance/multi/separate
Get History of Address
# qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8
curl `https://api.blockread.io/bch/address/{address}/history`
The above command returns JSON structured like this:
[
{
"address": "qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8",
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"histories": [
{
"txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
"inputSatoshis": 0,
"outputSatoshis": 12120,
"time": 1655049588,
}
]
}
]
This endpoint retrieves the history of an address. Note that the inputSatoshis and outputSatoshis refer to the role of the address in the transaction. In other words, when the inputSatoshis is a non-zero value, it means the address was seen in the inputs of the transaction(Spent), and when the outputSatoshis is non-zero, it implies that the address was seen in the output of the transaction(Received).
HTTP Request
GET https://api.blockread.io/bch/address/{address}/history
Parameter | Description |
---|---|
address | |
pgkey | |
limit | Maximum 5000 |
Scenario Using pgkey
1. The first request has no pgkey - recommended limit=5000
2. The first response includes 5000 history(the set limit) plus one pgkey which acts as a place holder and points to the last served data.
3. in later requests, the pgkey should be sent to the server as well. Each response has a new pgkey which should be used in the next request.
How do we know when we get to the end of the history?
Good question! when you receive a response which has no pgkey anymore, it means you are at the end of the history. It is like you were scrolling a page and now you are at the end.
Get History of Multiple Addresses
curl --location --request POST `https://api.blockread.io/bch/address/history/multi` \
--header "Content-Type: application/json" \
--data "{\"addresses\": [\"qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8\", \"17F5qX7sM88gKtgGqTAXTa53dnbyrSkx6e\"]}"
The above command returns JSON structured like this:
[
{
"txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
"inputSatoshis": 1123,
"outputSatoshis": 0,
"time": 1655049588,
},
{
"txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
"inputSatoshis": 3243,
"outputSatoshis": 0,
"time": 1655049588,
}
]
This endpoint retrieves the history of an address. Note that the inputSatoshis and outputSatoshis refer to the role of the address in the transaction. In other words, when the inputSatoshis is a non-zero value, it means the address was seen in the inputs of the transaction(Spent), and when the outputSatoshis is non-zero, it implies that the address was seen in the output of the transaction(Received).
HTTP Request
POST https://api.blockread.io/bch/address/history/multi
Parameter | Description |
---|---|
from | |
limit |
Get Details of Address
# qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8
curl `https://api.blockread.io/bch/address/{address}/details`
The above command returns JSON structured like this:
{
"lastSeen":
{
"txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
"inputSatoshis": 0,
"outputSatoshis": 12120,
"time": 1655049588,
},
"firstSeen":
{
"txid": "c3d6c4b466bc369561fa854cab42a6acd89aeeb528c5ffbde83e7a380dfc7914",
"inputSatoshis": 1222,
"inputSatoshis": 0,
"time": 1655049588,
},
"balance":
{
"address": "qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8",
"scripthash": "6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996",
"confirmed": 36453,
"unconfirmed": 1000,
"summary": 37453,
"count": 34,
},
}
This endpoint retrieves the details of an address.
HTTP Request
GET https://api.blockread.io/bch/address/{address}/details
Parameter | Description |
---|---|
address |
Transaction
The Transaction API is used to retrieve the details of a transaction, find the documentation regarding sockets on transactions in the 'Socket' section.
Get Input of Transaction
# 08dc0b213989d4ecc13095eb71c3808f7410b1fff73ef9979c41cc9cc7f65df7
curl `https://api.blockread.io/bch/tx/{txid}/input/{inputIndex}`
The above command returns JSON structured like this:
{
"index": 0,
"source": {
"txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
"vout": 0,
"satoshis": 18776,
},
"scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
"sequence": 4294967295,
}
This endpoint retrieves an input of a transaction.
HTTP Request
GET https://api.blockread.io/bch/tx/{txid}/input/{inputIndex}
Parameter | Description |
---|---|
txid | |
index | Input index |
Get Inputs of Transaction
# 6abfefd00f2534e1b7e661a7a094ed0c9ba6469646d9ce497d153362fc693996
curl `https://api.blockread.io/bch/tx/{txid}/inputs/{fromIndex}/{toIndex}`
The above command returns JSON structured like this:
[
{
"index": 0,
"source": {
"txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
"vout": 0,
"satoshis": 18776,
},
"scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
"sequence": 4294967295,
},
{
"index": 0,
"source": {
"txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
"vout": 0,
"satoshis": 18776,
},
"scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
"sequence": 4294967295,
},
{
"index": 0,
"source": {
"txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
"vout": 0,
"satoshis": 18776,
},
"scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
"sequence": 4294967295,
},
]
This endpoint retrieves multiple inputs of a transaction.
HTTP Request
GET https://api.blockread.io/bch/tx/{txid}/inputs/{fromIndex}/{toIndex}
Parameter | Description |
---|---|
txid | |
from | Starting index |
to | Ending index |
Get Output of Transaction
# 9421c806a8f3fd46841241659637d75b944b42af61fabe7b9359349bc50d2ea6
curl `https://api.blockread.io/bch/tx/{txid}/output/{outputIndex}`
The above command returns JSON structured like this:
{
"index": 0,
"type": "nulldata"
"reqSigs": -1,
"scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
"spent": "false",
"scriptSize": 938,
"partialScript": "false",
"script": "006a2231394878696756345179427633744870515663554551797131707a5a56646f41757403626173106170706c69636174696f6e2f6a736f6e0100306d705f74726164655f76345f3148456d3235445a326276634c7548757132767759546357577638776d5a524569395f3108677a69702c656e634d3103261d4dff43edf620b6f92a35a7a0eeed02f628d0494aa0c7895baf15892a5b1305d702b7726a1e53f9b3820cd03a5b40055b54b0fefbfa2f021637d5f5fea58b345a79b3d58a3c3cc427cf1ba5e3daeb35a6de2c90d1aa95db008845104bdbd8bab185305da20f3ecc7b59a6641a077fa011a1891d5bfabc1bb24943eb4e58038720f9347d8ab16069e94a600e9c0d5adba29b293606cd8849ee9125bf40313a3ca71b3d24a3c873ab1dc4322fcd22c541e8d22987cd5ca4d143f36759c3caff75f7b9e3e2583741f15252265db54a6e1113da9fea1448d1fd37f1e4c9f90cdbd925190a35f9e0df4bd243c0d5de4d8aca62ba60e53a792249f23dcfe4910a54bee9b16bfbfe84c68ad4b9bdb8ba7ee81c9c92ede77b2b11f93d8369b624c1259ec19e300d6b83b85d3baf508bba206fc72f23ce48950ff83cf81e7989ebc07e6d8d86efddb6a9352ad5c64dfa8d444b809e84130f8466b2dfc8f62b61475dfda02ba976f34fdf08e51cf0960b3eb...",
}
This endpoint retrieves an output of a transaction.
HTTP Request
GET https://api.blockread.io/bch/tx/{txid}/output/{outputIndex}
Parameter | Description |
---|---|
txid | |
index | Output index |
Get Outputs of Transaction
# 08dc0b213989d4ecc13095eb71c3808f7410b1fff73ef9979c41cc9cc7f65df7
curl `https://api.blockread.io/bch/tx/{txid}/outputs/{fromIndex}/{toIndex}`
The above command returns JSON structured like this:
[
{
"index": 0,
"type": "nulldata"
"reqSigs": -1,
"scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
"spent": "false",
"scriptSize": 938,
"partialScript": "false",
"script": "006a2231394878696756345179427633744870515663554551797131707a5a56646f41757403626173106170706c69636174696f6e2f6a736f6e0100306d705f74726164655f76345f3148456d3235445a326276634c7548757132767759546357577638776d5a524569395f3108677a69702c656e634d3103261d4dff43edf620b6f92a35a7a0eeed02f628d0494aa0c7895baf15892a5b1305d702b7726a1e53f9b3820cd03a5b40055b54b0fefbfa2f021637d5f5fea58b345a79b3d58a3c3cc427cf1ba5e3daeb35a6de2c90d1aa95db008845104bdbd8bab185305da20f3ecc7b59a6641a077fa011a1891d5bfabc1bb24943eb4e58038720f9347d8ab16069e94a600e9c0d5adba29b293606cd8849ee9125bf40313a3ca71b3d24a3c873ab1dc4322fcd22c541e8d22987cd5ca4d143f36759c3caff75f7b9e3e2583741f15252265db54a6e1113da9fea1448d1fd37f1e4c9f90cdbd925190a35f9e0df4bd243c0d5de4d8aca62ba60e53a792249f23dcfe4910a54bee9b16bfbfe84c68ad4b9bdb8ba7ee81c9c92ede77b2b11f93d8369b624c1259ec19e300d6b83b85d3baf508bba206fc72f23ce48950ff83cf81e7989ebc07e6d8d86efddb6a9352ad5c64dfa8d444b809e84130f8466b2dfc8f62b61475dfda02ba976f34fdf08e51cf0960b3eb...",
},
{
"index": 1,
"type": "pubkeyhash"
"reqSigs": 1,
"satoshis": 800,
"scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
"spent": "false",
"scriptSize": 25,
"partialScript": "false",
"script": "76a914feaf96c5b259c80d36bdd1d6f1d8caa9bb584fe188ac...",
]
This endpoint retrieves multiple outputs of a transaction.
HTTP Request
GET https://api.blockread.io/bch/tx/{txid}/outputs/{fromIndex}/{toIndex}
Parameter | Description |
---|---|
txid | |
from | Starting index |
to | Ending index |
Get Transaction By ID
# 9421c806a8f3fd46841241659637d75b944b42af61fabe7b9359349bc50d2ea6
curl `https://api.blockread.io/bch/tx/{txid}`
The above command returns JSON structured like this:
[
{
"txid": "9421c806a8f3fd46841241659637d75b944b42af61fabe7b9359349bc50d2ea6",
"blockhash": "00000000000000001055c413778451e93e4ab0b4ee442900470abe777916da35",
"blockheight": 742364,
"inblockIndex": 5,
"confirmations": 1234,
"time": 1654203396,
"size": 1128,
"fee": 645,
"ops": [0]
"inputsCount": 2,
"sumOfInputsSatoshis": 1247,
"outputsCount": 2,
"sumOfOutputsSatoshis": 602,
"locktime": 0,
"partialInputs": false,
"inputs": [
{
"index": 0,
"source": {
"txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
"vout": 0,
"satoshis": 18776,
},
"scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
"sequence": 4294967295,
},
{
"index": 1,
"source": {
"txid": "5a63449e5bcbc2e266857c9a2f90ae4cea9907b4dd16793d2db11f9524caaff7",
"vout": 0,
"satoshis": 18776,
},
"scriptSig": "483045022100cfda7d900ccce55c40089df9474e61177f27ac2f3be74b9e958805fab61c992202206ad20dbfcdb244fa8d49fbbb6fde6d5dbe43cd9f93e8d96b6bea983079f17829412102062d9f5d80fcd868c5db4ace2fb38d907296c0b2a00b603a0ec4237b850a04e7",
"sequence": 4294967295,
}
],
"partialOutputs": false,
"outputs": [
{
"index": 0,
"type": "nulldata"
"reqSigs": -1,
"scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
"spent": "false",
"scriptSize": 938,
"partialScript": "false",
"script": "006a2231394878696756345179427633744870515663554551797131707a5a56646f41757403626173106170706c69636174696f6e2f6a736f6e0100306d705f74726164655f76345f3148456d3235445a326276634c7548757132767759546357577638776d5a524569395f3108677a69702c656e634d3103261d4dff43edf620b6f92a35a7a0eeed02f628d0494aa0c7895baf15892a5b1305d702b7726a1e53f9b3820cd03a5b40055b54b0fefbfa2f021637d5f5fea58b345a79b3d58a3c3cc427cf1ba5e3daeb35a6de2c90d1aa95db008845104bdbd8bab185305da20f3ecc7b59a6641a077fa011a1891d5bfabc1bb24943eb4e58038720f9347d8ab16069e94a600e9c0d5adba29b293606cd8849ee9125bf40313a3ca71b3d24a3c873ab1dc4322fcd22c541e8d22987cd5ca4d143f36759c3caff75f7b9e3e2583741f15252265db54a6e1113da9fea1448d1fd37f1e4c9f90cdbd925190a35f9e0df4bd243c0d5de4d8aca62ba60e53a792249f23dcfe4910a54bee9b16bfbfe84c68ad4b9bdb8ba7ee81c9c92ede77b2b11f93d8369b624c1259ec19e300d6b83b85d3baf508bba206fc72f23ce48950ff83cf81e7989ebc07e6d8d86efddb6a9352ad5c64dfa8d444b809e84130f8466b2dfc8f62b61475dfda02ba976f34fdf08e51cf0960b3eb...",
},
{
"index": 1,
"type": "pubkeyhash"
"reqSigs": 1,
"satoshis": 800,
"scripthash": "cbb5deafd5267b5cc8b09e4396928035121de3135ff053117eceebb882875d82",
"spent": "false",
"scriptSize": 25,
"partialScript": "false",
"script": "76a914feaf96c5b259c80d36bdd1d6f1d8caa9bb584fe188ac...",
}
]
}
]
This endpoint retrieves the parsed format of transaction.
HTTP Request
GET https://api.blockread.io/bch/tx/{txid}
Parameter | Description |
---|---|
txid |
Get Merkle Proof
# 13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89
curl `https://api.blockread.io/bch/tx/{txid}/proof`
The above command returns JSON structured like this:
{
"blockhash": "00000000000000000085985685d702b6c2911db73800cc5601333e2f60312ba2",
"branches": [
{
"pos": "R",
"hash": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
},
{
"pos": "L",
"hash": "966d90b60347991a47feff12dd3533d89b68cda452488e236481da0456a169d6",
},
{
"pos": "L",
"hash": "ea0b162823c00a628575ab0c4c008837a1d8e6544932be457dff1c5ef8c5a2bc",
},
{
"pos": "R",
"hash": "831c2840c0882ca369fd18b5187ea55a3108245480c6b25ff6cd15ec0f563990",
}
],
"hash": "13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89",
"merkleRoot": "10aff887bac4789106e85312b2afdcebd71926c15b0604236af9f2972ab30d8d"
}
This endpoint retrieves the proof of a transaction.
HTTP Request
GET https://api.blockread.io/bch/tx/{txid}/proof
Parameter | Description |
---|---|
txid |
Get Merkle Proof - TSC Format
# 13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89
curl `https://api.blockread.io/bch/tx/{txid}/proof/tsc`
The above command returns JSON structured like this:
{
"index": 6,
"txOrId": "13d94f78bcaddcadf0fb7672f788c62cb93d5cdaa73e187d44cee24849d80f89",
"target": "00000000000000000085985685d702b6c2911db73800cc5601333e2f60312ba2",
"nodes": [
"946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"966d90b60347991a47feff12dd3533d89b68cda452488e236481da0456a169d6",
"ea0b162823c00a628575ab0c4c008837a1d8e6544932be457dff1c5ef8c5a2bc",
"831c2840c0882ca369fd18b5187ea55a3108245480c6b25ff6cd15ec0f563990",
"e9b4210567f28b3b77c4979c4ed8f9e5fd9a123eee01d0dd5f31d9dc6315286e",
"e6c435ede10b252f8ee4f8bdd43ee5c93414d8e02aefbcc3921e33da5c6802d3",
]
}
This endpoint retrieves the proof of a transaction.
HTTP Request
GET https://api.blockread.io/bch/tx/{txid}/proof/tsc
Parameter | Description |
---|---|
txid |
Send Raw Transaction
curl --location --request POST `https://api.blockread.io/bch/tx/broadcast` \
--header "Content-Type: application/json" \
--data "{\"raw\": \"hexRawTX...\" }"
The above command returns JSON structured like this:
{
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
}
This endpoint broadcasts the raw transaction up to 32MB in hex to the Blockchain.
HTTP Request
POST https://api.blockread.io/bch/tx/broadcast
Request Body
Key | Value |
---|---|
raw | The raw format of tx in hex |
Block
All about blocks!
Get Block By Height
curl `https://api.blockread.io/bch/block/height/{height}`
The above command returns JSON structured like this:
{
"hash": "0000000000000000000590fc0f3eba193a278534220b2b37e9849e1a770ca959",
"size": 81577,
"height": 500000,
"version": 536870912,
"merkleroot": "4af279645e1b337e655ae3286fc2ca09f58eb01efa6ab27adedd1e9e6ec19091",
"transactionCount": 150,
"time": 1509343584,
"mediantime": 1509336533,
"nonce": 3604508752,
"bits": "1809b91a",
"chainwork": "0000000000000000000000000000000000000000007ae48aca46e3b449ad9714",
"previousBlockHash": "0000000000000000043831d6ebb013716f0580287ee5e5687e27d0ed72e6e523",
"nextBlockHash": "00000000000000000568f0a96bf4348847bc84e455cbfec389f27311037a20f3",
"countOfTransactionsInputs": 468,
"sumOfTransactionsInputsSatoshis": 2978761212445,
"countOfTransactionsOutputs": 273,
"sumOfTransactionsOutputsSatoshis": 2978758164777,
"fees": 3047668,
"averageFee": 20454,
"feeRate": 37.43879907621247,
"reward": 1250000000,
"partialTransactions": true,
"transactionsDetails": [
{
"index": 0,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 2,
"countOfOutputs": 2,
"size": 350,
},
{
"index": 1,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 2,
"size": 224,
},
{
"index": 2,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 1,
"size": 173,
}
]
}
This endpoint retrieves a block data by height.
HTTP Request
GET https://api.blockread.io/bch/block/height/{height}
Parameter | Description |
---|---|
height | Block Height |
Get Block List
curl `https://api.blockread.io/bch/block/list?fromHeight={height}&limit={limit}`
The above command returns JSON structured like this:
[
{
"hash": "0000000000000000000590fc0f3eba193a278534220b2b37e9849e1a770ca959",
"size": 81577,
"height": 500000,
"transactionCount": 50,
"timestamp": 1509343584,
"countOfTransactionsInputs": 468,
"sumOfTransactionsInputsSatoshis": 2978761212445,
"countOfTransactionsOutputs": 273,
"sumOfTransactionsOutputsSatoshis": "2978758164777",
"totalFee": 3047668,
"averageFee": 20454,
"age": 146464720,
},
{
"hash": "00000000000000000568f0a96bf4348847bc84e455cbfec389f27311037a20f3",
"size": 81577,
"height": 500001,
"transactionCount": 50,
"timestamp": 1509343584,
"countOfTransactionsInputs": 468,
"sumOfTransactionsInputsSatoshis": 2978761212445,
"countOfTransactionsOutputs": 273,
"sumOfTransactionsOutputsSatoshis": "2978758164777",
"totalFee": 3047668,
"averageFee": 20454,
"age": 146464720,
},
{
"hash": "00000000000000000797607b2b69d1561027dbaf28545a33d6ec3adb89f8e564",
"size": 81577,
"height": 500002,
"transactionCount": 50,
"timestamp": 1509343584,
"countOfTransactionsInputs": 468,
"sumOfTransactionsInputsSatoshis": 2978761212445,
"countOfTransactionsOutputs": 273,
"sumOfTransactionsOutputsSatoshis": "2978758164777",
"totalFee": 3047668,
"averageFee": 20454,
"age": 146464720,
}
]
This endpoint retrieves a list of blocks with details.
HTTP Request
GET https://api.blockread.io/bch/block/list?skip={skip}&limit={limit}&sort={sortBy}&direction={asc|desc}
URL Parameters
skip | number of blocks to skip |
limit | number of blocks to list |
sortBy | height|size|transactions|fees |
direction | asc|desc |
Get Latest Block
curl `https://api.blockread.io/bch/block/latest`
The above command returns JSON structured like this:
{
"hash": "0000000000000000000590fc0f3eba193a278534220b2b37e9849e1a770ca959",
"size": 81577,
"height": 500000,
"version": 536870912,
"merkleroot": "4af279645e1b337e655ae3286fc2ca09f58eb01efa6ab27adedd1e9e6ec19091",
"transactionCount": 150,
"time": 1509343584,
"mediantime": 1509336533,
"nonce": 3604508752,
"bits": "1809b91a",
"chainwork": "0000000000000000000000000000000000000000007ae48aca46e3b449ad9714",
"previousBlockHash": "0000000000000000043831d6ebb013716f0580287ee5e5687e27d0ed72e6e523",
"nextBlockHash": "00000000000000000568f0a96bf4348847bc84e455cbfec389f27311037a20f3",
"countOfTransactionsInputs": 468,
"sumOfTransactionsInputsSatoshis": 2978761212445,
"countOfTransactionsOutputs": 273,
"sumOfTransactionsOutputsSatoshis": 2978758164777,
"fees": 3047668,
"averageFee": 20454,
"feeRate": 37.43879907621247,
"reward": 1250000000,
"partialTransactions": true,
"transactionsDetails": [
{
"index": 0,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 2,
"countOfOutputs": 2,
"size": 350,
},
{
"index": 1,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 2,
"size": 224,
},
{
"index": 2,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 1,
"size": 173,
}
]
}
This endpoint retrieves the latest block.
HTTP Request
GET https://api.blockread.io/bch/block/latest
Get Block By Hash
curl `https://api.blockread.io/bch/block/{blockhash}`
The above command returns JSON structured like this:
{
"hash": "0000000000000000000590fc0f3eba193a278534220b2b37e9849e1a770ca959",
"size": 81577,
"height": 500000,
"version": 536870912,
"merkleroot": "4af279645e1b337e655ae3286fc2ca09f58eb01efa6ab27adedd1e9e6ec19091",
"transactionCount": 150,
"time": 1509343584,
"mediantime": 1509336533,
"nonce": 3604508752,
"bits": "1809b91a",
"chainwork": "0000000000000000000000000000000000000000007ae48aca46e3b449ad9714",
"previousBlockHash": "0000000000000000043831d6ebb013716f0580287ee5e5687e27d0ed72e6e523",
"nextBlockHash": "00000000000000000568f0a96bf4348847bc84e455cbfec389f27311037a20f3",
"countOfTransactionsInputs": 468,
"sumOfTransactionsInputsSatoshis": 2978761212445,
"countOfTransactionsOutputs": 273,
"sumOfTransactionsOutputsSatoshis": 2978758164777,
"fees": 3047668,
"averageFee": 20454,
"feeRate": 37.43879907621247,
"reward": 1250000000,
"partialTransactions": true,
"transactionsDetails": [
{
"index": 0,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 2,
"countOfOutputs": 2,
"size": 350,
},
{
"index": 1,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 2,
"size": 224,
},
{
"index": 2,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 1,
"size": 173,
}
]
}
This endpoint retrieves the block data by hash.
HTTP Request
GET https://api.blockread.io/bch/block/{blockhash}
Parameter | Description |
---|---|
hash | Block Hash |
Get Transactions of Block
curl `https://api.blockread.io/bch/block/{blockhash}/transactions`
The above command returns JSON structured like this:
[
{
"index": 0,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 2,
"countOfOutputs": 2,
"size": 350,
},
{
"index": 1,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 2,
"size": 224,
},
{
"index": 2,
"txid": "946e8cf5a6d812f2cb666531ba59e80847abd6cdc05d65695a5fc41682d4379c",
"countOfInputs": 1,
"countOfOutputs": 1,
"size": 173,
}
]
This endpoint retrieves the transactions of a block.
HTTP Request
GET https://api.blockread.io/bch/block/{blockhash}/transactions
Parameter | Description |
---|---|
hash | Block Hash |
from | Starting i |
limit | Number of Results |
Mempool
BlockRead keeps transactions for fourteen days in the Mempool.
Get Mempool Info
curl `https://api.blockread.io/bch/mempool`
The above command returns JSON structured like this:
{
"transactionsCount": 23764,
"size": 10998880813,
"circulatedSatoshis": "2976405264895",
"age": 1776,
}
This endpoint retrieves the Mempool info.
HTTP Request
GET https://api.blockread.io/bch/mempool
Get Mempool transactions
curl `https://api.blockread.io/bch/mempool/transactions`
The above command returns JSON structured like this:
[
{
"txid": "c09e7ecccc9305377b01c754e008b7bd434b092e0d629a1c836806a30d86338f",
"countOfInputs": 2,
"countOfOutputs": 1,
"ops": [0],
"size": 403,
"timestamp": 1658243646,
},
{
"txid": "c09e7ecccc9305377b01c754e008b7bd434b092e0d629a1c836806a30d86338f",
"countOfInputs": 2,
"countOfOutputs": 1,
"ops": [0],
"size": 403,
"timestamp": 1658243646,
},
{
"txid": "c09e7ecccc9305377b01c754e008b7bd434b092e0d629a1c836806a30d86338f",
"countOfInputs": 2,
"countOfOutputs": 1,
"ops": [0],
"size": 403,
"timestamp": 1658243646,
},
]
This endpoint retrieves the transactions in mempool.
HTTP Request
GET https://api.blockread.io/bch/mempool/transactions
URL Parameters
Parameter | Description |
---|---|
from | Starting index |
limit | Number of transactions to retrieve |
Network
Retrieve the state of the BCH network in just milliseconds!
Get Network Stats
curl `https://api.blockread.io/bch/network/stats`
The above command returns JSON structured like this:
[
{
"daily": "{",
"transactions": 1858986,
"tpsAverage": 21.759002588863734,
"blocks": 140,
"blockAverageTime": 610,
"blockAverageSize": 120234565,
"size": 18810864256,
},
{
"weekly": "{",
"transactions": 1858986,
"tpsAverage": 21.759002588863734,
"blocks": 140,
"blockAverageTime": 610,
"blockAverageSize": 120234565,
"size": 18810864256,
},
{
"monthly": "{",
"transactions": 1858986,
"tpsAverage": 21.759002588863734,
"blocks": 140,
"blockAverageTime": 610,
"blockAverageSize": 120234565,
"size": 18810864256,
},
{
"yearly": "{",
"transactions": 1858986,
"tpsAverage": 21.759002588863734,
"blocks": 140,
"blockAverageTime": 610,
"blockAverageSize": 120234565,
"size": 18810864256,
},
{
"alltime": "{",
"transactions": 1858986,
"tpsAverage": 21.759002588863734,
"blocks": 140,
"blockAverageTime": 610,
"blockAverageSize": 120234565,
"size": 18810864256,
},
]
This endpoint retrieves the network stats.
HTTP Request
GET https://api.blockread.io/bch/network/stats
Get Network Info
curl `https://api.blockread.io/bch/network/info`
The above command returns JSON structured like this:
{
"blocks": 747778,
"bestblockhash": "000000000000000009103cdfe9355853a1653148d5be978141d31f7bf2786cee",
"chainwork": "00000000000000000000000000000000000000000139ace7839b1aef60d83f3c",
"difficulty": 74430838267.01804,
"mediantime": 1657539582,
"blockAverageSize": 120234565,
"size": 18810864256,
}
This endpoint retrieves the network info.
HTTP Request
GET https://api.blockread.io/bch/network/info
Download
Download raw transactions or a specific output of a transaction.
Download Transaction
# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914
curl `https://api.blockread.io/bch/download/tx/{txid}`
The above command returns the transaction output in binary and the following is one example on how to get the data:
function bufferToHex (buffer) {
return [...new Uint8Array (buffer)]
.map (b => b.toString (16).padStart (2, "0"))
.join ("");
}
axios.get('https://api.blockread.io/bch/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914',
{
responseType: 'arraybuffer',
headers: {
'Content-Type': 'application/gzip'
}
})
.then(async response => {
console.log(bufferToHex(response.data));
})
.catch(error => {
console.log({error});
});
This endpoint retrieves raw transaction data.
HTTP Request
GET https://api.blockread.io/bch/download/tx/{txid}
Parameter | Description |
---|---|
txid |
Download Transaction Output
# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914
curl `https://api.blockread.io/bch/download/tx/{txid}/output/{outputIndex}`
The above command returns the transaction output in binary, the following is one example on how to get the data:
function bufferToHex (buffer) {
return [...new Uint8Array (buffer)]
.map (b => b.toString (16).padStart (2, "0"))
.join ("");
}
axios.get('https://api.blockread.io/bch/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/output/0',
{
responseType: 'arraybuffer',
headers: {
'Content-Type': 'application/gzip'
}
})
.then(async response => {
console.log(bufferToHex(response.data));
})
.catch(error => {
console.log({error});
});
This endpoint retrieves specific transaction output( No need to download extra information).
HTTP Request
GET https://api.blockread.io/bch/download/tx/{txid}/output/{outputIndex}
Parameter | Description |
---|---|
txid | |
output | Output index |
Download Transaction Input
# 40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914
curl `https://api.blockread.io/bch/download/tx/{txid}/input/{inputIndex}`
The above command returns the transaction input in binary, the following is one example on how to get the data:
function bufferToHex (buffer) {
return [...new Uint8Array (buffer)]
.map (b => b.toString (16).padStart (2, "0"))
.join ("");
}
axios.get('https://api.blockread.io/bch/download/tx/40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914/input/0',
{
responseType: 'arraybuffer',
headers: {
'Content-Type': 'application/gzip'
}
})
.then(async response => {
console.log(bufferToHex(response.data));
})
.catch(error => {
console.log({error});
});
This endpoint retrieves specific transaction output( No need to download extra information).
HTTP Request
GET https://api.blockread.io/bch/download/tx/{txid}/input/{inputIndex}
Parameter | Description |
---|---|
txid | |
input | Input index |
Search
Search Blockchain
curl `https://api.blockread.io/bch/search?q={text}`
The above command returns JSON structured like this:
{
"ops": {
"from": 0,
"limit": 10,
"total": 1400,
"remain": 1390,
"results":[
{
"txid": "40ff70b97334699d71a552ab5ea97c996fa8d64a9e0dc0041ec1701b10ed6914",
"n": 0,
"time": ,
"highlight": [
"Upfile-v1data:text/plain;base64,dGhpcyBpcyBhIHRlc3QgRmlsZQ==Upfile-v1"
]
}
]
}
}
This endpoint retrieves transactions including the search parameter.
HTTP Request
GET https://api.blockread.io/bch/search?q={text}
Parameter | Description |
---|---|
type | all, tx, block, scripthash, address |
from | Starting index |
limit | Ending index |
fromTime | Epoch |
toTime | Epoch |
Socket
Fire up a socket and watch the network! A perfect tool for monitoring blockchain in real-time. It can be used for IoT devices, wallets and many other use cases.
Mempool Info
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('mempool',info => console.log(info))
Get mempool info in a 5 second interval
Topic
mempool
Watch All Transactions
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('tx', (data) => {
console.log(JSON.stringify(data, null, 2));
});
Watch the network for all the transactions(different in output comparing to 'address' and 'scripthash' topics).
Topic
tx
Watch a Specific Transaction
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('tx-9e8ea17aa1fd450bf2e0ff41891e05286ba117d08f207f508094a2b1e0e7669d', (data) => {
console.log(JSON.stringify(data, null, 2));
});
Watch the network for a specific transaction.
Topic
tx-{txid}
Watch All Addresses
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('lock-address', (data) => {
console.log(JSON.stringify(data, null, 2));
});
Watch the network for all the addresses(different in output comparing to 'tx' and 'scripthash' topics).
Topic
lock-address
Lock to Address
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('lock-address-qrmlp6t9ev4ujhcs49cj0d30znlrugtjfuxa00e3j8', (data) => {
console.log(JSON.stringify(data, null, 2));
});
This subscribes to a list of all the locked UTXOs (Unspent Transaction Outputs) associated with a specific address. It is triggered whenever the address is included in the outputs of a transaction, indicating that a new UTXOs associated with that address is created.
Topic
lock-address-{address}
Watch All Scripthashes
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('lock-scripthash', (data) => {
console.log(JSON.stringify(data, null, 2));
});
Watch the network for all the scripthashes(different in output comparing to 'tx' and 'address' topics).
Topic
lock-scripthash
Lock to Scripthash
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('lock-scripthash-e4f725c7f7a95838f3fc8c138b7d5ce19dfbb8cd6cb9cb37f590533855dba399', (data) => {
console.log(JSON.stringify(data, null, 2));
});
This subscribes to a list of all the locked UTXOs (Unspent Transaction Outputs) associated with a specific scripthash. It is triggered whenever the scripthash is included in the outputs of a transaction, indicating that a new UTXOs associated with that scripthash is created.
Topic
lock-scripthash-{scripthash}
Spent UTXOs on All Addresses
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('spent-address', (data) => {
console.log(JSON.stringify(data, null, 2));
});
This endpoint lists all the spent UTXOs of any addresses.
Topic
spent-address
Spent UTXOs from an Address
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('spent-address-1GhhT4dXpqdtum9pS2Rqzbuyjm5gNDUHEU', (data) => {
console.log(JSON.stringify(data, null, 2));
});
This subscribes to a list of all the spent UTXOs (Unspent Transaction Outputs) associated with a specific address. It is triggered whenever the address is included in the inputs of a transaction, indicating that the UTXOs associated with that address have been spent.
Topic
spent-address-{address}
Spent UTXOs on All scripthashes
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('spent-scripthash', (data) => {
console.log(JSON.stringify(data, null, 2));
});
This endpoint lists all the spent UTXOs of any scripthashes.
Topic
spent-scripthash
Spent UTXOs from a Scripthash
const { io } = require('socket.io-client')
const socket = io('https://bch.blockread.io/global')
socket.connect()
socket.on('spent-scripthash-e4f725c7f7a95838f3fc8c138b7d5ce19dfbb8cd6cb9cb37f590533855dba399', (data) => {
console.log(JSON.stringify(data, null, 2));
});
This subscribes to a list of all the spent UTXOs (Unspent Transaction Outputs) associated with a specific scripthash. It is triggered whenever the scripthash is included in the inputs of a transaction, indicating that the UTXOs associated with that scripthash have been spent.
Topic
spent-scripthash-{scripthash}
Spent or Lock on Owner
const { io } = require('socket.io-client')
const socket = io('https://api.blockread.io/bch/owner',{auth:{key: 'long-key'}});
socket.connect()
socket.on('data', (data) => {
console.log(JSON.stringify(data, null, 2));
});
This endpoint lists all the spent or locked UTXOs of an owner.
Topic
data
Service
A service can be any application or entity. By creating a service, the service owner can add many 'owners' and attach addresses to these owners. With this, the owners can get the unspent, balance, history, and details of the addresses bound to them. We leave it to you to think how many use cases this feature has!
Create Service
var url = 'https://api.blockread.io/bch/service/create';,
var options = {
method: 'POST' ,
url: url
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
The above command returns JSON structured like this:
{
"serviceId": "214d60f65359345456787654bba17a4c05f5ce639806023357176a51bfd52ad8",
"key": "sXjprmkz4os4JeFKt2IByyqUAbHzk0FYK9Ci+GICelk",
}
This endpoint creates a service.
HTTP Request
POST https://api.blockread.io/bch/service/create
Revoke Service Key
var url = 'https://api.blockread.io/bch/service/revoke';
var options = {
method: 'POST' ,
url: url ,
headers: {
'key': serviceKey, // The Service Key which will be changed
}
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
The above command returns JSON structured like this:
{
"serviceId": "214d60f65359345456787654bba17a4c05f5ce639806023357176a51bfd52ad8",
"key": "sXjprmkz4os4JeFKt2IByyqUAbHzk0FYK9Ci+GICelk",
}
This endpoint revokes a service key.
HTTP Request
POST https://api.blockread.io/bch/service/revoke
Create Owner
var url = 'https://api.blockread.io/bch/service/create/owner';
var options = {
method: 'POST' ,
url: url ,
headers: {
'key': serviceKey,
}
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
The above command returns JSON structured like this:
{
"ownerID": "bde30c4aa622e1731582bba9463bc6f1daa1712f5191c0df3125c06085bde05b",
"key": "sXjprmkz4os4JeFKt2IByyqUAbHzk0FYK9Ci+GICelk",
}
This endpoint creates an owner.
Owners can bind addresses, and fetch all the UTXOs of all the addresses in one request
HTTP Request
POST https://api.blockread.io/bch/service/create/owner
Remove Owner
var url = 'https://api.blockread.io/bch/service/remove/owner';
var theBody = {
"ownerId": ownerId // the owner ID that is going to be removed from the service
}
var options = {
method: 'DELETE' ,
url: url ,
headers: {
'key': serviceKey,
}
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
This endpoint removes an owner from a service.
HTTP Request
DELETE https://api.blockread.io/bch/service/remove/owner
Owner
An owner is an entity that is using a service. Let's say a wallet is a service, and the user of that wallet is the owner.
Get Owner Unspent
var url = 'https://api.blockread.io/bch/owner/unspent';
var options = {
method: 'GET',
url: url ,
headers: {
'key': ownerKey
}
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
The above command returns JSON structured like this:
{
"ownerId": "a3b100f38f6fb0f5f053b6a36552088cd15c4704f87da8e5e911045386075b47",
"unspent": [
{
"scripthash": "7ca9a89f75d5457dfac435d105dd874f344b7853718c7d4d27fa20ead078b45a",
"unspent": {
"txid": "78b26b845325edf76f59fd98e575ecca0cef790b5ce35b6106d90970b2c884f1",
"vout": 0,
"satoshis": 1957,
"time": "1657811336",
"confirmations": 2187
}
},
{
"scripthash": "c877d2c901c06c66fb7ac170a66c072d171c59154192729889eb5a59be34f082",
"unspent": {
"txid": "0c96f18135f8f61356544e15d7f026ce0ae6409ad0a57063cf84e6d7ff3c4039",
"vout": 0,
"satoshis": 1789,
"time": "1658216042",
"confirmations": 1510
}
}
]
}
This endpoint retrieves owner unspents.
HTTP Request
GET https://api.blockread.io/bch/owner/unspent
Get Owner Balance
var url = 'https://api.blockread.io/bch/owner/balance';
var options = {
method: 'GET',
url: url ,
headers: {
'key': ownerKey
}
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
The above command returns JSON structured like this:
{
"ownerId": "214d60f65359345456787654bba17a4c05f5ce639806023357176a51bfd52ad8",
"confirmed": 1957,
"unconfirmed": 1000,
"summary": 2957,
"count": 2,
}
This endpoint retrieves owner balance.
HTTP Request
GET https://api.blockread.io/bch/owner/balance
Get Owner History
var url = 'https://api.blockread.io/bch/owner/history';
var options = {
method: 'GET',
url: url ,
headers: {
'key': ownerKey
}
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
The above command returns JSON structured like this:
{
"ownerId": "a3b100f38f6fb0f5f053b6a36552088cd15c4704f87da8e5e911045386075b47",
"histories": [
{
"txid": "0c96f18135f8f61356544e15d7f026ce0ae6409ad0a57063cf84e6d7ff3c4039",
"inputSatoshis": 0,
"outputSatoshis": 1789,
"time": 1658216024,
},
{
"txid": "0c96f18135f8f61356544e15d7f026ce0ae6409ad0a57063cf84e6d7ff3c4039",
"inputSatoshis": 0,
"outputSatoshis": 1789,
"time": 1658216024,
}
]
}
This endpoint retrieves owner history. Note that the inputSatoshis and outputSatoshis refer to the role of the address in the transaction. In other words, when the inputSatoshis is a non-zero value, it means the address was seen in the inputs of the transaction(Spent), and when the outputSatoshis is non-zero, it implies that the address was seen in the output of the transaction(Received).
HTTP Request
GET https://api.blockread.io/bch/owner/history
Bind Address to Owner
var url = 'https://api.blockread.io/bch/owner/bind';
var theBody = {
"addressesigs": [
{
"address": theAddr, // the address to bind to the owner
"base64Sig": signature, // base64 format of the signature which used the string format of
// the address as a message to sign by the private key.
}
]
}
var options = {
method: 'POST' ,
url: url ,
headers: {
'key': ownerKey, // The Owner Key
},
//body in format of json
body: theBody,
json: true
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
This endpoint binds address to owner.
HTTP Request
POST https://api.blockread.io/bch/owner/bind
Unbind Address from Owner
var url = 'https://api.blockread.io/bch/owner/unbind';
var theBody = {
"addresses": [
theAddr //the Address to unbind
]
}
var options = {
method: 'POST' ,
url: url ,
headers: {
'key': ownerKey, // The Owner Key
},
//body in format of json
body: theBody,
json: true
};
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
This endpoint unbinds address from owner.
HTTP Request
POST https://api.blockread.io/bch/owner/unbind
Revoke Owner Key
var url = 'https://api.blockread.io/bch/owner/revoke';
var options = {
method: 'POST' ,
url: url ,
headers: {
'key': ownerKey, // The Owner Key which will be changed
}
};
if (error) {
request(options, function(error, response, body) {
if (error) {
console.log( error );
} else {
console.log( body );
}
});
The above command returns JSON structured like this:
{
"ownerId": "214d60f65359345456787654bba17a4c05f5ce639806023357176a51bfd52ad8",
"key": "7ND41g3DAcfO1VvHzX/INJF1ejQ1hX3LL3iG66coBUQ",
}
This endpoint revokes the owner key.
HTTP Request
POST https://api.blockread.io/bch/owner/revoke
Errors
Error 404
As obvious as it is, As obvious as it is, a 404 error is generated when the page is not found
Error 500
Internal Error - And we are probably checking the system to see what happened!
Error 503
Scheduled Maintenance!