X-RateLimit-Reset HTTP header missing from 400 Bad Request response when you get rate-limited

64 views
Skip to first unread message

Mehdi

unread,
Apr 11, 2012, 9:54:24 AM4/11/12
to Meetup API
Hi,

I was testing the rate-limiting behaviour last night to make sure that
I mark rate-limited tokens as such to avoid making unnecessary API
calls that are sure to fail (and while testing, I saw that we're now
allowed 800 calls / hour, which should be far more than enough anyway
- but that's beside the point).

The doc indicates that the X-RateLimit-Reset HTTP header contains the
time when the rate limit gets reset. And it's indeed there on every
response... except on the 400 Bad Request response you get when you
get rate limited, which is precisely where you'd actually want to know
when you can start making requests again.

The doc suggests that I can check the status of an account by calling
the /members/?relation=self method but that doesn't work either when
you're rate-limited (I just get a 400 response).

So at this point I can mark a token as being rate-limited but there
doesn't seem to be any way to know when the restriction will get
lifted. Is there any workaround I missed?

Cheers,
Mehdi

Doug Tangren

unread,
Apr 11, 2012, 11:36:28 AM4/11/12
to meetu...@googlegroups.com

Good catch Mehdi. The request ratelimits are based on hourly windows. I will open a ticket to make sure the X-RateLimit headers are getting set when you fall over the threshold.
 

Cheers,
Mehdi

--
You received this message because you are subscribed to the Google
Groups "Meetup API" group.
To unsubscribe from this group, send email to
meetup-api+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/meetup-api?hl=en?hl=en

Doug Tangren

unread,
May 31, 2012, 3:26:07 PM5/31/12
to meetu...@googlegroups.com
On Wed, Apr 11, 2012 at 11:36 AM, Doug Tangren <do...@meetup.com> wrote:


On Wed, Apr 11, 2012 at 9:54 AM, Mehdi <me...@shhmooze.com> wrote:
Hi,

I was testing the rate-limiting behaviour last night to make sure that
I mark rate-limited tokens as such to avoid making unnecessary API
calls that are sure to fail (and while testing, I saw that we're now
allowed 800 calls / hour, which should be far more than enough anyway
- but that's beside the point).

The doc indicates that the X-RateLimit-Reset HTTP header contains the
time when the rate limit gets reset. And it's indeed there on every
response... except on the 400 Bad Request response you get when you
get rate limited, which is precisely where you'd actually want to know
when you can start making requests again.

The doc suggests that I can check the status of an account by calling
the /members/?relation=self method but that doesn't work either when
you're rate-limited (I just get a 400 response).

So at this point I can mark a token as being rate-limited but there
doesn't seem to be any way to know when the restriction will get
lifted. Is there any workaround I missed?

Good catch Mehdi. The request ratelimits are based on hourly windows. I will open a ticket to make sure the X-RateLimit headers are getting set when you fall over the threshold.

This should now be fixed. Http error responses triggered by a client going over their rate limit should now include these headers. 
Reply all
Reply to author
Forward
0 new messages