user4522: I need to query blockchain.info with an address and determine how much is there, ignoring transactions that don't have 3 confirmations.
Can anyone give me a hint how to do this?

user1409: You can do this in two API calls, plus some filtering:

Get the current block height from http://blockchain.info/latestblock
Get the list of transactions for the address from http://blockchain.info/address/$hash_160?format=json 
Filter transactions from #2 where the height is less than current block height minus 3.

Rough Ruby code:
require 'open-uri'
require 'json'
require 'pp'

desired_address = '1dice7W2AicHosf5EL3GFDUVga7TgtPFn' #high traffic address good for example code!
get_transactions_with_minimum_of_n_confirmations = 3

latestblock = JSON.parse open('http://blockchain.info/latestblock').read
address = JSON.parse open("http://blockchain.info/address/#{desired_address}?format=json").read

current_block_height = latestblock["height"]
pp address["txs"].select {|tx| tx["block_height"] < (current_block_height - get_transactions_with_minimum_of_n_confirmations) }

Keep in mind that you're going to retrieve a list of ALL transactions involving that address. It'd be nice of Blockchain.info let you specify a minimum number of confirmations to limit transactions to on the address call.

user4757: Get the block count: 
http://blockchain.info/q/getblockcount

Subtract 3 from that number.
Get the transactions from the address you're looking for: 
http://blockchain.info/address/$bitcoin_address?format=json&limit=50&offset=0

This returns 50 transactions by default, change the 'limit' value to wherever you might need it to be. Setting 'offset' to 5 will allow you to skip the first 5 transactions. Make sure you don't set offset to something greater than the total number of transactions on a particular address, it won't ever return anything. 
Then set up your code to ignore any transaction that's newer than 3 blocks ago.

4522: <p>I need to query blockchain.info with an address and determine how much is there, ignoring transactions that don't have 3 confirmations.</p>

<p>Can anyone give me a hint how to do this?</p>
 1409: <p>You can do this in two API calls, plus some filtering:</p>

<ol>
<li>Get the current block height from <code>http://blockchain.info/latestblock</code></li>
<li>Get the list of transactions for the address from <code>http://blockchain.info/address/$hash_160?format=json</code> </li>
<li>Filter transactions from #2 where the height is less than current block height minus 3.</li>
</ol>

<p>Rough Ruby code:</p>

<pre><code>require 'open-uri'
require 'json'
require 'pp'

desired_address = '1dice7W2AicHosf5EL3GFDUVga7TgtPFn' #high traffic address good for example code!
get_transactions_with_minimum_of_n_confirmations = 3

latestblock = JSON.parse open('http://blockchain.info/latestblock').read
address = JSON.parse open("http://blockchain.info/address/#{desired_address}?format=json").read

current_block_height = latestblock["height"]
pp address["txs"].select {|tx| tx["block_height"] &lt; (current_block_height - get_transactions_with_minimum_of_n_confirmations) }
</code></pre>

<p>Keep in mind that you're going to retrieve a list of ALL transactions involving that address. It'd be nice of Blockchain.info let you specify a minimum number of confirmations to limit transactions to on the address call.</p>
 4757: <p>Get the block count: </p>

<pre><code>http://blockchain.info/q/getblockcount
</code></pre>

<p>Subtract 3 from that number.</p>

<p>Get the transactions from the address you're looking for: </p>

<pre><code>http://blockchain.info/address/$bitcoin_address?format=json&amp;limit=50&amp;offset=0
</code></pre>

<p>This returns 50 transactions by default, change the 'limit' value to wherever you might need it to be. Setting 'offset' to 5 will allow you to skip the first 5 transactions. Make sure you don't set offset to something greater than the total number of transactions on a particular address, it won't ever return anything. </p>

<p>Then set up your code to ignore any transaction that's newer than 3 blocks ago.</p>
