Bruno
Bruno

Reputation: 101

Import crypto price feed into google sheet cell?

Anyone know how to do this? Just looking to pull in price data for certain cryptos into google sheets.

Upvotes: 0

Views: 3599

Answers (3)

Pedro
Pedro

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

fullfine
fullfine

Reputation: 1461

Answer

You can use the built-in funcion GOOGLEFINANCE.

Examples

  • Bitcoin: =GOOGLEFINANCE("CURRENCY:BTCUSD") : $54,348.20
  • Etherum: =GOOGLEFINANCE("CURRENCY:ETHUSD"): $2,614.33
  • Litecoin: =GOOGLEFINANCE("CURRENCY:LTCUSD"): $254.00
  • Euro: =GOOGLEFINANCE("CURRENCY:EURUSD") : $1.21

More features

I 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

Mike Steelson
Mike Steelson

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

Related Questions