title: Loop with datetime
body: <p>I would like to retrieve information on three different dates. For that I created a loop:</p>
  <pre><code>date = datetime.datetime.now()
  date7 = date + datetime.timedelta(days=7)
  date7 = date7.strftime(&quot;%Y%m%d&quot;)
  date14 = date + datetime.timedelta(days=14)
  date14 = date14.strftime(&quot;%Y%m%d&quot;)
  dates=[]
  dates.append(date7)
  dates.append(date14)
  dates.append(date21)
  
  for i in dates :
    url = &quot;https://X{}&quot;.format(dates)
    url_request = requests.get(url)
    url_request_data = url_request.json()
    print(len(url_request_data[&quot;departures&quot;]))
  </code></pre>
  <p>And I get the error</p>
  <blockquote>
  <p>&quot;KeyError: 'departures'.&quot;</p>
  </blockquote>
  <p>However, when I try this code without looping (testing with a single date) it works.
  Could someone help me please? I am lost</p>