Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a Bitcoin blog and I'd love to display a ticket of the total amount of Bitcoins in existence. Unfortunately, I'm not sure where I can find a JSON feed for this (now that MTGOX is gone). Is there something like this I can utilize?

share|improve this question

Take a look at this, its the api. it gives a json feed for many things.

share|improve this answer

The number of bitcoins in existence at any given time is predictable in advance. To get an approximate number, you just need to look it up in a table based on today's date. The Bitcoin wiki has one at Controlled supply.

To get the precise number of mined bitcoins at any given moment, you would take the current block height (available from any of a number of different places) and apply a fixed formula to get the current total number of rewards claimed so far. This number would be exact because there is no possibility of varying from the predetermined reward schedule (and there is no other way of conjuring bitcoins into existence other than mining).

The following is a simple Python function which calculates the total bitcoins in existence at any time given the block height. It should be straightforward to translate to PHP.

def total_bitcoins(height):
    total = 0
    reward = 50
    while height >= 210000:
        total += reward * 210000
        height -= 210000
        reward /= 2
    total += reward * height
    return total

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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