title: Javascript Fetch Giphy Api
body: <p>I am trying to fetch Gif Image through Fetch API.
  But my code is not working. I'm new to working with API's.
  Please have a look at my code and help me.
  Here is my code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
   &lt;title&gt;Fetch API&lt;/title&gt;
   
    &lt;script
    src="https://code.jquery.com/jquery-3.3.1.js"
    integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
    crossorigin="anonymous"&gt;
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
   &lt;script&gt; 
    let giphyAPI = "https://github.com/Giphy/GiphyAPI/raw/master/api_giphy_header.gif";
  
    function setup(){
  
     fetch(giphyAPI)
     .then(response =&gt; {
      return response.json();
     })
     .then(json =&gt; {
      createImg(json.data[0].images.original.url);
     })
        
     .catch(err =&gt; console.log(err));
  
    }
   &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>