Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bitcoin prices in real time from the coindesk website api (bash script)
# Credit to David Walsh for the original script <>
# The improved version of David's script doesn't go back to prompt. It keeps refreshing the prices every 5 seconds.
# Prices are in USD, EUR & GBP (in real time)
# curl must be installed in terminal
echo "Coindesk BTC: "
echo " USD EUR GBP "
while [ 1 ]
curl -s | python -c "import json, sys; bitcoin=json.load(sys.stdin); print bitcoin['bpi']['USD']['rate'] + '\t' + bitcoin['bpi']['EUR']['rate'] + '\t' + bitcoin['bpi']['GBP']['rate']"
printf "\033[A"
sleep 5
Copy link

ghost commented Jul 7, 2020

hey, nice one! check my scripts, some of them have websockets or curl loop to keep fetching the latest rate of bitcoin and other cryptos..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment