Instantly access real-time Bitcoin wallet balances with our secure and easy-to-use API, empowering your applications with accurate data.
Get Free API Key (Mainnet)$ curl https://api.bitcoin-balance-api.com/v1/address/34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo?apikey=$SECRET
{ "status": 200, "balance": 19989726659 }
Get Access to the Bitcoin Mainnet with no limit on requests and an impeccable uptime. We offer custom solutions for your use-case.
1. Create API Key 2. Make PaymentBitcoin Balance API is used in several backends, small and large.
Check out our integration examples:
Python
import requests
import json
address = "34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo"
apikey = "SECRET"
s = requests.Session()
r = s.get('https://api.bitcoin-balance-api.com/v1/address/%s?apikey=%s' % (address,apikey))
if r.status_code == 200:
response = json.loads(r.content)
print(f'Bitcoin Balance: %s' % (response['balance']))
NodeJS
(async () => {
try {
const res = await fetch('https://api.bitcoin-balance-api.com/v1/address/34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo?apikey=$SECRET');
const response = await res.json();
console.log(`Bitcoin Balance: ${response.balance}`);
} catch (err) {
console.log(err.message); //can be console.error
}
})();
Perl
use LWP::UserAgent;
use JSON;
my $request = LWP::UserAgent->new()->get(
"https://api.bitcoin-balance-api.com/v1/address/34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo?apikey=$SECRET"
);
my $response = decode_json($request->content);
print "Bitcoin Balance: $response->{'balance'}";
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://api.bitcoin-balance-api.com/v1/address/34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo?apikey=$SECRET');
$result = curl_exec($ch);
curl_close($ch);
$obj = json_decode($result);
echo 'Bitcoin Balance: ' . $obj->balance;
Ruby
require "net/https"
require "json"
url = URI.parse("https://api.bitcoin-balance-api.com/v1/address/34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo?apikey=$SECRET")
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.new(url.host, url.port)
res.use_ssl = true
request = res.get(url.request_uri)
response = JSON.parse(request.body)
puts("Bitcoin Balance: #{response['balance']}")