I do this in google sheets using their “app script” extension.
‘’’
function BTCPrice() {
const url = 'https://api.kraken.com/0/public/Ticker?pair=xbtusd'
const response = UrlFetchApp.fetch(url);
const json = JSON.parse(response.getContentText());
return json.result.XXBTZUSD.c[0]
}
‘’’
and then from inside the spreadsheet you can use ‘=BTCPrice()’