Skip to content

Instantly share code, notes, and snippets.

@bensig
Created November 24, 2021 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bensig/48c2df965b036f28e15a143233e03ab9 to your computer and use it in GitHub Desktop.
Save bensig/48c2df965b036f28e15a143233e03ab9 to your computer and use it in GitHub Desktop.
Script to get bitcoin balance of any BTC address
#!/bin/bash
# description: prints balance for any bitcoin address
# requirements: jq and curl
# usage: $ bitcoinbalance.sh btcaddress
curl -s https://api.blockcypher.com/v1/btc/main/addrs/$1 | jq '.balance' | awk '{print $1/100000000}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment