hello users welcome to gamer-avenue.net this site is up agian . don't be shy and start contribute agian . for any help msg Mroreniko or any other admin . thanks and have a great time !

Get a list of users who have liked specific media on Instagram

any related topics !
Post Reply
User avatar
Posts: 10
Joined: Wed Jan 21, 2015 3:43 pm

Get a list of users who have liked specific media on Instagram

Post by noodniko » Wed Jan 21, 2015 3:51 pm

Using Instagram API I need to get a list of users who have liked specific media.

The following call should return the list of all users according to the documentation: https://api.instagram.com/v1/media/555/ ... CESS-TOKEN

However, I get only 120 users with no pagination parameters.

Is there any way to keep requesting the rest?

If you need the code:

String requestLikes = "https://api.instagram.com/v1/media/" + mediaID + "/likes?access_token=" + access_token + "&count=0";
// Create a request for the URL.
request = WebRequest.Create(requestLikes);
// Get the response.
response = request.GetResponse();
//Remaining calls
AddOrUpdateAppSettings("remainingCalls", response.Headers["X-Ratelimit-Remaining"]);
// Display the status.
// Get the stream containing content returned by the server.
dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
reader = new StreamReader(dataStream);
// Read the content.
responseFromServer = reader.ReadToEnd();

User avatar
Posts: 12
Joined: Tue Jan 20, 2015 4:05 pm

Re: Get a list of users who have liked specific media on Instagram

Post by mrbooma » Wed Jan 21, 2015 3:51 pm

Unfortunately they only provide the latest 120 likes in newest-to-oldest order with no pagination. You can test this by requesting a photo then liking it and you'll see that your account is on top of the list.

The only work around is to set up a job to periodically cache likes beginning shortly after the photo is first posted. Since you're always getting the newest 120 you can get them all that way. You can create a subscription to a user using the realtime api and get a ping when your user posts a new photo, then start caching likes. A decaying rate would be advised - maybe cache a couple times the first hour after it's posted, then less and less frequently the longer it's been.

Post Reply