title: python Trying to access nested dict element
body: <pre class="lang-py prettyprint-override"><code>
  {&quot;type&quot;:&quot;product&quot;,&quot;**products**&quot;:[
  {&quot;id&quot;:466501,&quot;title&quot;:&quot;Nicholas Cole    Cellars GraEagle Red    Wing&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/466501-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:455061,&quot;title&quot;:&quot;Wieninger    Wiener Gemischter    Satz&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/455061-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:452162,&quot;title&quot;:&quot;The    Magnificent Wine Company Steak    House&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/452162-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:464255,&quot;title&quot;:&quot;Chateau    Morrisette Black    Dog&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/464255-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:434441,&quot;title&quot;:&quot;Dr.    Konstantin Frank    Gewurztraminer&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/434441-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:451567,&quot;title&quot;:&quot;Delectus    Dirty Old Dog (    Magnum)&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/451567-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:437451,&quot;title&quot;:&quot;Bleasdale    Frank Potts Red    Blend&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/437451-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:451606,&quot;title&quot;:&quot;Dr.    Konstantin Frank    Rkatsiteli&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/451606-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:440486,&quot;title&quot;:&quot;Dog    House Checker's    Cab&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/440486-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;},
  {&quot;id&quot;:445496,&quot;title&quot;:&quot;Dog    House Charlie's    Chard&quot;,&quot;image&quot;:&quot;https://spoonacular.com/productImages/445496-312x231.jpg&quot;,&quot;imageType&quot;:&quot;jpg&quot;}],
  &quot;offset&quot;:0,&quot;number&quot;:10,&quot;totalProducts&quot;:7573,&quot;processingTimeMs&quot;:380,&quot;expires&quot;:1594279471761}
  
  </code></pre>
  <p>Note: this is API data!</p>
  <p>I'm trying to access the products list content how can I do that?</p>
  <p>this is my code</p>
  <pre><code>product = input(&quot;enter any food name: &quot;)
     url = 'https://api.spoonacular.com/food/products/search?query={product}&amp;apiKey=7c467a28410940378d56e53829f5efb6&amp;q='
     req = requests.get(url).json()
     data_dict = dict(req)
     for product in data_dict['products']:
         print(product['id'])
  </code></pre>