I believe it is the amount of btc given/taken from the address for a given transaction. If you look at the "single address" API call in that documention, in the response you see:
"tx":[--Array of Transactions--]
In this array is a set of transactions for the given address.
As you can see in this screenshot:
https://www.dropbox.com/s/1j4rwqhosdtoghq/Screenshot_2014-02-21-00-43-48.pngIt is (almost) the same as the blockchain address page:
https://blockchain.info/address/18Zbf9aEKwZTeR92u4tuhQenoen9prSeNpHowever, in the first screenshot the first result is 0, and every transaction hash has the next transaction's value, if that makes sense.
And in the json, I can clearly see the first transaction has result: 0, so I don't think I am querying it wrong. Is this a bug in their API?
Thanks for the response,
jackpf
It may be a bug in the API. As I said, the "result" label:value pair is not in the documentation for the API. An [--Array of Transactions--] should be a set of "single transactions". Take a look at the "single transaction" API call in that documentation, you'll see that "result" isn't in the specified output.
Perhaps a more reliable way to determine how much was spent and/or received would be to add up the inputs and/or outputs.
For example you can see in this txs array element:
{
"result":0,
"block_height":286985,
"time":1392950149,
"inputs":[
{
"prev_out":{
"n":12,
"value":100000000,
"addr":"1PyZ3PT8bv6dy4HcNzX2ba2zQm1sAgmEqE",
"tx_index":113566887,
"type":0
}
}
],
"vout_sz":2,
"relayed_by":"178.63.63.214",
"hash":"5f9b073f26a3b7b86d44b6aed164d7973867e1ed5388ad327e02ee95232e8123",
"vin_sz":1,
"tx_index":113580991,
"ver":1,
"out":[
{
"n":0,
"value":10000000,
"addr":"18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp",
"tx_index":113580991,
"type":0
},{
"n":1,
"value":89990000,
"addr":"1LWxoxVx4dC5FrwmWiVL3uCTS5frj8sbGv",
"tx_index":113580991,
"type":0
}
],
"size":226
},
That there are no "inputs" array elements with a "prev_out" that was sent to an "addr" of 18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp. Therefore nothing is "spent"
Meanwhile there is a single "out" array element that was sent to an "addr" of 18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp. That one array element has a "value" of 10000000.
Therefore 10000000 satoshis (0.1 BTC) were "received" at that address with this transaction.
Meanwhile you can see in this txs array element:
{
"result":10000000,
"block_height":286604,
"time":1392772520,
"inputs":[
{
"prev_out":{
"n":1,
"value":4720000,
"addr":"18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp",
"tx_index":113271796,
"type":0
}
}
],
"vout_sz":2,
"relayed_by":"176.9.104.178",
"hash":"fcd4187e00b13575fd7859d2530bb90596e3f2c73063d9b959d37706447c1d95",
"vin_sz":1,
"tx_index":113417334,
"ver":1,
"out":[
{
"n":0,
"value":400000,
"addr":"15xb5bwoCbSprTNjotfc5VSFSMkUpCQsig",
"tx_index":113417334,
"type":0
},{
"n":1,
"value":4310000,
"addr":"18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp",
"tx_index":113417334,
"type":0
}
],
"size":226
},
That there is one "inputs" array elements with a "prev_out" that was sent to an "addr" of 18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp. That one array element has a "value" of 4720000.
Therefore a previously unspent output received previously at 18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp valued at 4720000 satoshis (0.0472 BTC) are "spent" with this transaction.
Meanwhile there is also a single "out" array element that was sent to an "addr" of 18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp. That one array element has a "value" of 4310000.
Therefore 4310000 satoshis (0.0431 BTC) were "received" at that address with this transaction.
4310000 received less 4720000 spent equals a net change of -410000 (-0.0041 BTC).
Therefore this transaction results in a net change of -410000 (-0.0041 BTC) to the value associated with the address 18Zbf9aEKwZTeR92u4tuhQenoen9prSeNp.