title: How to use an API Key for an Ajax call?
body: <p>I am trying to include an API key for the first time from New York Times API ( <a href="http://developer.nytimes.com/" rel="nofollow noreferrer">http://developer.nytimes.com/</a>) and use ajax to fetch news from it to populate a local website but I'm not seeing any results. I was told to Make sure your API key is set in the URL's query parameters but I'm not sure how to do it.</p>
  
  <pre><code> ?api-key=your-key 
  </code></pre>
  
  <p>Here is what I have done: </p>
  
  <pre><code>// Built by LucyBot. www.lucybot.com
  var url = "https://api.nytimes.com/svc/search/v2/articlesearch.json";
  url += '?' + $.param({
  'api-key': "111111111111111111111111111111"
  });
  $.ajax({
  url: url,
  method: 'GET',
  }).done(function(result) {
  console.log(result);
  }).fail(function(err) {
  throw err;
  });
  </code></pre>
  
  <p>I need to see the url in json format for various stories such as business, technology, etc and use them for an ajax call.</p>