๐ Get transaction count in block by height
Code samples
GET /api/v1/btc/block/{blockNumber}/transactions/count
Returns the number of transactions in a block identified by height using getblockhash followed by getblock (verbosity 1).
๐ ๏ธ Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| blockNumber | path | integer(int64) | true | Block height in the best chain (non-negative integer). |
Example responses
200 Response
{
"transactionCount": 2500
}
๐ Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Number of transactions in the block | Inline |
| 400 | Bad Request | Invalid block number (negative) | Inline |
| 500 | Internal Server Error | Could not connect to BTC node | None |
๐ Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ยป transactionCount | integer(int64)ยฆnull | false | none | Number of transactions (nTx) in the block, or null if unavailable. |
Status Code 400
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ยป error | string | false | none | none |