title: Why does it say that I have an invalid API key with RapidAPI?
body: <p>I just got started on learning how to use APIs. For my first project, I decided to use RapidAPI marketplace, but I'm having an issue.
  I tried testing the API in postman, but it says I have an invalid API key for some reason even though I'm pretty sure that I don't. On the chrome console, it gives me the error as shown in the image:</p>
  <p><a href="https://i.stack.imgur.com/bG0xt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bG0xt.png" alt="enter image description here" /></a></p>
  <p>It basically says that the server responded with an error of status 404. I also have a config file to store the api key. It basically looks like this:</p>
  <pre class="lang-js prettyprint-override"><code>const API_KEY = &quot;randomlettersandnumbers&quot;;
  
  export {API_KEY};
  </code></pre>
  <p>I'm using the LiveServer extension on VSCode. This is how my folders look like on VSCode:</p>
  <p><a href="https://i.stack.imgur.com/5NLlQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5NLlQ.png" alt="enter image description here" /></a></p>
  <p>The rest of my code looks like this:</p>
  <pre class="lang-js prettyprint-override"><code>import {API_KEY} from './config';
  
  fetch(&quot;https://community-open-weather-map.p.rapidapi.com/weather?q=London%2Cuk&amp;lat=0&amp;lon=0&amp;callback=test&amp;id=2172797&amp;lang=null&amp;units=%22metric%22%20or%20%22imperial%22&amp;mode=xml%2C%20html&quot;, {
      &quot;method&quot;: &quot;GET&quot;,
      &quot;headers&quot;: {
          &quot;x-rapidapi-key&quot;: API_KEY,
          &quot;x-rapidapi-host&quot;: &quot;community-open-weather-map.p.rapidapi.com&quot;
      }
  })
  .then(response =&gt;response.json())
  .then(response =&gt; {
      console.log(response);
      console.log(response.content);
  })
  .catch(err =&gt; {
      console.error(err);
  });
  </code></pre>
  <pre class="lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html lang=&quot;en&quot;&gt;
    &lt;head&gt;
      &lt;title&gt;API Example&lt;/title&gt;
      &lt;!-- Required meta tags --&gt;
      &lt;meta charset=&quot;utf-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1, shrink-to-fit=no&quot;&gt;
  
      &lt;!-- Bootstrap CSS --&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css&quot; integrity=&quot;sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T&quot; crossorigin=&quot;anonymous&quot;&gt;
    &lt;/head&gt;
    &lt;body&gt;
        This better work!
      &lt;script src = &quot;js/main.js&quot; type = &quot;module&quot;&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>