I'm looking for the historic circulated supply of Bitcoin. I'm aware I can get the current supply by creating my own node. But I need the supply at a given date.

Does anyone know of an API to get it.


1 Answer 1

  1. gettxoutsetinfo will return the current supply in total_amount so it doesn't help. getblockstats doesn't return supply info for the block.

  2. Bitcoinvisuals has the supply chart and you can move the cursor over the chart to know supply at any given date in past.


  1. Since we know block rewards (new coins added to supply) and they are reduced to half after every 210,000 blocks, we can also write a simple script to know the supply at any given block:
def btcSupplyAtBlock(b):
    if b >= 33 * 210000:
        return 20999999.9769
        reward = 50e8
        supply = 0
        y = 210000  
        while b > y - 1:
            supply = supply + y * reward
            reward = int(reward / 2.0)
            b = b - y
        supply = supply + b * reward
        return (supply + reward) / 1e8

if __name__ == "__main__":
    block = 1000000

Source: https://github.com/ndsvw/Bitcoin-Supply-Calculator

  1. There are lot of third party APIs available like coinmetrics to achieve the same.

In 3 the script will not include lot of exceptions mentioned in this answer by sipa: https://bitcoin.stackexchange.com/a/38998/

  • Thank you so much this is very detailed and gives me a lot of options
    – johnny 5
    Apr 8, 2021 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.