Reputation: 9
How could I use the "importdata" function in google sheets with this URL to parse the data from the URL and just show the price in a cell?
https://api.coingecko.com/api/v3/simple/price?ids=samoyedcoin&vs_currencies=usd
Here is an example of what I am looking to do, just with the above URL
=VALUE(SUBSTITUTE(SUBSTITUTE(INDEX(IMPORTDATA("https://api.pro.coinbase.com/products/ETH-USD/ticker"),0,2), "price:",""), """", ""))
Upvotes: 0
Views: 646
Reputation: 4038
You can also try using a combination of QUERY & REGEXEXTRACT:
=REGEXEXTRACT(QUERY(IMPORTDATA("https://api.pro.coinbase.com/products/ETH-USD/ticker"),"Select Col2"),"price:""(.*)""")
Upvotes: 1