<div>
  BTC / ETH =
  <span class="demo">&hellip;</span>
</div>
const prefix = 'https://api.coingecko.com/api/v3/coins/';
Promise.all(
  ['bitcoin', 'ethereum'].map(
    c => fetch(prefix + c).then(response => response.json())
  )
)
  .then(rates => {
    const [rateBTC, rateETH] = rates.map(
      rate => rate.market_data.current_price.rub
    );
    document.querySelector('.demo').innerText = rateBTC / rateETH;
  })
  .catch(console.error);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.