Confused about rate limits

15 views
Skip to first unread message

impeto

unread,
Apr 11, 2011, 3:48:24 PM4/11/11
to Twitter Development Talk
Hey guys,

maybe this question has been asked before, but I just joined the
group. I just ran into a little problem that threw me off. I'm
developing a website that uses the REST API extensively. The
documentation says that anonymous requests get limited to 150 requests/
hour/IP and authenticated requests get limited to 350 requests/hour/
user. I did the anonymous request to "account/rate_limit_status" and I
got 150; and then I authenticated, verified the credentials and
queried "account/rate_limit_status" again. Got the same result. Why is
that? When you are authenticated, aren't you supposed to get 350 back
from "account/rate_limit_status"?

Thanks in advance.

Alin

Arnaud Meunier

unread,
Apr 11, 2011, 10:11:16 PM4/11/11
to twitter-deve...@googlegroups.com, impeto
Hey Alin,

What do you mean by "I authenticated, verified the credentials and queried"? In this context (API call) authenticating means signing your request using OAuth. Signing-in with your account on twitter.com is a completely different thing and has no effect on your API requests.

Arnaud / @rno




--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk

impeto

unread,
Apr 12, 2011, 11:06:56 AM4/12/11
to Twitter Development Talk
:) Ok, "authenticated" means what it means in the context of the API
calls. I am a developer, I make the difference. Perhaps I wasn't too
clear: first I used cURL to call "http://api.twitter.com/account/
rate_limit_status.json" anonymously, no oauth tokens, nothing, and I
got 150. Then I used a CodeIgniter Twitter library from here
https://github.com/elliothaughin/codeigniter-twitter to authenticate
and make the call to "account/verify_credentials" and to "account/
rate_limit_status". I got my account info ok, which means that the
request was authenticated, but the rate limit was still 150 but with
less remaining request (2 to be exact).

There is no question about whether or not I am authenticated, because
I call other API resources that require authentication and I always
get the data with a 200 http status header, but the maximum hourly
requests stay at 150 and the remaining requests go down after each
call. I'm guessing that it may not stop at 150 on authenticated
requests but I'd hate to have to sit here and click through my app 150
times to find out.

Alin

PS Why would you think I was talking about signing in on twitter.com
when I was talking about verifying credential?

On Apr 11, 10:11 pm, Arnaud Meunier <arn...@twitter.com> wrote:
> Hey Alin,
>
> What do you mean by "*I authenticated, verified the credentials and **
> queried*"? In this context (API call) authenticating means signing your
> request using OAuth. Signing-in with your account on twitter.com is a
> completely different thing and has no effect on your API requests.
>
> Arnaud / @rno <http://twitter.com/rno>

Arnaud Meunier

unread,
Apr 12, 2011, 11:42:15 AM4/12/11
to twitter-deve...@googlegroups.com, impeto
Hey Alin,

The sentence you used confused me, sorry. Now I guess you were talking about the "account/verify_credentials" endpoint :)

Question for you: what is your X-RateLimit-Limit header value (for both account/verify_credentials and other endpoints you're using that require authentication)?

Arnaud / @rno

hax0rsteve

unread,
Apr 12, 2011, 11:45:32 AM4/12/11
to twitter-deve...@googlegroups.com

You appear to be using the wrong URLs. Specify a version number and this will go away.

Rather than "http://api.twitter.com/account/rate_limit_status.json"

use

"http://api.twitter.com/account/1/rate_limit_status.json"

Digga

unread,
Apr 12, 2011, 12:15:06 PM4/12/11
to Twitter Development Talk
This is something I am experiencing as well. There is clearly 150 that
is awarded to the accounts per hour. I signed out and signed in, ad
every time there is 150 requests, not 350.

Is there suppose to be 350 or 150 coming from this call?

http://twitter.com/account/rate_limit_status.json

because I get 150 for my accounts. It will reset on another account,
but still only to 150 not 350.




On Apr 11, 10:11 pm, Arnaud Meunier <arn...@twitter.com> wrote:
> Hey Alin,
>
> What do you mean by "*I authenticated, verified the credentials and **
> queried*"? In this context (API call) authenticating means signing your
> request using OAuth. Signing-in with your account on twitter.com is a
> completely different thing and has no effect on your API requests.
>

impeto

unread,
Apr 12, 2011, 12:17:10 PM4/12/11
to Twitter Development Talk
You actually have to put the "1" before "account": http://api.twitter.com/1/{end
point}.json I just now realized that the CodeIgniter library that I
use does not add the version number. I guess I'll have to send the
developer a note on that.

Hey! It works fine now. Thank you. I would have never thought to look
at what URL the library was sending requests to.

Thanks to all who replied.

Alin

On Apr 12, 11:45 am, hax0rsteve <hax0rc...@btinternet.com> wrote:
> You appear to be using the wrong URLs. Specify a version number and this will go away.
>
> Rather than "http://api.twitter.com/account/rate_limit_status.json"
>
> use
>
> "http://api.twitter.com/account/1/rate_limit_status.json"
>
> On 12 Apr 2011, at 16:06, impeto wrote:
>
>
>
>
>
>
>
> > :) Ok, "authenticated" means what it means in the context of the API
> > calls. I am a developer, I make the difference. Perhaps I wasn't too
> > clear: first I used cURL to call "http://api.twitter.com/account/
> > rate_limit_status.json" anonymously, no oauth tokens, nothing, and I
> > got 150. Then I used a CodeIgniter Twitter library from here
> >https://github.com/elliothaughin/codeigniter-twitterto authenticate

hax0rsteve

unread,
Apr 12, 2011, 12:27:18 PM4/12/11
to twitter-deve...@googlegroups.com

impeto

unread,
Apr 12, 2011, 12:24:11 PM4/12/11
to Twitter Development Talk
use http://api.twitter.com/1/{resource endpoint}.{format} you have to
use the version number to get the right results. It works on my app
correctly now.

If you happen to use the CodeIgniter Twitter library from here
https://github.com/elliothaughin/codeigniter-twitter you have to go in
tweet.php @line 285 and make $_apiUrl = 'http://api.twitter.com/1'
instead of 'http://api.twitter.com' and it will work correctly.

Regards

Alin

hax0rsteve

unread,
Apr 12, 2011, 12:46:26 PM4/12/11
to twitter-deve...@googlegroups.com

Sorry, my bad, that should indeed be http://api.twitter.com/1/...

impeto

unread,
Apr 12, 2011, 12:48:27 PM4/12/11
to Twitter Development Talk
well, i did the first time and it didn't work (in the sense that I got
a 404 or 401 error -- don't remember which). then i tried it my way
and it worked fine. the api doc says that's the right way too:
http://dev.twitter.com/doc/get/account/rate_limit_status

Alin

On Apr 12, 12:27 pm, hax0rsteve <hax0rc...@btinternet.com> wrote:
> Usehttp://api.twitter.com/account/1/rate_limit_status.json
Reply all
Reply to author
Forward
0 new messages