title: How do I resolve the CORS error in Yelp API call?
body: <p>I'm trying to call the Yelp Fusion API using AJAX but I'm getting the following error below. Could someone help me figure out what's going on here? </p>
  
  <p><em>api.yelp.com/v3/:1 Failed to load resource: the server responded with a status of 403 ()
  index.html:1 Access to XMLHttpRequest at '<a href="https://api.yelp.com/v3/" rel="nofollow noreferrer">https://api.yelp.com/v3/</a>' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.</em></p>
  
  <p>Here's the code I'm using:</p>
  
  <pre><code>var queryURL = "https://api.yelp.com/v3/";
  var apiKey = "my key" 
  
  $.ajax({
      url: queryURL,
      method: "GET",
      headers: {
          "accept": "application/json",
          "Access-Control-Allow-Origin":"*",
          "Authorization": `Bearer ${apiKey}`
       }
   }).then(function(res) {
       var results = res.data
       console.log(results);
   });
  </code></pre>