What HTTP response code is given back when user request limit is reached?

279 views
Skip to first unread message

Matthew Harris

unread,
Jan 26, 2013, 3:39:53 PM1/26/13
to im...@googlegroups.com
Hey imgur team, 

Was doing some work and I accidentally reached the user limit while developing, I started writing error handling around this so the user will know when this happens, but while doing so my limit was reset. I have no way of reproducing unless I manually try to reach the limit again (which doesn't seem like a good idea). 

The documentation had pretty much all the info I need, minus the HTTP status code. So can you let me know what HTTP response code will be returned when user limits are reached? I don't want to check response headers on every response if there is in fact an appropriate http error code being used.

Thanks,
Matt 
Message has been deleted

Alan Schaaf

unread,
Jan 28, 2013, 5:19:54 PM1/28/13
to im...@googlegroups.com
Hey Matt,

After reading your question we found that the API returned 403 Forbidden, which also happens to be the same status that's returned when you have an unauthorized user. It's been changed to 429 now and has also been added to the _fake_status list. "The 429 status code indicates that the user has sent too many requests in a given amount of time ("rate limiting")."

Matthew Harris

unread,
Jan 28, 2013, 8:07:13 PM1/28/13
to im...@googlegroups.com
OK thanks, 429 is perfect. On a side note, shouldn't a unauthorized user request return a 401? 

er...@appdivision.com

unread,
Jan 29, 2013, 8:06:09 AM1/29/13
to im...@googlegroups.com
Are these changes being pushed to the live code base immediately?
Because for example - if you're developing an application that is pushed to an app store (such as Apple store) that has an approval process. And as I am in my app, are checking for status code 403 to check for rate limiting - if these kind of changes are immediately being pushed into the main branch of code it would give applications no chance to push a change without all of a sudden not working.

Also, is there any way we can have a place on the api page that these kind of changes can be posted, as lon g as the dates they were posted so we can effectively update our apps. If I hadn't been looking closely at these boards (and really if I hadn't replied earlier to this thread, I would have never known of this change.

Also, you said 429 is being sent when the user is rate limited, is it also for client rate limiting as well?

Alan Schaaf

unread,
Jan 29, 2013, 2:17:48 PM1/29/13
to im...@googlegroups.com
We have a changelog available here: http://api.imgur.com/changelog

From the changelog:

From December 13th (the date of the initial release) until February 13th, version 3 will be in active beta. This means that there will likely be bug fixes and changes to the data models that may break applications. After this period, the API will be frozen and changes to the data models, or any change that may break a user application, will be introduced in later versions which will be accessible from a different endpoint URL. This is to ensure that v3 has been thoroughly tested and that all issues have worked out before the API responses are set in stone.

er...@appdivision.com

unread,
Jan 29, 2013, 2:20:32 PM1/29/13
to im...@googlegroups.com
Oh that's great - I hadn't ever seen mention of the changelog while going through the API - but it's really useful - thanks

Matthew Harris

unread,
Feb 3, 2013, 7:17:06 PM2/3/13
to im...@googlegroups.com
Changelog is useful, but not all changes are logged. For example, recently the data model for the refresh token response changed to follow the "standard" imgur api response (a good change IMO, but a change that would break some functionality as it did with my app). 

Alan Schaaf

unread,
Feb 4, 2013, 3:52:45 PM2/4/13
to im...@googlegroups.com
Hi Matthew,

I'm really sorry about that. That change was not supposed to happen and was introduced while fixing something else. I'm afraid your app will break again because it's just been changed back to the normal OAuth 2 response.

er...@appdivision.com

unread,
Feb 5, 2013, 2:57:52 AM2/5/13
to im...@googlegroups.com
>_<

viktor...@gmail.com

unread,
Feb 8, 2013, 3:09:39 PM2/8/13
to im...@googlegroups.com
Sorry, this is a little offtopic but are those credits working? I've just uploaded ~1200 images and I get this.

"data":{"UserLimit":500,"UserRemaining":500,"UserReset":1360357649,"ClientLimit":125000,"ClientRemaining":123878},"success":true,"status":200}

Shouldn't 1 upload cost around 10 credits? Or it's good at your side only the response is bad and I shouldn't try to upload more ?

viktor...@gmail.com

unread,
Feb 15, 2013, 6:36:41 AM2/15/13
to im...@googlegroups.com
When I want to upload an image, I get this error message:
"User request limit exceeded"


But If I check my rate limits I get this:
{"data":{"UserLimit":500,"UserRemaining":498,"UserReset":1360930659,"ClientLimit":125000,"ClientRemaining":122405},"success":true,"status":200}

According to your FAQ a user can upload infinite images.

Reply all
Reply to author
Forward
0 new messages