There are a lot of APIs where you can get crypto prices. However, I used Binance because I’ve wanted to get real-time prices for the pairs I trade.
Here’s how you can get the prices of all cryptos listed on Binance:
We can make the output of this command more readable using jq
:
Now you can grep the output of this command to get the price of a trading pair.
‘crypto_prices’ script
Here’s the script I’m using to get the prices of trading pairs I follow:
- To get prices of SOL, ADA and MATIC you can run:
‘crypto_warn’ script
This script gets prices from the crypto_prices
and sends a notification/alarm
when the given condition is met:
- To get a notification/alarm when the ETH price gets above $3000 or drop below $2900 you can run:
You can find my other scripts here.