index.js 663 Bytes
// const fetch = require('node-fetch');

// const url = 'https://api.upbit.com/v1/candles/weeks/?market=KRW-BTC&count=1';
// const options = {method: 'GET', headers: {Accept: 'application/json'}};

// fetch(url, options)
//   .then(res => res.json())
//   .then(json => console.log(json))
//   .catch(err => console.error('error:' + err));

const fetch = require('node-fetch');

const url = 'https://api.upbit.com/v1/candles/minutes/1?market=KRW-BTC&count=1';
const options = {method: 'GET', headers: {Accept: 'application/json'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));