the command is $(urlfetch json https://api.coingecko.com/api/v3/simple/price?ids=Ergo&vs_currencies=USD)
It returns {"ergo":{"usd":2.28}}, I only want to show 2.28(the price) how can I fetch the data?
the command is $(urlfetch json https://api.coingecko.com/api/v3/simple/price?ids=Ergo&vs_currencies=USD)
It returns {"ergo":{"usd":2.28}}, I only want to show 2.28(the price) how can I fetch the data?
Hey @Serene Orangutan!
It couldn’t be easier! With JSON you move up the keys tree using dots.
So you do it like this:
$(eval e=$(urlfetch json https://api.coingecko.com/api/v3/simple/price?ids=Ergo&vs_currencies=USD).ergo.usd)
Similar topics:
/t/need-an-ethereum-command/1534643633217736787#m1534643635167957172
/t/help-with-a-crypto-command/1534636306993385568#m1534636308780027939
@member this API has Shibacoin under "Shiba-inu"