Imgur API - Getting "Too many Request" error even though 'X-Ratelimit-Userremaining' is not 0
Asked Answered
B

2

7

I am uploading images through the Imgur API (https://apidocs.imgur.com/) but I am getting a 'Too many Request' (err 429) even thought the previous request returned 'X-Ratelimit-Userremaining=1216'. My understanding is that I should be able to do 1216 POST before hitting the rate limit.

Edit:

First request header (success)

X-Ratelimit-Userlimit ,Value : [2000]
X-Post-Rate-Limit-Reset ,Value : [1099]
X-Ratelimit-Clientreset ,Value : [11017]
X-Ratelimit-Userreset ,Value : [3600]
X-Ratelimit-Userremaining ,Value : [1216]
X-Post-Rate-Limit-Remaining ,Value : [1244]
X-Ratelimit-Clientlimit ,Value : [12500]
X-Post-Rate-Limit-Limit ,Value : [1250]
X-Ratelimit-Clientremaining ,Value : [12248]
Content-Type ,Value : [application/json]

Second request headers (fail, rate limit hit):

X-Ratelimit-Userlimit ,Value : [2000]
X-Ratelimit-Clientreset ,Value : [10204]
X-Ratelimit-Userreset ,Value : [3600]
X-Ratelimit-Userremaining ,Value : [0]
X-Ratelimit-Clientlimit ,Value : [12500]
X-Ratelimit-Clientremaining ,Value : [12035]
Content-Type ,Value : [application/vnd.imgur.v1+json]
Burier answered 29/3, 2019 at 12:22 Comment(0)
E
1

I have a same problem and it's because I'm using the default setting of imgur APIs on Postman. You need to change the Authorization Type to yours. In my case, I change to "Inherit auth from parent.." where I set the Authorization for the parent folder.

Execrable answered 5/3, 2023 at 20:55 Comment(0)
S
-3

Please take a look at https://apidocs.imgur.com/#rate-limits where you'll find detailed information about specific API rate limits.

Imgur has multiple rate limits including per application and user IP limits. Even if you have more user request credits, the application can have no more credits available, and that might trigger the rate limit for your requests.

Each response from the Imgur servers contains rate limit headers that will give you more details about the limits you're hitting.

Rate limit headers included in responses (from Imgur API docs):

  • X-RateLimit-UserLimit - Total credits that can be allocated.
  • X-RateLimit-UserRemaining - Total credits available.
  • X-RateLimit-UserReset - Timestamp (unix epoch) for when the credits will be reset.
  • X-RateLimit-ClientLimit - Total credits that can be allocated for the application in a day.
  • X-RateLimit-ClientRemaining - Total credits remaining for the application in a day.
Seduction answered 29/3, 2019 at 14:25 Comment(1)
I did check this documentation but could not find any explanation to what I am seeing. The X-Ratelimit-Userremaining drops form 1216 to 0 from one request to another.Burier

© 2022 - 2024 — McMap. All rights reserved.