Reputation: 101
Anyone know how to do this? Just looking to pull in price data for certain cryptos into google sheets.
Upvotes: 0
Views: 3599
Reputation: 489
To add to the previous answers
Google Finance is quite limited, with only a few of the biggest coins being tracked.
In alternative, use a proper API which gives you an easy to use endpoint, example:
=IMPORTDATA("https://cryptoprices.cc/BTC/")
Upvotes: 1
Reputation: 1461
You can use the built-in funcion GOOGLEFINANCE.
=GOOGLEFINANCE("CURRENCY:BTCUSD")
: $54,348.20=GOOGLEFINANCE("CURRENCY:ETHUSD")
: $2,614.33=GOOGLEFINANCE("CURRENCY:LTCUSD")
: $254.00=GOOGLEFINANCE("CURRENCY:EURUSD")
: $1.21I recommend you to take a look to the documentation of the function, as it has different features that can be helpful to you. For example, you can creates a chart inside a cell to display the currency exchange trend in a specific time range.
Upvotes: 2
Reputation: 15318
You can use Binance and this function
function pricePair(currencyPair) {
var url = 'https://api3.binance.com/api/v3/ticker/price?symbol=' + currencyPair;
var reponse = UrlFetchApp.fetch(url);
var json = reponse.getContentText();
var data = JSON.parse(json);
return data.price;
}
with parameter currencyPair as BTCUSDT, ETHUSDT, DOGEUSDT, ...
Upvotes: 1