简体   繁体   中英

Getting Instagram's Current Like and Follow Limit Via API

I own a website that automates Instagram actions, currently I'm getting 100 likes/hour and 100 relationship posts/hour (I know it says 60 for relationships but I've been getting 100). I enforce signed headers, and since I've added my email address I've noticed no 400 errors, just some advice.

So my question is, how can I find my current request limit regarding likes and following/unfollowing? I know in the header they provide how many requests you've made compared to the 5,000 in one hour, but I want to know specifically when I'm going to get the 429 "OAuthRateLimitException" error, so I don't have to hit this limit every hour, I've noticed after getting this error every hour for hundreds of users, it does not look good for my app.

If anyone could tell me how to get how many like requests I've made in the hour, so I can stop before receiving the 429 error, that would be great. I'm using JavaScript, ajax and PHP to make my calls. Thanks.

You are likely not using Oauth tokens for each user. By doing so, the rate limit will scale by the number of people using your app.

As for telling how many you have left, it should be in the HTML header response. From their documentation :

HTTP Header

Information regarding the global rate limits is included in the HTTP header on the response to each of your calls, which enables your app to determine its current status with respect to these rate limits. The following fields are provided in the header of each response and their values are related to the type of call that was made (authenticated or unauthenticated):

X-Ratelimit-Remaining: the remaining number of calls available to your app within the 1-hour window

X-Ratelimit-Limit: the total number of calls allowed within the 1-hour window

from the manual:

HTTP Header

Information regarding the global rate limits is included in the HTTP header on the response to each of your calls, which enables your app to determine its current status with respect to these rate limits. The following fields are provided in the header of each response and their values are related to the type of call that was made (authenticated or unauthenticated):

X-Ratelimit-Remaining : the remaining number of calls available to your app within the 1-hour window

X-Ratelimit-Limi t: the total number of calls allowed within the 1-hour window

https://instagram.com/developer/limits/

Global rate limits are applied inclusive of all API calls made by an app over the 1-hour sliding window, regardless of the particular endpoint . The limits are applied independently from each other; authenticated calls are not counted against the rate limit for unauthenticated calls and vice-versa.

HTTP Header

Information regarding the global rate limits is included in the HTTP header on the response to each of your calls, which enables your app to determine its current status with respect to these rate limits. The following fields are provided in the header of each response and their values are related to the type of call that was made (authenticated or unauthenticated):

As you can see it's not specific to an endpoint it's based on the overall requests made per access token(if authenticated).

So I'm just wondering if it is even possible to check an access tokens current amount of requests specific to a particular endpoint.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM