📜  coindeskapi ethereum - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:05.130000             🧑  作者: Mango

代码示例1
const request = require("request");

request.get("https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR,CNY,JPY,GBP", function(error, response, body) {
    if (error)
        throw error;
    else if (!response)
        throw new Error("no response");
    else if (response.statusCode != 200)
        throw new Error("bad response");
    else
        console.log(JSON.stringify(JSON.parse(body), null, 4));
});