Author

Topic: show balance from a btc address (Read 2074 times)

sr. member
Activity: 392
Merit: 251
June 09, 2016, 04:21:09 PM
#18
Hahaha. You guys.

There's an easier way. (A much easier way) If you don't care about the low quality. Just try it out!

It's on the bottom of btc-priceimg.herokuapp.com

This is an example. Click "Quote" to view the code.

legendary
Activity: 1274
Merit: 1006
Trainman
June 09, 2016, 03:23:47 PM
#17
This returns your balance in satoshis


Code:
function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

echo 
'Address Balance: ' getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');

and this your balance in btc

Code:
 function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

$insatoshi =  getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');
$intbtc $insatoshi 100000000;
echo 
'Address Balance: ' $intbtc;
Code:
 Parse error : syntax error, unexpected 'Â ' (T_STRING) in
/home/vhosts/host/bal.php on line 3
i think the code is somewhere throwing the error
its working for me,Delete all the white space characters in line 3

Works perfectly, however, wouldn't you still need the key for the blockchain api or am I wrong?
not for the particular function does not need any key
sr. member
Activity: 322
Merit: 250
Verify my Bitcoin Address before EVERY transaction
June 09, 2016, 02:44:19 PM
#16
This returns your balance in satoshis


Code:
function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

echo 
'Address Balance: ' getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');

and this your balance in btc

Code:
 function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

$insatoshi =  getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');
$intbtc $insatoshi 100000000;
echo 
'Address Balance: ' $intbtc;
Code:
 Parse error : syntax error, unexpected 'Â ' (T_STRING) in
/home/vhosts/host/bal.php on line 3
i think the code is somewhere throwing the error
its working for me,Delete all the white space characters in line 3

Works perfectly, however, wouldn't you still need the key for the blockchain api or am I wrong?
legendary
Activity: 1708
Merit: 1036
June 09, 2016, 02:39:58 PM
#15
The mentioned code snippet is definetly working

Hello, thanks for this info, is very important to me...


any one can tell me how can i add this comment to some kind of "markers"  in this forum for further read???




Click "Watch" at the bottom of the thread.
full member
Activity: 140
Merit: 100
DEGEN Future Traders
June 09, 2016, 02:25:57 PM
#14
The mentioned code snippet is definetly working

Hello, thanks for this info, is very important to me...


any one can tell me how can i add this comment to some kind of "markers"  in this forum for further read???


legendary
Activity: 1624
Merit: 2481
May 22, 2016, 11:55:18 AM
#13
The mentioned code snippet is definetly working
legendary
Activity: 1274
Merit: 1006
Trainman
May 20, 2016, 09:52:12 AM
#12
This returns your balance in satoshis


Code:
function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

echo 
'Address Balance: ' getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');

and this your balance in btc

Code:
 function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

$insatoshi =  getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');
$intbtc $insatoshi 100000000;
echo 
'Address Balance: ' $intbtc;
Code:
 Parse error : syntax error, unexpected 'Â ' (T_STRING) in
/home/vhosts/host/bal.php on line 3
i think the code is somewhere throwing the error
its working for me,Delete all the white space characters in line 3
sr. member
Activity: 504
Merit: 250
InvestnTrade. Latest from the crypto space.
May 20, 2016, 09:32:17 AM
#11
You can use a blockchain explorer. You can look for them online. This is useful if you dont have your bitcoin wallet at hand. All bitcoin addresses are visible publicly in the blockchain. All you need to have is the bitcoin address or the transaction id. Smiley
legendary
Activity: 1274
Merit: 1004
May 20, 2016, 09:26:16 AM
#10
This returns your balance in satoshis


Code:
function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

echo 
'Address Balance: ' getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');

and this your balance in btc

Code:
 function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

$insatoshi =  getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');
$intbtc $insatoshi 100000000;
echo 
'Address Balance: ' $intbtc;
Code:
 Parse error : syntax error, unexpected 'Â ' (T_STRING) in
/home/vhosts/host/bal.php on line 3
i think the code is somewhere throwing the error
sr. member
Activity: 412
Merit: 287
May 20, 2016, 06:24:13 AM
#9
Insight servers are open, but you need to find them. Simple curl requests will do.

Stratum servers (they power electrum) do the same, but you can find a list of them using IRC. Stratum offers SPV proofs for a transaction, so you can prove it was in the blockchain and they're not feeding you lies.
I wrote a PHP library for working with stratum servers. https://github.com/Bit-Wasp/stratum-php

It might be worth writing a library in JS to talk to stratum servers, I haven't seen one yet.

Edit: Avoid using the BC.I API. They've had extraordinary number of problems. Just use something that talks to a full node.
hero member
Activity: 750
Merit: 500
May 19, 2016, 05:00:04 PM
#8
if using jquery you could also do

Code:
var addr = "15urYnyeJe3gwbGJ74wcX89Tz7ZtsFDVew";
$.getJSON('https://insight.bitpay.com/api/addr/' + addr + '/balance', function(balance){
  $('#balance').html(balance / 100000000);
});
legendary
Activity: 1274
Merit: 1006
Trainman
May 19, 2016, 09:17:22 AM
#7
This returns your balance in satoshis


Code:
function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

echo 
'Address Balance: ' getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');

and this your balance in btc

Code:
 function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

$insatoshi =  getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');
$intbtc $insatoshi 100000000;
echo 
'Address Balance: ' $intbtc;
sr. member
Activity: 322
Merit: 250
May 19, 2016, 08:52:07 AM
#6
as the tital says i want to fetch balance from an bitcoin address and want to show it into my wapsite. any help will be appricialted but no spamming please and i have seen aome short of bitcoin api thing like blockchain api but i didnt exactly get it that how to implement them so if someone know then better how it with php or just tell how to implement it
thank you for giving your time

i think someone in this section https://bitcointalksearch.org/topic/easy-way-to-show-current-balance-on-the-website-using-php-2881 have some problem like you. maybe u can get "how" in that thread.
thanks
legendary
Activity: 1120
Merit: 1038
May 19, 2016, 07:32:42 AM
#5
If you want a simpler API, try the Blockchain.info API

Simply query "https://blockchain.info/q/addressbalance/ADDRESS" to get the balance in satoshis in plaintext.
Unlike block.io, it doesn't require any installs or auth keys.
legendary
Activity: 1274
Merit: 1004
May 19, 2016, 03:35:45 AM
#4
you can use block.io api
read more here https://block.io/api
hello thank uou for your feedback i checked the site,made the account and get the api but i didnt get it exavtly how to setup it on my site using php can you supply me an example code.i have downloaded the block-io.php
sr. member
Activity: 308
Merit: 250
May 18, 2016, 11:27:58 PM
#3
you can use block.io api
read more here https://block.io/api
legendary
Activity: 1274
Merit: 1004
May 18, 2016, 11:24:12 PM
#2
hello its 24hr passed and nobody replyed to my thread please someone tell me how can i fetch the balance of a bitcoin address and show it on a web page please tell me i amreally in need of this
legendary
Activity: 1274
Merit: 1004
May 16, 2016, 11:18:32 PM
#1
as the tital says i want to fetch balance from an bitcoin address and want to show it into my wapsite. any help will be appricialted but no spamming please and i have seen aome short of bitcoin api thing like blockchain api but i didnt exactly get it that how to implement them so if someone know then better how it with php or just tell how to implement it
thank you for giving your time
Jump to: