Bitcoin Forum

Bitcoin => Wallet software => Topic started by: DannyHamilton on January 24, 2013, 08:13:09 PM



Title: blockchain.info JSON
Post by: DannyHamilton on January 24, 2013, 08:13:09 PM
There could be a bug in my code, so if anyone doesn't see the same issue as me, let me know and I'll dig further into my own code and close this thread, but as far as I can tell when I use the following URL:

Code:
http://blockchain.info/address/1AFs9GrQyPQpN5W73RzizcEap1CQ7whPZT?format=json

The JSON that I get back includes the following:

Code:
{ "result":1500000,
  "block_height":204163,
  "time":1350749027,
  "inputs":[ { "prev_out":{ "n":2,
                            "value":485942,
                            "addr":"16E2VCqveJZiEh77yXsh8GNpZFbY2t4hdk",
                            "tx_index":30122197,
                            "type":0
                          }
             },
             { "prev_out":{ "n":0,
                            "value":11000,
                            "addr":"139SbwC4T6LVR1mWjL8AqH4u4DCpZanR49",
                            "tx_index":30169217,
                            "type":0
                          }
             },
             { "prev_out":{ "n":1,
                            "value":1573077,
                            "addr":"1AFs9GrQyPQpN5W73RzizcEap1CQ7whPZT",
                            "tx_index":30211949,
                            "type":0
                          }
             },
             { "prev_out":{ "n":7,
                            "value":80000,
                            "addr":"1NNG4YUCJNVKpwGn1hwJ6bxYH26paYFHnA",
                            "tx_index":30093759,
                            "type":0
                          }
             }
           ],
  "vout_sz":2,
  "relayed_by":"178.150.63.172",
  "hash":"f43cf0e169de3a352dff67f046d4ae57983933f56766d45e203dfeb36b447559",
  "vin_sz":18,
  "tx_index":30215179,
  "ver":1,
  "out":[
        ],
  "size":2744
},

If I look at the same URL http://blockchain.info/address/1AFs9GrQyPQpN5W73RzizcEap1CQ7whPZT (without the ?format=json) using my browser I can find this same transaction, f43cf0e169de3a352dff67f046d4ae57983933f56766d45e203dfeb36b447559, and it has 2 outputs.  Why don't the outputs show up in the JSON?  Is this a bug, or am I misunderstanding the JSON API?


Title: Re: blockchain.info JSON
Post by: piuk on January 25, 2013, 01:28:17 AM
I can confirm this is a bug which may or may not appear depending on the request cookies. Please add "show_adv=true" to url as a fix for the time being.

http://blockchain.info/address/1AFs9GrQyPQpN5W73RzizcEap1CQ7whPZT?format=json&show_adv=true


Title: Re: blockchain.info JSON
Post by: DannyHamilton on January 25, 2013, 01:45:55 AM
I can confirm this is a bug which may or may not appear depending on the request cookies. Please add "show_adv=true" to url as a fix for the time being.

http://blockchain.info/address/1AFs9GrQyPQpN5W73RzizcEap1CQ7whPZT?format=json&show_adv=true
Thanks!