4
1
I am a complete noob to PHP. But I just wanted to know how can you use the BlockChain API to get your wallet balance. I tried but could get no result. I do not even know how to print it. Please help. This is my current code :-
<?php
$guid="xxxxxxxxx";
$main_password="xxxxxxxxx";
$json_url = "https://blockchain.info/merchant/$guid/balance?password=$main_password";
$json_data = file_get_contents($json_url);
$json_feed = json_decode($json_data);
$message = $json_feed->message;
?>
And what exactly is the guid? Is it the wallet identifier?
balance; echo $balance; ?> this is the result I got. Don't know why. – rahulgarg12342 – 2014-07-18T19:24:04.727
just tested it with my own wallet it worked perfectly fine, maybe your put in the wrong credentials – Dennis Kriechel – 2014-07-18T19:27:25.773
is the guid the wallet identifier? – rahulgarg12342 – 2014-07-18T19:28:11.040
yes its is, maybe you missed out a semicolon or an php tag, seems like an syntax error in your php maybe try to copy paste again – Dennis Kriechel – 2014-07-18T19:28:19.453
ahh got it. The 2 factor auth was messing it up. Figured it out. Thanks. Just a little curious. How could I modify this to be performed after a certain time interval? – rahulgarg12342 – 2014-07-18T19:34:01.960
@rahulgarg12342 How did you bypass the 2 factor authenticator? I am using the block chain api to do exactly the same thing, it is working but for 2 factor authenticator enabled wallets I am getting the error. How do I deal with that? – Criesto – 2014-09-04T08:23:38.940