title: Use JSON output from Flickr to display images from search
body: <p>I need to display the images on my site from a JSON request.</p>
  
  <p>I have the JSON:</p>
  
  <p><a href="https://api.flickr.com/services/rest/?method=flickr.photos.search&amp;api_key=6a970fbb976a06193676f88ef2722cc8&amp;text=sampletext&amp;sort=relevance&amp;privacy_filter=1&amp;safe_search=1&amp;per_page=5&amp;page=1&amp;format=json&amp;nojsoncallback=1" rel="nofollow noreferrer">https://api.flickr.com/services/rest/?method=flickr.photos.search&amp;api_key=6a970fbb976a06193676f88ef2722cc8&amp;text=sampletext&amp;sort=relevance&amp;privacy_filter=1&amp;safe_search=1&amp;per_page=5&amp;page=1&amp;format=json&amp;nojsoncallback=1</a></p>
  
  <p>And I have the format I need to put the photo URL in:
  <a href="https://www.flickr.com/services/api/misc.urls.html" rel="nofollow noreferrer">https://www.flickr.com/services/api/misc.urls.html</a></p>
  
  <p>But I don't know how I would loop through that, I found some examples similar, but I am still having trouble seeing what I need.</p>
  
  <p>I am using JavaScript/jQuery to pull the info.</p>
  
  <p>I figure I would have this in a loop.</p>
  
  <pre><code>CurrentPhotoUrl = 'https://farm'+CurrentPhotoFarm+'.staticflickr.com/'+CurrentPhotoServer+'/'+CurrentPhotoId+'_'+CurrentPhotoSecret+'_n.jpg'
  </code></pre>
  
  <p>But each of those variables would need to be populated with an value from the element. I would need to loop through all 5 elements that are in the JSON.</p>
  
  <p>Any help on how to create this loop would be greatly appreciated.</p>