I'm trying to retrieve a value from a JSON object by making an API call in a Google Sheet.
Below is the script I am using:
function getBitcoinPrice()
{
var url = "https://acx.io//api/v2/tickers/btcaud.json";
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
var data = JSON.parse(json);
var price = data.buy;
return price;
}
However, when I try to run this function in my Google Sheet, it gives me an error message:
Error: Unknown range name 'getBitcoinPrice'.