Request for API call /help/rate_limit

9 views
Skip to first unread message

Kee Hinckley

unread,
May 26, 2008, 1:40:29 AM5/26/08
to twitter-deve...@googlegroups.com
I have my code set to attempt to throttle requests to keep them within
the rate limit--however when the rate limit keeps changing....

If you provided a (non-rate-limited!) call to see what the current
limit is, that would allow me to dynamically adapt the requests so as
not to exceed it. Seems like that would be a win for everyone.

Andrew Badera

unread,
May 26, 2008, 5:47:52 AM5/26/08
to twitter-deve...@googlegroups.com
Do you read the rest of this list, or just blindly, blithely post to it?

Kee Hinckley

unread,
May 26, 2008, 6:57:46 AM5/26/08
to twitter-deve...@googlegroups.com
On May 26, 2008, at 5:47 AM, Andrew Badera wrote:
> Do you read the rest of this list, or just blindly, blithely post to
> it?

I've even been known to reply to a few items.

Was this a general comment on the effects of my late-night coding
endeavors, or did I miss a discussion on about making the rate limit
available via the API? I just rechecked my list archives and I don't
see anything specific on that, but it's hard to sort it out from all
the "how come my program stops working after a while" messages.

Andrew Badera

unread,
May 26, 2008, 7:05:40 AM5/26/08
to twitter-deve...@googlegroups.com
In this case see:

Bad request for friends_timeline.json?

Kee Hinckley

unread,
May 26, 2008, 8:58:47 AM5/26/08
to twitter-deve...@googlegroups.com

On May 26, 2008, at 7:05 AM, Andrew Badera wrote:

In this case see:

Bad request for friends_timeline.json?

That's a request for a) a different status and b) an indication of when to retry.

I'm trying to avoid even getting to that point by finding out ahead of time what the limit is.  It doesn't do my user any good to find out that they can't fetch any more tweets for another 30 minutes.  Better if I was smarter and spread them out in the first place.

Andrew Badera

unread,
May 26, 2008, 9:07:56 AM5/26/08
to twitter-deve...@googlegroups.com
Why create an explicit method when that same data could be available implicitly?

Marco Kaiser

unread,
May 26, 2008, 9:31:11 AM5/26/08
to twitter-deve...@googlegroups.com
Hmm, I agree with Ken that the time until the lock is released is another thing than the number of allowed requests per hour. Even when you know when you will be allowed to talk to the API again, this does not help to adapt your polling interval to a (possibly reduced) limit.

So having that information (the currently effective limit) available to API clients does make sense, I guess.

Kee Hinckley

unread,
May 26, 2008, 9:41:23 AM5/26/08
to twitter-deve...@googlegroups.com

On May 26, 2008, at 9:07 AM, Andrew Badera wrote:

> Why create an explicit method when that same data could be available
> implicitly?

Let's not cross the line from curmudgeon (an ancient and honorable
profession) to obtuse.

1. My users would rather have me reduce update frequency throughout an
hour than not update at all for much of it.
2. Twitter's servers would prefer that I spread by 30 queries out over
an hour, not all in the first half hour.

Or for a more RL example. Would you rather find out the speed limit is
30 by reading the sign, or getting stopped by the policeman?

Andrew Badera

unread,
May 26, 2008, 9:45:06 AM5/26/08
to twitter-deve...@googlegroups.com
Either way you're making a method call. Your metaphor fails. Your call should be engineered to handle the response appropriately.

That said, I can see some minimal amount of distinction between the two approaches. But is there enough value to implement an explicit call when you get almost the same result implicitly?

Cameron Kaiser

unread,
May 26, 2008, 10:23:00 AM5/26/08
to twitter-deve...@googlegroups.com
> Either way you're making a method call. Your metaphor fails. Your call
> should be engineered to handle the response appropriately.
>
> That said, I can see some minimal amount of distinction between the two
> approaches. But is there enough value to implement an explicit call when you
> get almost the same result implicitly?

