<p>Another possibility is to use the <a href="https://bitcoincore.org/en/doc/0.18.0/rpc/blockchain/getblockstats/" rel="nofollow noreferrer"><code>getblockstats</code></a> command to get the number of transactions (not including the coinbase transaction) for a specific block (by height/hash). E.g.</p>

<pre><code>$ getblockstats 500000 '["txs"]'

{
  "txs": 2701
}
</code></pre>

<p>Then, iterate through all of the blocks to get the total for all blocks.</p>

CC BY-SA 4.0
2019-08-20T13:36:31.333Z
2019-08-20T13:36:31.333Z
JBaczuk
<p>I'm reasonably sure this is not exposed by the RPC API.</p>

<p>You could parse <code>debug.log</code> and look for lines like:</p>

<pre><code>2019-08-20T12:17:58Z UpdateTip: new best=0000000000000000000e6c402b311740e21f79a42ed84ecf69a3ae4fe88ce882 height=590956 version=0x20000000 log2_work=90.9855 tx=446914655 date='2019-08-20T12:17:55Z' progress=1.000000 cache=277.1MiB(321228txo)
</code></pre>

<p>Where <code>tx=num</code> gives the total transaction count. I reckon that most explorers maintain a separate database of the transactions, and simply run a query against that instead of pulling data like this from a node or log.</p>

CC BY-SA 4.0
2019-08-20T12:31:55.033Z
2019-08-20T12:31:55.033Z
Raghav Sood
<p>I have seen no concrete answer to this question anywhere.
I assume it is possible to get the total number of successful transactions on the bitcoin network using bitcoin-cli command because most explorers provide this information.
How can i get this information from a fully synced node?</p>

<transactions><bitcoin-cli><full-node>
How to get total transactions on the network with RPC
uwem
# How to get total transactions on the network with RPC

(Asked by: username_0 on 2019-08-20)

I have seen no concrete answer to this question anywhere.
I assume it is possible to get the total number of successful transactions on the bitcoin network using bitcoin-cli command because most explorers provide this information.
How can i get this information from a fully synced node?

**Tags:** transactions, bitcoin-cli, full-node


---

## 2 answers

### Answer by username_2 on 2019-08-20. Score: 4 | Accepted answer

I'm reasonably sure this is not exposed by the RPC API.

You could parse `debug.log` and look for lines like:

```
2019-08-20T12:17:58Z UpdateTip: new best=0000000000000000000e6c402b311740e21f79a42ed84ecf69a3ae4fe88ce882 height=590956 version=0x20000000 log2_work=90.9855 tx=446914655 date='2019-08-20T12:17:55Z' progress=1.000000 cache=277.1MiB(321228txo)

```

Where `tx=num` gives the total transaction count. I reckon that most explorers maintain a separate database of the transactions, and simply run a query against that instead of pulling data like this from a node or log.


---

### Answer by username_1 on 2019-08-20. Score: 3

Another possibility is to use the [`getblockstats`](https://bitcoincore.org/en/doc/0.18.0/rpc/blockchain/getblockstats/) command to get the number of transactions (not including the coinbase transaction) for a specific block (by height/hash). E.g.

```
$ getblockstats 500000 '["txs"]'

{
  "txs": 2701
}

```

Then, iterate through all of the blocks to get the total for all blocks.


---

