title: Display API request results in HTML page using only js
body: <p>I'm kinda new to js and API,</p>
  
  <p>I have written a little code that is suppose to go ask 2 websites some data, then I only take a part of the result and add it to my html page. </p>
  
  <p>I'm trying to get it work with the first website as it will be easy to make it work on the second one when I'll have the first.</p>
  
  <p>I want to use only js and not php or other languages. </p>
  
  <p>It is not working for the moment...</p>
  
  <p>So here is my js </p>
  
  <p>Ok if you come here only now,</p>
  
  <p>My code has been updated using the 2 answers below of Justin and Aashah, the issue now is that the browser says that in order to fetch with cors, I need a http or https, and says that there is an issue with [object%20Object], so still no data showing up, if someone has a solution, please help us :)</p>
  
  <pre><code>var urlbitfinex = "https://api.bitfinex.com/v1";
  var urlkraken = "https://api.kraken.com/0/public/Ticker?pair=";
  var resultBitfinex;
  
  //request bitfinex price
  request.get(urlbitfinex + "/pubticker/btcusd",
    resultBitfinex = function(error, response, body) {
      console.log(body)
      return body;
    });
  
  //request kraken price
  request.get(urlkraken + "xbteur",
    function(error, response, body) {
      console.log(body);
    });
  
  //Pushing the result to the html
  var price_USD = document.getElementById('price-usd');
  var USDPrice = '&lt;p&gt;USDEUR Price:' + resultBitfinex.ask '&lt;/p&gt;';
  price_USD.innerHTML += USDPrice;
  </code></pre>
  
  <p>And my html</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Test&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="price-usd"&gt;
    &lt;/div&gt;
    &lt;script src="getPrices.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>