Reputation: 733
I got an client app in sandbox for Instagram, was thinking of using it for showing a widget on client websites with their users recent media.
At the moment I am using GET requests towards this endpoint:
- api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN
This is done on the server side, and it works good with my sandbox user. I save the data response from the API to avoid reaching the rate limit of 500 each hour. The saved response is then formatted to a html list, with links to the media. The request is only done once each day at the moment.
Is the rate limit only incremented on API calls as I thought? Do I avoid hitting the rate limit with this solution? If not: when is the rate limit incremented exactly?
Thanks in advance!
Upvotes: 0
Views: 325
Reputation: 36
Yes, the rate limit will be decremented by 1 for your GET request. One way to keep track of the rate limit is to check the response headers from Instagram for x-ratelimit-remaining
[1]. This will be set to an integer value (eg, 4990) and applies to the access_token used for the request. This method works only for GET requests; POST requests do not return accurate x-ratelimit-remaining
values.
[1] As described in the deprecated developer documentation but inexplicably omitted from the current documentation.
Upvotes: 2