Advertisement
JudeAustin

Help with JSON

Apr 8th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. def balance_io(cls, address):
  2. h = urllib2.urlopen('http://btc.blockr.io/api/v1/address/info/%s' % address)
  3. json = simplejson.load(h)
  4. json = simplejson.load(json)
  5. f = data['balance']
  6. return f
  7.  
  8. This is what the page returns, I am just trying to get the balance:
  9.  
  10. {
  11. "status": "success",
  12. "data": {
  13. "address": "14xg41kHFVfLX5LjYD4QbWaVwTNUiWK14n",
  14. "is_unknown": false,
  15. "balance": 0,
  16. "totalreceived": 0.26362206,
  17. "nb_txs": 4,
  18. "first_tx": {
  19. "time_utc": "2014-03-31T18:18:07Z",
  20. "tx": "46e99e14a6a413713565f8a20b83d05670ad99f76948f7e142a3ae3a11785254",
  21. "block_nb": "293433",
  22. "value": 0.1300608,
  23. "confirmations": 1407
  24. },
  25. "last_tx": {
  26. "time_utc": "2014-04-05T18:02:09Z",
  27. "tx": "de3547d3b59f1b0104d37dd833706aefaeae4444c727216bf9a64fd899d50dfd",
  28. "block_nb": "294382",
  29. "value": -0.13356126,
  30. "confirmations": 458
  31. },
  32. "is_valid": true
  33. },
  34. "code": 200,
  35. "message": ""
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement