Wes Gamble
Wes Gamble

Reputation: 787

Is the Instagram rate limit for the client id only for non-authenticated API requests?

Instagram provides rate limits on both the client id and individual access tokens. Both limits are 5000/hour.

I need to know if the client id limit is with or without respect to authenticated requests.

All of the requests that will come from my client id will be authenticated (using access tokens). So, if I have 10 tokens, and I make 1000 requests with each access token in the same hour, resulting in 10000 total requests, then which of the following will occur:

1) All my requests will go through because each 1000 requests is counted against the access token limit

2) My 5,0001st request will fail because I'll have made more than 5000 using the same client id?

Upvotes: 2

Views: 2117

Answers (1)

therewillbesnacks
therewillbesnacks

Reputation: 1015

You get 5000 requests per access token. This means that as long as you are authenticating users and using their access token, you should have 4000 left per users in your example. Be aware there are many other things/ways you can get throttled.

Here are some tips:

  1. Do not issue too many calls in parallel. This could appear to be something like abuse/DOS attack to Instagram and they may ban you temporarily/permanently. As such, use a rate limiting mechanism such as a queue if your volume may be high. This can have the added benefit of durability if the request fails due to network issues or api limits.

  2. I have observed and heard that the limits for certain calls such as likes/follows for instance are a bit lower, more like 300. If you're only fetching media and browsing feeds, this shouldn't be an issue.

  3. Access tokens may expire at any time. Be aware if your requests are long-running that this is an error condition you may need to handle.

  4. You can save API calls if you try to batch out your calls to smaller, bulk calls. For example there may be a difference between iterating all the user's items to find 1 media item with a tag vs. browsing the tag itself if the dataset is small and you know the item will be in the recent media. Pick the smallest likely result set and start from there if you are doing any of your own browsing/filtering.

From the Instagram API Docs:

Limits Be nice. If you're sending too many requests too quickly, we'll send back a 503 error code (server unavailable).

You are limited to 5000 requests per hour per access_token or client_id overall. Practically, this means you should (when possible) authenticate users so that limits are well outside the reach of a given user.

Upvotes: 2

Related Questions