The resource loading... loading...

coingecko_crawler

Author: linsilence, Date: 2021-05-08 16:26:41
Tags:


  

const URL_API = 'https://api.coingecko.com/api/v3/coins/markets';

$.Grab_Symbols_Marketcap = function (count) {
    const param = `vs_currency=usd&order=market_cap_desc&per_page=${count}&page=1&sparkline=false`;
    const ret = JSON.parse(HttpQuery(URL_API + '?' + param));
    if (isDebug) Log('grab_marketcap 1 ret: ', ret);

    let symbos = [];
    ret.forEach(e => {
        symbos.push(e.symbol.toUpperCase());
    });
    if (isDebug) Log('grab_marketcap 2 ret: ', symbos);
    return symbos;
};

function main() {
    const s = $.Grab_Symbols_Marketcap(4);
    Log(s);
}

More