Instafeed.js: limit:60 not working

Created on 4 Aug 2013  Â·  36Comments  Â·  Source: stevenschobert/instafeed.js

Hey!

So regardless of what number I put over 33, it always returns only 33 images. The user account has 143 images currently. I've added the JS part of it hiding the ID and token.

var userFeed = new Instafeed({
    get: 'user',
    userId: ID,
    accessToken: 'token',
    resolution: 'low_resolution',
    limit: 60,
    sortBy: 'most-recent',
    template: '<div><img src="{{image}}" /><span class="caption">{{caption}}</span><span class="likes">{{likes}}<i class="icon-heart"></i></span></div>'
});
userFeed.run();

Thanks for the help!

bug

All 36 comments

Do you also have this problem when using a different user ID? Or is it just for this particular account.

Also, if you upload another image, does the count increase to 34?

Hi,

I find instafeed.js very useful, thanks for the great work. I am having the same problem, and it is happening with every user I test it with.

Thanks.

Hey, I haven't been able to test with any other user, but I'm using the tagged property and it shows about 34 now. Limit is still at 60.

Thanks.

It's the same with another user as well.

I'm having a similar issue, haven't spent much time trying to debug but you can view code at box31.com/insta. 
—
Sent from Mailbox for iPhone

On Thu, Aug 8, 2013 at 4:42 AM, ankeetguha [email protected]
wrote:

It's the same with another user as well.

Reply to this email directly or view it on GitHub:
https://github.com/stevenschobert/instafeed.js/issues/23#issuecomment-22300274

Thanks everyone for pitching in your comments. I'm aware of that sometimes the limit option doesn't return the full set of images that you set.

