

This get-btc-price script then simply requests the original Binance API and prints the output. The live price of Bitcoin is 28,561.43 per (BTC / USD) today with a current market cap of 552.98B USD. resBTCPrice = JSON.parse(UrlFetchApp.fetch('',options).getContentText()) You can request your own script (that is deployed outside of Google servers) in the Apps Script. If you're using Google Spredsheets and you don't mind getting an estimate price instead of the exact price trading on Binance at the moment of the request, you can use the =GOOGLEFINANCE("CURRENCY:BTCUSD") formula to get the price of BTC provided by Google (not by Binance).

It's probable that so many Google users are trying to request the data that CloudFront blocks some of Google servers from flooding them with requests. The request to CloudFront (that caches the results from the "real" Binance API) goes from Google servers.įrom my own experience, this happens often. Request ID: UyFmlcv2qjKSBvlulcdv06KufF5KCoHm0CpZJu28tE5-aw9KvRquHw= If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. Try again later, or contact the app or website owner. There might be too much traffic or a configuration error. We can't connect to the server for this app or website at this time. ĮRROR: The request could not be satisfied
Binance price btc code#
In the Apps Script environment, your code throws the parsing error because the remote server sometimes returns a HTML page containing an error - not the expected JSON. Other answers provide correct ways to get the data in other environments than Google Apps Script.
