-1

I want to accept Bitcoin on my site. I assign each incoming sale a Bitcoin public key/address from a pool of non-used addresses.

I add records to the pool of non-used addresses by generating 1000 receiving addresses on a separate computer using MultiBit and then importing them into the table. I do this as often as I need when I am running out of addresses.

My question is this:

What is the best way or API (and most simple, that does not require bitcoind installation?!) to monitor incoming deposits to a list of addresses to which I don't have public keys for? Basically I would need a cron to check for incoming transactions to these addresses so I can detect payment acceptance.

  • I found http://blockr.io/documentation/api so I can get balance of public address and also transactions, but it only returns first and last transaction, see example http://tbtc.blockr.io/api/v1/address/info/muUKpvAjSZFXcPVAwZsSaYw3xg29Z61x2K so how do I get list of all transactions for a Bitcoin address? I know I can use blockchain.info but I prefer blockr.io because it also supports testnet – user3791176 Aug 06 '14 at 09:47
  • Ok, found it. http://tbtc.blockr.io/api/v1/address/txs/muUKpvAjSZFXcPVAwZsSaYw3xg29Z61x2K returns a list of all transactions – user3791176 Aug 06 '14 at 09:51

1 Answers1

-1

If you use btc.blocker.io's API you can find the balance of any address use the url like so

http://btc.blockr.io/api/v1/address/info/PublicAdressGoesHere

It will have an outcome something close to this

{"status":"success","data":{"address":"198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi","is_unknown":false,"balance":8000.00176957,"balance_multisig":0,"totalreceived":8000.00176957,"nb_txs":30,"first_tx":{"time_utc":"2009-02-22T10:50:53Z","tx":"0f0fbcc18fd0d090ad3402574df8404cec1176bc000f9aa0dc19f8d832ff94db","block_nb":"5219","value":400,"confirmations":385428},"last_tx":{"time_utc":"2015-11-25T00:47:46Z","tx":"77bfb2a8098508646980195c7885baf710c1b30b83cfb7432c6de01a1afe1bc7","block_nb":"385201","value":0.000135,"confirmations":5446},"is_valid":true},"code":200,"message":""}

if you want to read the data in python try using this code. It will out put the data into a file called data.txt And it takes data in from a file called address.txt. only do one address at a time

import urllib2.urlopen
with open("address.txt","r") as file:
  address = str(file.read())
data = urllib2.urlopen("http://btc.blockr.io/api/v1/address/info/" + address)
with open("data.txt", "w") as a:
 a.write(str(data.read()))

hope this helps!