One liner to fetch the simple price of any token listed
on CoinGecko via their open API.
You need the utilities curl
and jq
. Type the command below into your terminal:
curl -s -X 'GET' 'https://api.coingecko.com/api/v3/simple/price?ids=dragon-egg%2Cstorm-token%2Cwrapped-avax%2Cstellar%2Cmonero%2Cbitcoin%2Cethereum&vs_currencies=usd%2Ceur&include_market_cap=false&include_24hr_vol=false&include_24hr_change=false&include_last_updated_at=false' -H 'accept: application/json' | jq . --sort-keys && date
{
"bitcoin": {
"eur": 35902,
"usd": 42097
},
"dragon-egg": {
"eur": 20.4,
"usd": 23.92
},
"ethereum": {
"eur": 2443.86,
"usd": 2865.55
},
"monero": {
"eur": 192.26,
"usd": 225.44
},
"stellar": {
"eur": 0.23257,
"usd": 0.2727
},
"storm-token": {
"eur": 2.05,
"usd": 2.41
},
"wrapped-avax": {
"eur": 54.24,
"usd": 63.6
}
}
Wed Sep 22 04:49:51 CEST 2021