Bitcoin Forum
May 08, 2024, 04:36:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: show balance from a btc address  (Read 2046 times)
jak3 (OP)
Legendary
*
Offline Offline

Activity: 1274
Merit: 1004


View Profile
May 17, 2016, 04:18:32 AM
 #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
1715142989
Hero Member
*
Offline Offline

Posts: 1715142989

View Profile Personal Message (Offline)

Ignore
1715142989
Reply with quote  #2

1715142989
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
jak3 (OP)
Legendary
*
Offline Offline

Activity: 1274
Merit: 1004


View Profile
May 19, 2016, 04:24:12 AM
 #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
Dev_Sempak_coin
Sr. Member
****
Offline Offline

Activity: 308
Merit: 250



View Profile
May 19, 2016, 04:27:58 AM
 #3

you can use block.io api
read more here https://block.io/api

jak3 (OP)
Legendary
*
Offline Offline

Activity: 1274
Merit: 1004


View Profile
May 19, 2016, 08: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
jambola2
Legendary
*
Offline Offline

Activity: 1120
Merit: 1038


View Profile
May 19, 2016, 12:32:42 PM
 #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.

No longer active on bitcointalk, however, you can still reach me via PMs if needed.
wintermeasures
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile
May 19, 2016, 01:52:07 PM
 #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://bitcointalk.org/index.php?topic=2881.0 have some problem like you. maybe u can get "how" in that thread.
thanks
chrisvl
Legendary
*
Offline Offline

Activity: 1274
Merit: 1006

Trainman


View Profile WWW
May 19, 2016, 02:17:22 PM
Last edit: May 19, 2016, 02:33:13 PM by chrisvl
 #7

This returns your balance in satoshis


Code:
<?php
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:
 <?php
function getBalance($address) {
    return 
file_get_contents('https://blockchain.info/de/q/addressbalance/'$address);
}

$insatoshi =  getBalance('1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj');
$intbtc $insatoshi 100000000;
echo 
'Address Balance: ' $intbtc;

esotericizm
Hero Member
*****
Offline Offline

Activity: 750
Merit: 500



View Profile
May 19, 2016, 10: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);
});
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
May 20, 2016, 11: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.

Bitwasp Developer.
jak3 (OP)
Legendary
*
Offline Offline

Activity: 1274
Merit: 1004


View Profile
May 20, 2016, 02:26:16 PM
 #10

This returns your balance in satoshis


Code:
<?php
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:
 <?php
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
bitcoineverything
Sr. Member
****
Offline Offline

Activity: 504
Merit: 250


InvestnTrade. Latest from the crypto space.


View Profile WWW
May 20, 2016, 02:32:17 PM
 #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

We are here to give you all the latest from the Cryptocurrency space!
chrisvl
Legendary
*
Offline Offline

Activity: 1274
Merit: 1006

Trainman


View Profile WWW
May 20, 2016, 02:52:12 PM
 #12

This returns your balance in satoshis


Code:
<?php
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:
 <?php
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

bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
May 22, 2016, 04:55:18 PM
 #13

The mentioned code snippet is definetly working

TheBarMan
Full Member
***
Offline Offline

Activity: 140
Merit: 100

DEGEN Future Traders


View Profile
June 09, 2016, 07: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???


ebliever
Legendary
*
Offline Offline

Activity: 1708
Merit: 1035


View Profile
June 09, 2016, 07: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.

Luke 12:15-21

Ephesians 2:8-9
jaydipmodhwadia
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250

Verify my Bitcoin Address before EVERY transaction


View Profile WWW
June 09, 2016, 07:44:19 PM
 #16

This returns your balance in satoshis


Code:
<?php
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:
 <?php
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?
chrisvl
Legendary
*
Offline Offline

Activity: 1274
Merit: 1006

Trainman


View Profile WWW
June 09, 2016, 08:23:47 PM
 #17

This returns your balance in satoshis


Code:
<?php
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:
 <?php
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

Sir_lagsalot
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
June 09, 2016, 09: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.

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!