Bitcoin Forum
June 25, 2024, 02:19:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do I extract the JSON balance data from this chain.com API call  (Read 1622 times)
gatomalo (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0



View Profile WWW
November 05, 2014, 02:51:09 PM
 #1

I'm new to PHP and I need help. I have a test wallet - and I want to extract the balance data from this API call from chain.com

{"hash":"16sxw3dFK4aq8WH8gzWDW8XjyutJojsKJG","balance":346929,"received":346929,"sent":0,"unconfirmed_received":0,"unconfirmed_sent":0,"unconfirmed_balance":0}

With PHP is there an easy way to parse this out? I tried the object class route but failed-

object(stdClass)#1 (7) {
  ["hash"]=>
  string(34) "16sxw3dFK4aq8WH8gzWDW8XjyutJojsKJG"
  ["balance"]=>
  int(346929)
  ["received"]=>
  int(346929)
  ["sent"]=>
  int(0)
  ["unconfirmed_received"]=>
  int(0)
  ["unconfirmed_sent"]=>
  int(0)
  ["unconfirmed_balance"]=>
  int(0)
}

Any help would be welcomed.
henry4
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
November 13, 2014, 05:12:51 PM
 #2


If you have a lot of JSON data that you just want to process once-only - you can use https://json-csv.com to convert it to a CSV file - then if you open the file up in a spreadsheet the balance will all be in the same column.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!