<p><a href="https://developer.bitcoin.org/reference/rpc/getblockstats.html" rel="nofollow noreferrer"><code>getblockstats</code></a></p>
<blockquote>
<pre><code>  &quot;txs&quot; : n,                   (numeric) The number of transactions (including coinbase)
</code></pre>
</blockquote>
<hr />
<p>Example</p>
<pre><code>C:\Program Files\Bitcoin\daemon&gt; bitcoin-cli getblockcount
627251

C:\Program Files\Bitcoin\daemon&gt; bitcoin-cli getblockstats 627251 | findstr /C:&quot;\&quot;txs\&quot;:&quot;
  &quot;txs&quot;: 2103,
</code></pre>
<p>The full output contains lots of other information</p>
<pre><code>C:\Program Files\Bitcoin\daemon&gt; bitcoin-cli getblockstats 627251
{
  &quot;avgfee&quot;: 8359,
  &quot;avgfeerate&quot;: 17,
  &quot;avgtxsize&quot;: 571,
  &quot;blockhash&quot;: &quot;000000000000000000070ab39c953fd599b27da2c171476d2b2e8533484130bd&quot;,
  &quot;feerate_percentiles&quot;: [
    7,
    7,
    8,
    25,
    30
  ],
  &quot;height&quot;: 627251,
  &quot;ins&quot;: 6108,
  &quot;maxfee&quot;: 1598037,
  &quot;maxfeerate&quot;: 387,
  &quot;maxtxsize&quot;: 99011,
  &quot;medianfee&quot;: 4007,
  &quot;mediantime&quot;: 1587620811,
  &quot;mediantxsize&quot;: 249,
  &quot;minfee&quot;: 162,
  &quot;minfeerate&quot;: 1,
  &quot;mintxsize&quot;: 188,
  &quot;outs&quot;: 4844,
  &quot;subsidy&quot;: 1250000000,
  &quot;swtotal_size&quot;: 550012,
  &quot;swtotal_weight&quot;: 1383607,
  &quot;swtxs&quot;: 893,
  &quot;time&quot;: 1587623122,
  &quot;total_out&quot;: 403374241843,
  &quot;total_size&quot;: 1202103,
  &quot;total_weight&quot;: 3991971,
  &quot;totalfee&quot;: 17572435,
  &quot;txs&quot;: 2103,
  &quot;utxo_increase&quot;: -1264,
  &quot;utxo_size_inc&quot;: -94315
}

</code></pre>

CC BY-SA 4.0
2021-05-03T15:41:59.347Z
2021-05-03T17:52:33.220Z
2021-05-03T17:52:33.220Z
RedGrittyBrick
<p>what is bitcoin-cli command for checking how many transaction per block ?</p>
<p>Thanks you</p>

<bitcoin-core><bitcoind><block>
Check transaction per block in Bitcoin
Dam Yi
# Check transaction per block in Bitcoin

(Asked by: username_0 on 2021-05-03)

what is bitcoin-cli command for checking how many transaction per block ?

Thanks you

**Tags:** bitcoin-core, bitcoind, block


---

## 1 answers

### Answer by username_1 on 2021-05-03. Score: 2

[`getblockstats`](https://developer.bitcoin.org/reference/rpc/getblockstats.html)

> ```
>   "txs" : n,                   (numeric) The number of transactions (including coinbase)
>
> ```

---

Example

```
C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockcount
627251

C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockstats 627251 | findstr /C:"\"txs\":"
  "txs": 2103,

```

The full output contains lots of other information

```
C:\Program Files\Bitcoin\daemon> bitcoin-cli getblockstats 627251
{
  "avgfee": 8359,
  "avgfeerate": 17,
  "avgtxsize": 571,
  "blockhash": "000000000000000000070ab39c953fd599b27da2c171476d2b2e8533484130bd",
  "feerate_percentiles": [
    7,
    7,
    8,
    25,
    30
  ],
  "height": 627251,
  "ins": 6108,
  "maxfee": 1598037,
  "maxfeerate": 387,
  "maxtxsize": 99011,
  "medianfee": 4007,
  "mediantime": 1587620811,
  "mediantxsize": 249,
  "minfee": 162,
  "minfeerate": 1,
  "mintxsize": 188,
  "outs": 4844,
  "subsidy": 1250000000,
  "swtotal_size": 550012,
  "swtotal_weight": 1383607,
  "swtxs": 893,
  "time": 1587623122,
  "total_out": 403374241843,
  "total_size": 1202103,
  "total_weight": 3991971,
  "totalfee": 17572435,
  "txs": 2103,
  "utxo_increase": -1264,
  "utxo_size_inc": -94315
}

```


---

