Created
August 24, 2020 23:53
-
-
Save soundslikeinfo/6a6e49a68eefb4bdff909bdb084f9e38 to your computer and use it in GitHub Desktop.
Using your CMC api token, retrieve the symbol and price for selected tokens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cryptonumbers { | |
curl -H 'X-CMC_PRO_API_KEY: {CMC_PRO_API_KEY}' \ | |
-H 'Accept: application/json' \ | |
-d 'symbol=BTC,ETH,LTC' \ | |
-G https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest | \ | |
jq -r '.data | .[] | .symbol, .quote.USD.price' | \ | |
while read -r SYMBOL; do | |
read -r PRICE | |
echo -e "${SYMBOL} - \$${PRICE}" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment