JSFiddle - React, Tailwind, and code Playground

by Ulrich Bangert

HTML

<div id="btcusd"></div>
<div id="btceur"></div>
<div id="btcgbp"></div>
<input id="exchangecalc">

JavaScript

/** Cur **/
apiCall = async () => {
  let res = await fetch('https://blockchain.info/ticker');
  let data = await res.json();
  document.getElementById("exchangecalc").value = data.USD['15m'];
  document.getElementById("btcusd").innerText = data.USD['15m'];
  document.getElementById("btceur").innerText = data.EUR['15m'];
  document.getElementById("btcgbp").innerText = data.GBP['15m'];
  // usw.
};

setInterval(apiCall, 1000);