title: jQuery $.getJSON - How do I parse a flickr.photos.search REST API call?
body: <p>Trying to adapt the $.getJSON Flickr example:</p>
  
  <pre><code>$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?",
      function(data){
      $.each(data.items, function(i,item){
          $("&lt;img/&gt;").attr("src", item.media.m).appendTo("#images");
          if ( i == 3 ) return false;
      });
  });
  </code></pre>
  
  <p>to read from the flickr.photos.search REST API method, but the JSON response is different for this call.</p>
  
  <p>This is what I've done so far:</p>
  
  <pre><code>var url = "http://api.flickr.com/services/rest/?method=flickr.photos.search&amp;api_key=YOURAPIKEYHERE&amp;tags=yokota+air+base&amp;safe_search=1&amp;per_page=20";
  var src;
  $.getJSON(url + "&amp;format=json&amp;jsoncallback=?", function(data){
      $.each(data.photos, function(i,item){
          src = "http://farm"+ item.photo.farm +".static.flickr.com/"+ item.photo.server +"/"+ item.photo.id +"_"+ item.photo.secret +"_m.jpg";
          $("&lt;img/&gt;").attr("src", src).appendTo("#images");
          if ( i == 3 ) return false;
      });
  });
  </code></pre>
  
  <p>I guess I'm not building the image src correctly. Couldn't find any documentation on how to build the image src, based on what the JSON response is. <strong>How do you parse a flickr.photos.search REST API call?</strong></p>