Actually, I'm going with Kee here. It's better from a UX perspective if you
can warn the user in advance that the service is degraded, and/or
automatically reduce your call frequency. I'd rather do that than burn up
my thirty in thirty minutes, and be completely dead for a half hour after.
Already people are complaining with things like, "sorry I couldn't reply,
twhirl put me in timeout." Clearly it's not twhirl's fault, but the user
thinks it is.

So I'd rather know and make adjustments right from the get-go, rather than
surprise the user that they're Twitter-less for half the time because they
didn't know they wouldn't get their full 70.

--
------------------------------------ personal: http://www.cameronkaiser.com/ --
Cameron Kaiser * Floodgap Systems * www.floodgap.com * cka...@floodgap.com
-- Courage is being scared to death, and saddling up anyway. -- John Wayne ----

Andrew Badera

unread,
May 26, 2008, 10:24:56 AM5/26/08
to twitter-deve...@googlegroups.com
OK, I'll give you the UX angle. I'm a middle tier/SOA guy, I suppose I tend to underweight UX aspects.

Aaron Brazell

unread,
May 26, 2008, 12:40:34 PM5/26/08
to twitter-deve...@googlegroups.com
Andrew- 

Yeah... really negatively at that. Is it really necessary to demonstrate your superiority?

The request for the method should not return a true/false (boolean) which is what the friends_timeline would essentially do. Is the friends_timeline available or not? An app that has the intelligence/logic built in to adjust API call frequency based on the limit available would need an action number (int). Obviously, I agree with Kee.
--
--
Aaron Brazell
web:: www.technosailor.com
phone:: 410-608-6620
skype:: technosailor
twitter:: @technosailor

deali...@gmail.com

unread,
May 26, 2008, 2:18:26 PM5/26/08
to Twitter Development Talk
This wouldn't be as much of an issue if the rate limit wasn't reduced
anywhere from 50-95% w/o warning. I'm using a client that is checking
every 5 minutes, after about 15 minutes and sending two tweets I was
locked out (that should have only been 3 calls--or 5 if sending counts
against the limit {I'm going by memory here}) (also I know my
credentials are not being used by any bots).

The API already attaches a lot of (what I would consider) superfluous
data to a number of calls, what if they just attached your current
limit to every call (that returned something)?

Andrew Badera

unread,
May 26, 2008, 2:23:22 PM5/26/08
to twitter-deve...@googlegroups.com
Aaron-

As much as we all know how important you are (in your own mind) where is it your place to be my daddy? I'll admit my response wasn't the sweetest and kindest, but last I checked, you don't work for Twitter, and you're not a moderator here.

There's quite a bit of noise on this list, and it would be nice if more people made more of an effort before spamming our collective inboxes.

--Just some geek and not a D-list celeb, Andy Badera
--
--
--Andy Badera
http://higherefficiency.net
http://flipbitsnotburgers.blogspot.com/
http://andrew.badera.us/
http://changeroundup.com/
and...@badera.us
(518) 641-1280
Google me: http://www.google.com/search?q=andrew+badera

Aaron Brazell

unread,
May 26, 2008, 3:28:03 PM5/26/08
to twitter-deve...@googlegroups.com
It has nothing to do with celebrity and how important I may or may not
think I am. Its got to do with typical mailing list respect. It was a
legitimate request and I felt your response was uncalled for. Feel
free to ignore me, since I'm not your daddy.

Andrew Badera

unread,
May 26, 2008, 4:08:07 PM5/26/08
to twitter-deve...@googlegroups.com
Typical mailing list respect also calls for people to respect others' inboxes, and to make a reasonable effort keep up with the list before posting new material. The OP is one of several persons who seem to send a lot of oft-redundant inquiries.

But thank you for enlightening me to my obviously barbaric ways, oh great NMD.

Alex Payne

unread,
May 26, 2008, 4:12:23 PM5/26/08
to twitter-deve...@googlegroups.com
Try this with auth:

http://twitter.com/account/rate_limit_status

Also: be nice, please.

--
Alex Payne
http://twitter.com/al3x

Cameron Kaiser

unread,
May 26, 2008, 4:15:47 PM5/26/08
to twitter-deve...@googlegroups.com

What would be a suggested frequency to call it, every hour? Also, does this
count against the limit? (I assume not but I always check. :-)

--
------------------------------------ personal: http://www.cameronkaiser.com/ --
Cameron Kaiser * Floodgap Systems * www.floodgap.com * cka...@floodgap.com

-- You can't have everything. Where would you put it? -- Steven Wright --------

Alex Payne

unread,
May 26, 2008, 4:17:14 PM5/26/08
to twitter-deve...@googlegroups.com
It shouldn't count against your limit unless I messed up the
implementation. Call it whenever.

--
Alex Payne
http://twitter.com/al3x

Andrew Badera

unread,
May 26, 2008, 4:58:48 PM5/26/08
to twitter-deve...@googlegroups.com
I half-apologized to Aaron off-list already, but let me do so here, and to Kee too. My responses weren't appropriate, my apologies.

--Andy Badera

Kee Hinckley

unread,
May 26, 2008, 5:46:21 PM5/26/08
to twitter-deve...@googlegroups.com
On May 26, 2008, at 4:12 PM, Alex Payne wrote:
> Try this with auth:
>
> http://twitter.com/account/rate_limit_status

Sweet.

% perl -I./lib -MData::Dumper -MNet::Twitter -e 'print Dumper(new
Net::Twitter()->rate_limit());'
Net::Twitter::rate_limit: Authorization required for this call. at lib/
Net/Twitter.pm line 520.

