<p>For Bitcoin you can get the total supply via <a href="https://bitcoincore.org/en/doc/0.21.0/rpc/blockchain/gettxoutsetinfo/" rel="nofollow noreferrer"><code>gettxoutsetinfo</code></a>, which produces the following output:</p>
<pre><code>$ bitcoin-cli gettxoutsetinfo
{
  &quot;height&quot;: 705603,
  &quot;bestblock&quot;: &quot;0000000000000000000173b87bcaa99c5020eb16b13a856f7015130889c5ff93&quot;,
  &quot;transactions&quot;: 45865084,
  &quot;txouts&quot;: 75262497,
  &quot;bogosize&quot;: 5632719734,
  &quot;hash_serialized_2&quot;: &quot;ac0ce667248d97678d5eb4fcfb7e2ae667e205775765852e5b595afa73fb2eb0&quot;,
  &quot;disk_size&quot;: 4613582238,
  &quot;total_amount&quot;: 18847318.79243407
}
</code></pre>
<p>In the output, <code>total_amount</code> refers to the sum of all existing bitcoins. While other cryptocurrencies are not on-topic here, <code>gettxoutsetinfo</code> should also work for most Bitcoin-derived altcoins.</p>

CC BY-SA 4.0
2021-10-19T09:51:06.120Z
Awesome! And what about other blockchain? any hints?
user127862
CC BY-SA 4.0
2021-10-19T11:22:06.813Z
As mentioned in the answer, this site only covers Bitcoin, but a few other cryptocurrencies have their own stackexchange sites and you could ask there.
Murch
CC BY-SA 4.0
2021-10-18T21:10:56.870Z
2021-10-18T21:10:56.870Z
Murch
<p>How can I get circulating supply and total supply for cryptocurrencies?</p>
<p>I am not talking about using coinmarketcap's API, I want to get the data myself. Should I get it from the source-code?</p>

CC BY-SA 4.0
2021-10-18T16:03:19.007Z
For all cryptocurrencies/altcoins? That is going to be a lot of work. There are thousands and the vast majority are effectively scams.
Michael Folkson
<money-supply><source-code>
How do I get circulating supply and total supply for cryptocurrencies?
user127862
# How do I get circulating supply and total supply for cryptocurrencies?

(Asked by: username_0 on 2021-10-18)

How can I get circulating supply and total supply for cryptocurrencies?

I am not talking about using coinmarketcap's API, I want to get the data myself. Should I get it from the source-code?

**Tags:** money-supply, source-code

> **Comments:**
> **username_1**: For all cryptocurrencies/altcoins? That is going to be a lot of work. There are thousands and the vast majority are effectively scams.  

---

## 1 answers

### Answer by username_2 on 2021-10-18. Score: 1 | Accepted answer

For Bitcoin you can get the total supply via [`gettxoutsetinfo`](https://bitcoincore.org/en/doc/0.21.0/rpc/blockchain/gettxoutsetinfo/), which produces the following output:

```
$ bitcoin-cli gettxoutsetinfo
{
  "height": 705603,
  "bestblock": "0000000000000000000173b87bcaa99c5020eb16b13a856f7015130889c5ff93",
  "transactions": 45865084,
  "txouts": 75262497,
  "bogosize": 5632719734,
  "hash_serialized_2": "ac0ce667248d97678d5eb4fcfb7e2ae667e205775765852e5b595afa73fb2eb0",
  "disk_size": 4613582238,
  "total_amount": 18847318.79243407
}

```

In the output, `total_amount` refers to the sum of all existing bitcoins. While other cryptocurrencies are not on-topic here, `gettxoutsetinfo` should also work for most Bitcoin-derived altcoins.

> **Comments:**
> **username_0**: Awesome! And what about other blockchain? any hints?  
> **username_2**: As mentioned in the answer, this site only covers Bitcoin, but a few other cryptocurrencies have their own stackexchange sites and you could ask there.  

---

