0

Using curl https://blockchain.info/unspen?active=... with a valid ID I expect an output (according to my book) in a readable JSON format.

Instead I get:

bitcoin@raspberrypi ~ $ curl https://blockchain.info/unspent?active=1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK
{"unspent_outputs":[{"tx_hash":"f2c245c38672a5d8fba5a5caa44dcef277a52e916a0603272f91286f2b052706","tx_hash_big_endian":"0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2","tx_output_n":1,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":8450000,"value_hex":"0080efd0","confirmations":314771,"tx_index":47854970},{"tx_hash":"0365fdc169b964ea5ad3219e12747e9478418fdc8abed2f5fe6d0205c96def29","tx_hash_big_endian":"29ef6dc905026dfef5d2be8adc8f4178947e74129e21d35aea64b969c1fd6503","tx_output_n":0,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":100000,"value_hex":"0186a0","confirmations":259154,"tx_index":71083209},{"tx_hash":"d9717f774daab8d3dd470853204394c82e3c01097479575d6d2ee97d7b3bdfa1","tx_hash_big_endian":"a1df3b7b7de92e6d5d57797409013c2ec8944320530847ddd3b8aa4d777f71d9","tx_output_n":0,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":1000000,"value_hex":"0f4240","confirmations":251313,"tx_index":75974855},{"tx_hash":"3f1df69df90d097981ca9c97ad8b6a32daed345565a433f8c8e472b2dab2ac79","tx_hash_big_endian":"79acb2dab272e4c8f833a4655534edda326a8bad979cca8179090df99df61d3f","tx_output_n":1,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":719787,"value_hex":"0afbab","confirmations":245426,"tx_index":79887883},{"tx_hash":"417bdb6f5db3e830407f94d1a82d1667e738b19da3679b7263ebfb913394efdd","tx_hash_big_endian":"ddef943391fbeb63729b67a39db138e767162da8d1947f4030e8b35d6fdb7b41","tx_output_n":0,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":10000,"value_hex":"2710","confirmations":165235,"tx_index":170905487},{"tx_hash":"d049d6039f9d1cb2625bac294d7465b4b1077bd5bc0e30e01e02b184db524c1f","tx_hash_big_endian":"1f4c52db84b1021ee0300ebcd57b07b1b465744d29ac5b62b21c9d9f03d649d0","tx_output_n":0,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":11100,"value_hex":"2b5c","confirmations":162697,"tx_index":174630347},{"tx_hash":"b8a6470c7a38d0983effed00a3f75c74ba371da1387352f35d1df155851ea8d1","tx_hash_big_endian":"d1a81e8555f11d5df3527338a11d37ba745cf7a300edff3e98d0387a0c47a6b8","tx_output_n":0,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":10000,"value_hex":"2710","confirmations":161791,"tx_index":175949432},{"tx_hash":"a2b9570e26e3991fc999c42dc8c6eea7b06514b61814da1a71b56c6ba2ae651c","tx_hash_big_endian":"1c65aea26b6cb5711ada1418b61465b0a7eec6c82dc499c91f99e3260e57b9a2","tx_output_n":0,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":10000,"value_hex":"2710","confirmations":161782,"tx_index":175955161},{"tx_hash":"05230cb8cd8c6a3788ed41433dfdd68a1a608cc8feb3bc1c29d97ce84bec070e","tx_hash_big_endian":"0e07ec4be87cd9291cbcb3fec88c601a8ad6fd3d4341ed88376a8ccdb80c2305","tx_output_n":0,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":10000,"value_hex":"2710","confirmations":161782,"tx_index":175955664},{"tx_hash":"bd345c2bdbb8c17a0c66a8579ea701830e8248ba21b2d73a5dca21d8e9175fee","tx_hash_big_endian":"ee5f17e9d821ca5d3ad7b221ba48820e8301a79e57a8660c7ac1b8db2b5c34bd","tx_output_n":1,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":3020,"value_hex":"0bcc","confirmations":76597,"tx_index":338789479},{"tx_hash":"892275c430610334994cc5836436515057284cc4572775487c1b06a1b49c5ab4","tx_hash_big_endian":"b45a9cb4a1061b7c48752757c44c28575051366483c54c9934036130c4752289","tx_output_n":1,"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac","value":6236,"value_hex":"185c","confirmations":44565,"tx_index":384311717}]}
0

This was just a problem of the terminal I used on a mac.

Adding | python -m json.tool to the command does the trick, as described here.

Output now is:

