index.js
336 Bytes
const fetch = require('node-fetch');
const url = 'https://api.upbit.com/v1/candles/minutes/1?market=KRW-XRP&count=1';
const options = {method: 'GET', headers: {Accept: 'application/json'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json[0].trade_price))
.catch(err => console.error('error:' + err));