It's a behavior of the API though, so there's not much I can do to control it. (that's also why the option is called limit, not minimum).

I'll create a unified issue for this, so that I can track any discoveries I make about why the API does this in a single thread.

Just a note, I've found as you mentioned that if I frequently get one less than I've requested using the API call. IE if I set limit to 4 I get 3 if 3 then 2

@jdcauley Is there any noticeable pattern in the timestamps of those images? Or is that behavior consistent across different tags?

(Also, thanks so much for looking into it. It really is a huge help to me. I struggle just to keep up with the amount of support requests I get via email and github, so you are awesome and deserve a :hamburger: )

Let me know if there is anything specifically I can help with, I'm no JS programmer but I will check on a pattern and do some instagram research if/when I get out from under my current pile of work.

Jordan

Jordan Cauley
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Tuesday, August 27, 2013 at 12:27 PM, Steven Schobert wrote:

@jdcauley (https://github.com/jdcauley) Is there any noticeable pattern in the timestamps of those images? Or is that behavior consistent across different tags?
(Also, thanks so much for looking into it. It really is a huge help to me. I struggle just to keep up with the amount of support requests I get via email and github, so you are awesome and deserve a )

—
Reply to this email directly or view it on GitHub (https://github.com/stevenschobert/instafeed.js/issues/23#issuecomment-23350348).

Just wanted to put my 2 cents in, I'm also getting this issue as well. No matter what number I put over 33, it only pulls 33 images.

Could this be an issue with Instagram? Tried using the API Console (http://instagram.com/developer/api-console/) and had the same issue there. Sending the GET request https://api.instagram.com/v1/tags/nellyholic/media/recent?count=10 only returns 8 results.

Hacked around the problem by requesting more images than I want, then used the after callback to remove excessive images.

limit: 20, 
after: function () {
  var instagrams = $("#instagram > a");
  for (var i = 11; i < instagrams.length; i += 1) {
    instagrams[i].remove();
  }
}

(If the code does not work it's because I typed it again instead of copy-pasting)

@silence150 Oh yeah, it's definitely a behavior of the API, not Instafeed.js (that's why I don't have any control over it). I'm just not sure why the API sometimes returns less images, or if there even is a pattern.

And thanks for the suggestion on pulling more images than needed. I have suggested that method before for something similar, see issue #8 for some working code.

any updates on this ?

It seems you can use the "next_url" stored in your JSON object to retrieve more images. ( if your "limit" is higher than 32 ) but I'm having trouble integrating this technique into your script.

@janvl Unfortunately, there's still no change on how the API behaves.

On a good note though, the upcoming v1.3 release includes a .next() method you can use for loading more results :smile:.

Any idea when v1.3 is coming? I look forward to using the .next() method.

I do too :)

On Thu, Feb 13, 2014 at 5:22 AM, ianjamesgoodwin
[email protected]:

Any idea when v1.3 is coming? I look forward to using the .next() method.

Reply to this email directly or view it on GitHubhttps://github.com/stevenschobert/instafeed.js/issues/23#issuecomment-34965271
.

@staycreativedesign @ianjamesgoodwin It should be out very soon! I just need to update some docs.

If you can't wait though, you can go ahead and give it a try right now. Just take a look at the v1.3-branch. You can download the new version there, and there is a new section in the docs on Pagination.

Just a quick update to let everyone now v1.3 has been released! I doubt that will have any effect on Instagram not returning the correct amount of images, but at least there is now pagination support for anyone who wants to use it.

I've hit the same issue in that not all the images were being displayed - seemed to be limited to around 29 - however I've just tried setting limit to -1 and all the images have flooded in.

Wow that is extremely interesting will check that out!

On Mon, Apr 14, 2014 at 6:18 AM, Nick Loat [email protected] wrote:

I've hit the same issue in that not all the images were being displayed -
seemed to be limited to around 29 - however I've just tried setting limit
to -1 and all the images have flooded in.

—
Reply to this email directly or view it on GitHubhttps://github.com/stevenschobert/instafeed.js/issues/23#issuecomment-40355500
.

Yeah really cool. certainly better than the 26 or 29 I had this morning!

http://www.alanthornton.co.uk/art/roadtrip2014.html#.U0vwml7WLbw

what in the world made you try --1 ?!?!

On Mon, Apr 14, 2014 at 9:29 AM, Nick Loat [email protected] wrote:

Yeah really cool. certainly better than the 26 or 29 I had this morning!

http://www.alanthornton.co.uk/art/roadtrip2014.html#.U0vwml7WLbw

—
Reply to this email directly or view it on GitHubhttps://github.com/stevenschobert/instafeed.js/issues/23#issuecomment-40371763
.

I'd like to claim it was a eureka moment of pure inspiration, but alas I was rooting around stack overflow to find the answer to another issue and came across this suggestion of trying "&count=-1" so I thought I'd gave it a whirl for this (nothing to lose) and bingo.

Workaround of silence150 didn't work for me in IE(11)... It couldn't find the index object to remove it. I changed it a bit so it works in all browsers and objects do exist. Obviously you can put in any number.

limit: 4,
after: function () {
    $(".instagram-image").each(function (i) {
        if(i >= 4) {
            $(this).remove();
        }
    });
},

@ndwl Brilliant! Thank you so much!

Also, I did some testing and it appears using the -1 returns all images except the very first one, which makes a lot of sense. Unfortunately throwing -2 in yielded nothing. Not sure if you got the same behavior.

For anyone with the same issue, and for whom the -1 hack didn't work. I have written a short script that provides a hack for this limit, but of course in exchange for more API calls. At the moment, it only works if you fetch images from a user, I can also implement it so you can fetch from tags, but that depends on how much time I have and the demand.

Regarding the above, the API is now much cleaner, and can filter and fetch by tags.

@d4nyll would you be able to show me how to fetch by tags and not limited to user? i tried the setting shown in the documentation but that yielded zero images:

i'm fairly new to all this so could be missing something obvious. any help is appreciated, thanks!

I can only ever get a max of 20 images no matter how big a number I put

edit: nevermind, for my purposes that's all I'll ever get

an hacky alternative is to start caching the returned json data in localStorage and building a longer running list of data over time. De-duping and only keeping X amount of posts in storage. hmmm.... I might try this

You do not need to submit for review for this use case. If you are a developer and you want to display Instagram content on your website, then you do not need to submit your app for review. By using a client in sandbox mode, you can still access the last 20 media of any sandbox user that grants you permission.

screenshot

my understanding is that instagram limits sandbox users to the most recent 20 posts, no more. starting in june you have to be approved as an "app" to get out of sandbox, where you can then specify scope.

Hi there,
Like @FranciscoG I'v tried to submit my "app" and this is what I get :
I want to display my Instagram posts on my website. >>"You do not need to submit for review for this use case [...]By using a client in sandbox mode, you can still access the last 20 media[...]"
I don't understand : instagram don't allow me to submit my app, so how can I get out of sandbox mode ??

you don't have to be out of sandbox mode if all you want to do is display your 20 most-recent posts. leave your "app" in sandbox mode, don't specify scope, and you will be able to display your 20 most-recent.

but what I have to do if I want to display more then 20 posts ? in fact I want to display ALL my posts not only the last 20 !

you can't, as far as i know. instagram requires you submit as an app to display more than 20, and they're not approving your usage type. not unless by displaying your posts you gave created a new user experience which is greater than just your website (aka an app or branding experience).

if it's just to display posts solely on your website, all you get is 20. period.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshmeares picture joshmeares  Â·  9Comments

jpdpueyo picture jpdpueyo  Â·  6Comments

marshall993 picture marshall993  Â·  7Comments

heaversm picture heaversm  Â·  3Comments

josiahwiebe picture josiahwiebe  Â·  5Comments