% perl -I./lib -MData::Dumper -MNet::Twitter -e 'print Dumper(new
Net::Twitter(user=>"xxx",pass=>"xxx")->rate_limit());'
$VAR1 = {
'remaining_hits' => 30
};


Kee Hinckley

unread,
May 26, 2008, 5:46:55 PM5/26/08
to twitter-deve...@googlegroups.com
On May 26, 2008, at 4:58 PM, Andrew Badera wrote:
> I half-apologized to Aaron off-list already, but let me do so here,
> and to Kee too. My responses weren't appropriate, my apologies.

Does this mean I don't get my cookie? :-)

Cameron Kaiser

unread,
May 26, 2008, 5:48:10 PM5/26/08
to twitter-deve...@googlegroups.com
> > I half-apologized to Aaron off-list already, but let me do so here,
> > and to Kee too. My responses weren't appropriate, my apologies.
>
> Does this mean I don't get my cookie? :-)

"Mmm, coconut!"

(Sorry, watching Sledge Hammer reruns on DVD ...)

--
------------------------------------ personal: http://www.cameronkaiser.com/ --
Cameron Kaiser * Floodgap Systems * www.floodgap.com * cka...@floodgap.com

-- What's another word for thesaurus? -----------------------------------------

Andrew Badera

unread,
May 26, 2008, 5:58:26 PM5/26/08
to twitter-deve...@googlegroups.com
Dunno, mail hasn't gone out yet obviously, and I'm getting kind of hungry.

Ed Finkler

unread,
May 26, 2008, 6:47:52 PM5/26/08
to twitter-deve...@googlegroups.com
I'm getting a 404 on this via cURL.

> curl -I -ku spaztest:###### https://twitter.com/account/rate_limit_status
HTTP/1.1 404 Not Found
Date: Mon, 26 May 2008 22:46:12 GMT
Server: hi
Status: 404 Not Found

(same with http)

--
Ed Finkler
http://funkatron.com
AIM: funka7ron
ICQ: 3922133
Skype: funka7ron

Kee Hinckley