bitcoin@raspberrypi ~ $ curl https://blockchain.info/unspent?active=1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3571    0  3571    0     0  10043      0 --:--:-- --:--:-- --:--:-- 10087
{
    "unspent_outputs": [
        {
            "confirmations": 314772,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "f2c245c38672a5d8fba5a5caa44dcef277a52e916a0603272f91286f2b052706",
            "tx_hash_big_endian": "0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2",
            "tx_index": 47854970,
            "tx_output_n": 1,
            "value": 8450000,
            "value_hex": "0080efd0"
        },
        {
            "confirmations": 259155,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "0365fdc169b964ea5ad3219e12747e9478418fdc8abed2f5fe6d0205c96def29",
            "tx_hash_big_endian": "29ef6dc905026dfef5d2be8adc8f4178947e74129e21d35aea64b969c1fd6503",
            "tx_index": 71083209,
            "tx_output_n": 0,
            "value": 100000,
            "value_hex": "0186a0"
        },
        {
            "confirmations": 251314,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "d9717f774daab8d3dd470853204394c82e3c01097479575d6d2ee97d7b3bdfa1",
            "tx_hash_big_endian": "a1df3b7b7de92e6d5d57797409013c2ec8944320530847ddd3b8aa4d777f71d9",
            "tx_index": 75974855,
            "tx_output_n": 0,
            "value": 1000000,
            "value_hex": "0f4240"
        },
        {
            "confirmations": 245427,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "3f1df69df90d097981ca9c97ad8b6a32daed345565a433f8c8e472b2dab2ac79",
            "tx_hash_big_endian": "79acb2dab272e4c8f833a4655534edda326a8bad979cca8179090df99df61d3f",
            "tx_index": 79887883,
            "tx_output_n": 1,
            "value": 719787,
            "value_hex": "0afbab"
        },
        {
            "confirmations": 165236,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "417bdb6f5db3e830407f94d1a82d1667e738b19da3679b7263ebfb913394efdd",
            "tx_hash_big_endian": "ddef943391fbeb63729b67a39db138e767162da8d1947f4030e8b35d6fdb7b41",
            "tx_index": 170905487,
            "tx_output_n": 0,
            "value": 10000,
            "value_hex": "2710"
        },
        {
            "confirmations": 162698,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "d049d6039f9d1cb2625bac294d7465b4b1077bd5bc0e30e01e02b184db524c1f",
            "tx_hash_big_endian": "1f4c52db84b1021ee0300ebcd57b07b1b465744d29ac5b62b21c9d9f03d649d0",
            "tx_index": 174630347,
            "tx_output_n": 0,
            "value": 11100,
            "value_hex": "2b5c"
        },
        {
            "confirmations": 161792,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "b8a6470c7a38d0983effed00a3f75c74ba371da1387352f35d1df155851ea8d1",
            "tx_hash_big_endian": "d1a81e8555f11d5df3527338a11d37ba745cf7a300edff3e98d0387a0c47a6b8",
            "tx_index": 175949432,
            "tx_output_n": 0,
            "value": 10000,
            "value_hex": "2710"
        },
        {
            "confirmations": 161783,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "a2b9570e26e3991fc999c42dc8c6eea7b06514b61814da1a71b56c6ba2ae651c",
            "tx_hash_big_endian": "1c65aea26b6cb5711ada1418b61465b0a7eec6c82dc499c91f99e3260e57b9a2",
            "tx_index": 175955161,
            "tx_output_n": 0,
            "value": 10000,
            "value_hex": "2710"
        },
        {
            "confirmations": 161783,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "05230cb8cd8c6a3788ed41433dfdd68a1a608cc8feb3bc1c29d97ce84bec070e",
            "tx_hash_big_endian": "0e07ec4be87cd9291cbcb3fec88c601a8ad6fd3d4341ed88376a8ccdb80c2305",
            "tx_index": 175955664,
            "tx_output_n": 0,
            "value": 10000,
            "value_hex": "2710"
        },
        {
            "confirmations": 76598,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "bd345c2bdbb8c17a0c66a8579ea701830e8248ba21b2d73a5dca21d8e9175fee",
            "tx_hash_big_endian": "ee5f17e9d821ca5d3ad7b221ba48820e8301a79e57a8660c7ac1b8db2b5c34bd",
            "tx_index": 338789479,
            "tx_output_n": 1,
            "value": 3020,
            "value_hex": "0bcc"
        },
        {
            "confirmations": 44566,
            "script": "76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "tx_hash": "892275c430610334994cc5836436515057284cc4572775487c1b06a1b49c5ab4",
            "tx_hash_big_endian": "b45a9cb4a1061b7c48752757c44c28575051366483c54c9934036130c4752289",
            "tx_index": 384311717,
            "tx_output_n": 1,
            "value": 6236,
            "value_hex": "185c"
        }
    ]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.