Search code examples
instagram-api

How can you check your current Instagram remaining API call (rate) limit?


In the old API, the remaining allowed capacity was apparently returned as the X-Ratelimit-Remaining HTTP header.

However, the current version's documentation mentions nothing about this, and the response I get from valid calls to the /v1/tags/{tag}/media/recent endpoint does not contain this header or anything like it. Using the old API isn't an option since it's not available to new apps.

I'd really like to at least attempt to throttle my own usage instead of waiting for a rate limit exception and guessing how long I have until my rolling hour allows at least one call again. Per the second link, the only notification provided regarding rate limiting for is when you've already been limited, either for suspected spam or actual rate limit overrun, is request failure with one of two status codes.

Am I just missing something? Is there no longer a way to programmatically check your remaining allowed API query usage using the current API?


Solution

  • The answer, as of 2016/05/18, appears to be that you can't. It's not the only way Instagram now is a few steps back for developers, because the algorithmic feed has been non-optionally extended to, at least, the tags/media/recent endpoint... so not only can you not track how many API calls Instagram thinks you have left, you can't get results in chronological order, potentially for any call.

    I spent a week with this API and all I got was a crummy 'tumbleweed' achievement.