unread,
May 26, 2008, 8:07:13 PM5/26/08
to twitter-deve...@googlegroups.com
On May 26, 2008, at 6:47 PM, Ed Finkler wrote:
> I'm getting a 404 on this via cURL.

Need to append your correct protocol ending. E.g. .json

ShoeMoney

unread,
May 26, 2008, 8:33:00 PM5/26/08
to Twitter Development Talk
technosailor > *

Ed Finkler

unread,
May 26, 2008, 9:02:42 PM5/26/08
to twitter-deve...@googlegroups.com

Ah, handy!

dean.j.robinson

unread,
May 27, 2008, 4:54:36 AM5/27/08
to Twitter Development Talk
Ed,

Try adding .json or .xml onto the end of it, that should do the trick
(did for me)

On May 27, 8:47 am, "Ed Finkler" <funkat...@gmail.com> wrote:
> I'm getting a 404 on this via cURL.
>
> > curl -I -ku spaztest:######https://twitter.com/account/rate_limit_status
>
> HTTP/1.1 404 Not Found
> Date: Mon, 26 May 2008 22:46:12 GMT
> Server: hi
> Status: 404 Not Found
>
> (same with http)
>
> --
> Ed Finklerhttp://funkatron.com
> AIM: funka7ron
> ICQ: 3922133
> Skype: funka7ron
>
> On Mon, May 26, 2008 at 4:12 PM, Alex Payne <a...@twitter.com> wrote:
>
> > Try this with auth:
>
> > http://twitter.com/account/rate_limit_status
>
> > Also: be nice, please.
>
> > On Mon, May 26, 2008 at 1:08 PM, Andrew Badera <and...@badera.us> wrote:
> >> Typical mailing list respect also calls for people to respect others'
> >> inboxes, and to make a reasonable effort keep up with the list before
> >> posting new material. The OP is one of several persons who seem to send a
> >> lot of oft-redundant inquiries.
>
> >> But thank you for enlightening me to my obviously barbaric ways, oh great
> >> NMD.
>
> >> On Mon, May 26, 2008 at 3:28 PM, Aaron Brazell <emmenset...@gmail.com>
> >> wrote:
>
> >>> It has nothing to do with celebrity and how important I may or may not
> >>> think I am. Its got to do with typical mailing list respect. It was a
> >>> legitimate request and I felt your response was uncalled for. Feel
> >>> free to ignore me, since I'm not your daddy.
>
> >>> On 5/26/08, Andrew Badera <and...@badera.us> wrote:
> >>> > Aaron-
>
> >>> > As much as we all know how important you are (in your own mind) where is
> >>> > it
> >>> > your place to be my daddy? I'll admit my response wasn't the sweetest
> >>> > and
> >>> > kindest, but last I checked, you don't work for Twitter, and you're not
> >>> > a
> >>> > moderator here.
>
> >>> > There's quite a bit of noise on this list, and it would be nice if more
> >>> > people made more of an effort before spamming our collective inboxes.
>
> >>> > --Just some geek and not a D-list celeb, Andy Badera
>
> >>> > On Mon, May 26, 2008 at 12:40 PM, Aaron Brazell <emmenset...@gmail.com>
> >>> > wrote:
>
> >>> >> Andrew-
> >>> >> Yeah... really negatively at that. Is it really necessary to
> >>> >> demonstrate
> >>> >> your superiority?
>
> >>> >> The request for the method should not return a true/false (boolean)
> >>> >> which
> >>> >> is what the friends_timeline would essentially do. Is the
> >>> >> friends_timeline
> >>> >> available or not? An app that has the intelligence/logic built in to
> >>> >> adjust
> >>> >> API call frequency based on the limit available would need an action
> >>> >> number
> >>> >> (int). Obviously, I agree with Kee.
>
> >>> >> On Mon, May 26, 2008 at 10:24 AM, Andrew Badera <and...@badera.us>
> >>> >> wrote:
>
> >>> >>> OK, I'll give you the UX angle. I'm a middle tier/SOA guy, I suppose I
> >>> >>> tend to underweight UX aspects.
>
> >>> >>> On Mon, May 26, 2008 at 10:23 AM, Cameron Kaiser
> >>> >>> <spec...@floodgap.com>
> >>> >>>> ckai...@floodgap.com

