title: building a 5 day forecast using open weather api AJAX and JS
body: <p>I am trying to build a 5-day forecast using open weather API. The parameters I'm using based on the website are not working, it returns undefined. Also, is there a way I can get the main temp from day 1, 2 and etc. Please help</p>
  
  <p>here's my code:</p>
  
  <pre><code>$.ajax({
    url: 'http://api.openweathermap.org/data/2.5/forecast', //API Call
    dataType: 'json',
    type: 'GET',
    data: {
      q: city,
      appid: key,
      units: 'metric',
      cnt: '10'
    },
    success: function(data) {
      var wf = '';
      $.each(data, function(index, val) {
        wf += '&lt;p&gt;&lt;b&gt;' + data.city.name + '&lt;/b&gt;&lt;img src=http://openweathermap.org/img/w/' + data.list[0].weather.icon + '.png&gt;&lt;/p&gt;' + data.list[0].main.temp + '&amp;deg;C' + ' | ' + data.list[0].weather.main + ", " + data.list[0].weather.description
      });
      $("#showWeatherForcast").html(wf);
    }
  });
  </code></pre>