sa google sheets file nyo click TOOLS >> SCRIPT EDITOR and paste this code below.
function updateCoinsPH() {
var btcphp = UrlFetchApp.fetch("https://quote.coins.ph/v1/markets/BTC-PHP");
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("buy");
var c1=JSON.parse(btcphp.getContentText());
sheet.getRange(1, 3).setValue(c1.market.ask);
sheet.getRange(1, 4).setValue(c1.market.bid);
}
Once ma paste nyo na code, click nyo yung project trigger (yung icon na prang CLOCK TIMER) then ilagay nyo 1 minute interval para sa pag refresh ng rate. pwede nyo din baguhin like every 5 mins or something na gusto nyo.
How to read the above code? dun sa .getSheetByName("buy") palitan nyo na name ng sheet nyo kung saan nyo gusto ilagay yung coins.ph rate.
sheet.getRange(1, 3).setValue(c1.market.ask); ito naman yung BUY rate sa coins.ph, yung number 1 is row number yan, yung 3 yan yung column number. so ikaw na ma decide kung saan mo ilalagay yung na row at column base sa design mo.
sheet.getRange(1, 4).setValue(c1.market.bid); same din dito.
sa coins summary naman ito codes ko:
para sa real time rate ito code ko:
=CRYPTOFINANCE("BITTREX:BTC/USDT", "price", "", $L$1)
so ilalagay nyo yan sa cell ng coin na gusto nyo makuha rate. palitan nyo lang yung exchange na gamit nyo at yung trading pair and ok na yan.
yung logo ng bawat coin ito naman code:
=IMAGE("https://files.coinmarketcap.com/static/img/coins/32x32/bitcoin.png", 1)
so baguhin nyo lang yung name ng png file like ethereum.png for ethereum or litecoin.png for litecoin and so on. yung name ng file kinuha ko yan sa coinmarketcap kung ano ginamit nila sa code nila sa website.
yung SYSMBOL column ko sa coin summary nilagay ko lang yan so type nyo lang name ng coins. yung QTY yan yung bilang ng coins nyo so either may link kayo form another spreadsheet or just type it lang. then yung AMOUNT formula lang yan by multiplying QTY and PRICE.
ok guys pag may question ask nyo lang.
Thanks