Support » Plugin: Smash Balloon Social Photo Feed - Best Social Feed Plugin for WordPress » How to avoid exceeding API rate limits

  • First I’d like to say that I enjoy your plugin very much, I think it’s the most flexible and effective solution out there for Instagram feeds.

    I am writing to inquire about how I can best go about avoiding exceeding API rate limits set by Instagram. First, can you please confirm how many requests a site can handle with 1 access token? My understanding based on the latest Instagram policy is that “all API calls made by an app per access token over the 1-hour sliding window” is 5,000 for a Live app, but I don’t know how this translates into how many people can view a feed through “Instagram Feed” on a page in WordPress. I read through the article below, however, my understanding is that this approach still wouldn’t work if you were to hypothetically have a million requests in 1 hour, is that right?

    https://wordpress.org/support/topic/error-429-instagram-api-rate-limiting

    Is it at all possible to address the rate limits by having individual Instagram users authenticate as opposed to having the PHP cycle through multiple access tokens? I haven’t hit any rate limits yet but my site is in private mode right now and I’m just trying to avoid any potential future issues.

    Thanks in advance!

    https://wordpress.org/plugins/instagram-feed/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey Eugene,

    I’m glad you like the plugin!

    For each feed, one request to the Instagram API is made every time the page loads and every time more images are loaded with the “load more” button. So it is possible for a highly trafficked site to reach the hourly limit.

    The good news is that this will be fixed in a future update for the free version of the plugin. The data from the Instagram API will be saved in the database for a set period of time. This will limit how many requests need to be made since the same request can be used by any number of visitors.

    This is something we already have working in the “Pro” version so it will be available soon for both.

    Let me know if you have any questions!

    Hi Craig,

    To jump in here, can you confirm how many requests there are with the caching enabled in the pro version?

    I want to add this to my site but I feel I will go over the API limits. Would be good to get a better idea of the limits with your caching feature active.

    Cheers
    Jourdain

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Sure I can explain that! It would depend on a few things. Hopefully this explanation will give you an idea.

    So with the caching feature enabled, the first time a person visits your site, the request that was made to Instagram to generate the feed is saved in the database for your site. Every visitor after that will not cause the feed to make another request to Instagram, instead the feed is generated from the cache in the database.

    This is per feed and per user that clicks the “load more” button if you have that available. So if you have just one feed and set the cache to be “one hour” (you can select just about any time amount you might want), you would likely only make one request to Instagram per hour.

    Even if you have a lot of different feeds, it would be very unlikely that the limit is ever reached with the caching enabled. The only downside is that if you make a post during the time that the feed is cached, it will not be available until the time period is up (and a new request to Instagram is made).

    Does that answer your question?

    That’s perfect! Thanks for getting back so quickly!

    Sounds like a good solution to the API problem.

    Thanks again,
    Jourdain

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    No problem! Let me know if you need anything else.

    Craig,

    Nice plugin and thanks for all the hard and clever work.

    The caching feature will be a PERFECT addition. That’s terrific.
    When I was performing tests on my latest site with monitoring load times (eg gtmetrix) I noticed that your plugin could and should use caching to improve page load times…especially since I have the widget installed in the footer of every page. I am very pleased to hear that you are adding this ‘must have’ feature.

    Once this feature is implemented and I test it to work well, I plan on writing you a 6/5 review! lol

    BTW…for a site like mine where the widget is at the bottom of the page, I was thinking a cool feature would be to ‘Lazy Load’ it…if that was possible? That would reduce bandwidth and load times etc? Perhaps the caching will negate the need for this anyway.

    Cheers
    Anthony

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey Anthony,

    I wish I could take credit for this plugin but the theme author is actually John. He definitely is a clever, hardworking guy though! A great guy to work with incidentally as well.

    We always appreciate the reviews as well! That really helps us out.

    For your idea bout that lazy loading feature, this would definitely make sense especially for circumstances like yours when the feed wouldn’t come into view until long after the initial page load. I will add it to our list of feature requests.

    The plugin does load the feed with ajax currently which does allow the page to load first before the code that generates the feed is run. That should help with page load speed but not so much with bandwidth usage.

    I’m glad you like the plugin! Let me know if you ever have any more questions about anything.

    Hi Craig,

    I had a couple of further questions.

    1. I’m assuming the images after the “Load More” button is pressed are also cached. So each time a “Load More” button is pressed, this does not count as a call?

    2. Is there a way to track the amount of calls from the site?

    Cheers
    Jourdain

    Plugin Author Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey Jourdain,

    For number 1, it depends on your feed settings but either loading more posts will use posts that have already been cached or an additional request will be made which will be cached for future use.

    For number 2, there isn’t a way to track how many requests have been made. You might be able to create a way to do it by modifying the source files but beyond that, nothing that I know of. I can say that no one has contacted us about their request limit being reached if that’s helpful at all.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to avoid exceeding API rate limits’ is closed to new replies.