Chris Anthony

unread,
May 27, 2008, 9:35:32 AM5/27/08
to Twitter Development Talk
Hi Ed,

The method wants a suffix: http://twitter.com/account/rate_limit_status.xml
or .json.

It also apparently wants basic HTTP authentication, just so you
know. :)

-Chris A.

On May 26, 6:47 pm, "Ed Finkler" <funkat...@gmail.com> wrote:
> I'm getting a 404 on this via cURL.
>
> > curl -I -ku spaztest:######https://twitter.com/account/rate_limit_status

Kee Hinckley

unread,
May 27, 2008, 9:17:31 PM5/27/08
to twitter-deve...@googlegroups.com
A couple quick clarification questions.

'remaining_hits' => 30

Because it said, "remaining_hits", and you have to be authorized, I
made the assumption that it was actually a counter, but that doesn't
appear to be the case. That's really just the per-hour limit for the
current user, it doesn't reflect usage. Correct? And your limit is
reset at the top of the hour? That's fine, I just want to be sure.

Thanks,
-kee

Mark Armendariz

unread,
Jun 27, 2008, 5:30:52 AM6/27/08
to Twitter Development Talk
It seems to be counting down properly now (as of a few hours ago),
though we could really use a "reset_timestamp" value as well so we
know exactly when remaining_hits will be reset and can act accordingly.

Mark Armendariz

unread,
Jul 24, 2008, 3:42:07 PM7/24/08
to Twitter Development Talk
You know what might be helpful on the rate_limit output (which I'm a
fan of, as-is) would be a current twitter-server-time, which would
allow us to adjust according to the difference between our own server
time and twitter servers if there is one.

Rob Iles

unread,
Jul 25, 2008, 2:09:46 AM7/25/08
to twitter-deve...@googlegroups.com
Just a suggestion - perhaps Twitter could sync their servers to a public NTP server - (there are lots of them, all should return the same ACCURATE time) - then you / others could simply sync to another (or the same) NTP server - and there would be no discrepancy in the two clocks.

Rob


2008/7/24 Mark Armendariz <eno...@gmail.com>:



--


Rob Iles

RMIDevelopment

Web: http://www.rob-iles.co.uk/rmidevelopment
Twitter: http://twitter.com/Rob_Iles
Mobile: 079 6666 1092
Skype: rob_iles

[text rob followed by your message to 967482 from an orange phone in the UK *TESTING]


Alex Payne

unread,
Jul 25, 2008, 2:15:13 AM7/25/08
to twitter-deve...@googlegroups.com
We do sync our servers to NTP.

--
Alex Payne
http://twitter.com/al3x

Rob Iles

unread,
Jul 25, 2008, 2:22:22 AM7/25/08
to twitter-deve...@googlegroups.com
Then there shouldn't be a problem :-)


2008/7/25 Alex Payne <al...@twitter.com>:

Chris Meller

unread,
Jul 25, 2008, 9:13:47 AM7/25/08
to twitter-deve...@googlegroups.com
Timezones?

Cameron Kaiser

unread,
Jul 25, 2008, 9:18:04 AM7/25/08
to twitter-deve...@googlegroups.com
> > > We do sync our servers to NTP.

> > Then there shouldn't be a problem :-)

> Timezones?

That shouldn't make a difference unless the timezone offset is not a full
hour, AIUI.

--
------------------------------------ personal: http://www.cameronkaiser.com/ --
Cameron Kaiser * Floodgap Systems * www.floodgap.com * cka...@floodgap.com

-- Never underestimate the power of stupid people in large groups. ------------

Reply all
Reply to author
Forward
0 new messages