How can I determine the number of confirmations of a transaction and its fee using the Blockchain.info DATA API? How can I know if any given transaction has confirmations and has paid the miner's fee, using the BlockChain.info DATA API?
If a transaction returned from the http://blockchain.info/rawtx/$tx_hash endpoint has a confirmation, it will have a block_height member. You can then calculate roughly its number of confirmations by subtracting that value from the latest height retrieved from the http://blockchain.info/latestblock endpoint.

Code example, in Ruby:

#!/usr/bin/env ruby
require "open-uri"
require "json"
# call this script with `ruby block_height.rb &lt;tx_hash&gt;`
tx = ARGV.shift
puts "Getting info for #{tx}..."
j = JSON.parse open("http://blockchain.info/rawtx/#{tx}").read
if j["block_height"]
  b = JSON.parse open("http://blockchain.info/latestblock").read
  puts "%d confirmations" % (b["height"] - j["block_height"] + 1)
else
  time_since = Time.now.gmtime.to_i - j["time"]
  puts "It's been #{time_since} seconds since the transaction was created."
  puts "It's not been ten minutes yet!" if time_since &lt; 600
  puts "It's due any time now." if time_since &gt;= 600
end


Calculating the transaction fee is best done by summing the inputs and outputs of a transaction, then subtracting the inputs from the outputs. Difference is the transaction fee.