title: How do you use API keys in HTTP Requests?
body: <p>I am struggling to work out if there is a way to use an API key when trying to call data from an endpoint and if so, where would I put it?</p>
  <pre><code>var request = new XMLHttpRequest(&quot;Ocp-Apim-Subscription-Key: {KEY}&quot;)
  
  // Open a new connection, using the GET request on the URL endpoint
  request.open('GET', 'https://api.sportsdata.io/v3/mlb/scores/json/AreAnyGamesInProgress')
  
  request.onload = function () {
    // Begin accessing JSON data here
    }
  
  // Send request
  request.send()
  </code></pre>