Is there a simple method of tracking number of transactions sent to an address?


I want to create a counter in my store displaying the number of units sold.

I'm not using a shopping cart, but simply placing a bitpay button. I'm wondering if there is a way to query the blockchain, that will return the number of transactions sent to an address, over a given time period.


Posted 2013-07-25T09:10:13.840

Reputation: 386



You can see the number of transactions for a Bitcoin address. That's easy. Either through a desktop wallet(Like Bitcoin QT) or using services like Just search for an address there.

You can't do this for your site thought because you're using Bitpay and they provide a unique address for each payment to your site.

Even if you weren't using Bitpay, you would need to generate a unique address for each purchase on your site to be able to figure out which customer paid how much and when.

You could take an aggregate of the transactions and display them along with each unique address you used but I would strongly advise against it. Because then people could easily trace where you spend the Bitcoins that your customers paid you.

Try getting the number from your accounting records instead of trying to get it from Bitcoin payments ;)

Emre Kenci

Posted 2013-07-25T09:10:13.840

Reputation: 3 058

Thanks, this was informative. The thing I'm looking to do though, is create a dynamically generated sales counter.

Short of installing a 3rd party shopping cart, do you have any suggestions for that? – mardlin – 2013-07-26T18:46:31.560

You must be keeping records of sales somewhere. Just need to get it from there and display it on your site. Perhaps talk to the person managing your site? But definitely don't use Bitcoin transactions for this. Don't forget to upvote and/or mark as accepted answer if you are satisfied with the answer ;) – Emre Kenci – 2013-07-27T21:54:20.463

Other methods are not within the scope of this stack exchange. – Emre Kenci – 2013-07-27T21:57:06.867


Assuming you have Bitcoin-Qt in use:

  • open the debug window and go to its 'console' view
  • issue the command listaccounts and from the output select an account name
  • use that name to issue a listtransactions your_account_name command
  • in the output count the occurances of "category" : "receive"

These same commands are available through the RPC interface of Bitcoin-Qt, so that is how you can script the above.


Posted 2013-07-25T09:10:13.840

Reputation: 176

Nope, he said he's using bitpay. – Emre Kenci – 2013-07-25T19:20:35.093