Created
June 19, 2020 04:40
-
-
Save sxiii/1cfdfa96be7cdd614f498a58c56e32bb to your computer and use it in GitHub Desktop.
Show rate of BTC on different exchanges
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
| ######### CRYPTOCOMPARE UBER API! ############ | |
| ### API: https://min-api.cryptocompare.com ### | |
| ############################################## | |
| # 67 exchanges ############################### | |
| ############################################## | |
| base=BTC | |
| target=USD | |
| markets=(Bit2C BitBay Bitfinex bitFlyer bitFlyerFX Bithumb BitMarket Bitmex Bitso BitSquare Bitstamp BitTrex Bleutrade BTC38 BTCC BTCChina BTCE BTCMarkets BTCXIndia BTER CCEDK CCEX Cexio CHBTC OKEX Coinbase CoinCheck Coinfloor Coinone Coinse Coinsetter Cryptonator Cryptopia CryptoX Cryptsy Exmo Gatecoin Gemini HitBTC Huobi itBit Jubi Korbit Kraken LakeBTC Liqui LiveCoin LocalBitcoins Luno MercadoBitcoin MonetaGo Novaexchange OKCoin Paymium Poloniex QuadrigaCX Quoine TheRockTrading Tidex TuxExchange Unocoin Vaultoro ViaBTC WavesDEX Yacuna Yobit Yunbi Zaif btcXchange CCCAGG ANXBTC EtherDelta EthexIndia Binance Lykke Remitano Coinroom Abucoins BXinth Gateio HuobiPro MtGox) | |
| for item in ${markets[@]}; do | |
| ((x++)) | |
| rr=$(curl -s "https://min-api.cryptocompare.com/data/generateAvg?fsym=$base&tsym=$target&e=$item" | jq -r '.RAW.PRICE') | |
| #echo -e $x "\t:\t" $item "\t:\t" $rr | |
| #printf "%.*d\n" '$x' 3 #"\t:\t %.*" $item "\t:\t %.*" $rr "\n" | |
| printf '%4s%s %16s %s %4s\n' $x ':' $item ':' $rr | |
| done | |
| echo Total: $x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment