Filter instagram api results for tag AND username

I would like to create an application that retrieves images from a specific tag, but only from a specific username. For example: I would like to see #skullcandysnow images, but only those from the account name 'skullcandy'.

This is how I pull the tag:

$(function() { $.ajax({ type: "GET", dataType: "jsonp", cache: false, url: "https://api.instagram.com/v1/tags/skullcandysnow/media/recent?client_id=d1685ded02da4c5eb2b08632f1256119&access_token=fce470c159274e2b9482976f93fd3435", success: function(data) { for (var i = 0; i < 10; i++) { $(".SC-IG").append("<img class='SC-instagram-image' src='" + data.data[i].images.low_resolution.url +"' /><div class='counts'><img src='images/skullcandyad_04.jpg'><h3 class='ig-likescount'>" + data.data[i].likes.count +"</h3><h3 class='ig-commentscount'>" + data.data[i].comments.count +"</h3></div> "); } } }); }); 

You can see what I'm doing here: http://yobeat.com/zz_testing/yobeatinstagramwidget_v3.html

Thanks!

+7
source share
1 answer

Looking through the code provided by the user on his website "understood", the solution was as follows:

 imgLimit = 1000; // Grab all TAGS of choice $.ajax({ type: "GET", dataType: "jsonp", cache: false, url: "https://api.instagram.com/v1/tags/TAG_OF_CHOICE/media/recent?client_id=CLIENT_ID&access_token=ACCESS_TOKEN", success: function(data) { // Loop through the data and only add the images that match a certain user ID for (var i = 0; i < imgLimit; i++) { var usertag = data.data[i].user.id; if (usertag === "USER_ID_OF_CHOICE") { // Add image to page addImage(data.data[i]); } } } }); 
+2
source

All Articles