2014-03-30 173 views

回答

5

嗯,將這項工作對您:

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

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

使用https://blockchain.info/de/q API。

1

如果您正在檢查Coinbase地址的餘額,您可能無法獲得預期的結果,因爲Coinbase會將您的比特幣在內部混合到不同的地址。獲得真實平衡的唯一方法是通過賬戶。

<?php 
$accountId = '<Account Id>'; 
$account = $client->getAccount($accountId); 
$balance = $account->getBalance(); 
$btc = $balance->getAmount();