How can I be hitting Twitter API limit of 150 requests per hour?

Aug 1, 2012 at 6:36 PM

I am using Single User Authorization. See my authorization routine below.

 

        private static ITwitterAuthorizer DoSingleUserAuthorization(string consumerKey, string consumerSecret, string OAuthToken, string AccessToken)
        {
            if (string.IsNullOrWhiteSpace(consumerKey)) throw new ArgumentNullException("consumerKey");
            if (string.IsNullOrWhiteSpace(consumerSecret)) throw new ArgumentNullException("consumerSecret");
            if (string.IsNullOrWhiteSpace(OAuthToken)) throw new ArgumentNullException("OAuthToken");
            if (string.IsNullOrWhiteSpace(AccessToken)) throw new ArgumentNullException("AccessToken");

            // configure the OAuth object
            var auth = new SingleUserAuthorizer
            {
                Credentials = new InMemoryCredentials
                {
                    ConsumerKey = consumerKey,
                    ConsumerSecret = consumerSecret,
                    OAuthToken = OAuthToken,
                    AccessToken = AccessToken
                }
            };

            // Remember, do not call authorize - you don't need it for SingleUserAuthorizer.
            return auth;
        }

The OathToken and AccessToken have been generated from our Twitter account and copied into our application. It works fine to authenticate. I've been able to run and pull tweets using this before. 

However, I have noted that when I run this from my corporate location, I frequently get the following response from Twitter when I attempt to pull tweets from a list.

Response from Twitter: Rate limit exceeded. Clients may not make more than 150 requests per hour.

How can I be hitting the Twitter API limit of 150 requests per hour when I am authenticated. I thought that limit was 350 requests per hour.

When pulling batched tweets from the list, is each batch pull considered 1 request or is each tweet in the batch counted?

Any info would be appreciated. We've got a corporate Twitter account and lists that we're using to stuff our database and this is preventing us from getting any tweets.

Thanks
Dean 

Coordinator
Aug 1, 2012 at 7:11 PM

Hi Dean,

It does sound strange.  You might have done this already, but make sure you've reviewed the Twitter docs on Rate Limiting and the Rate Limit FAQ.  When you run your application, open Fiddler2 or IE F12 tools and watch the number of requests being sent, looking for anything that might provide a clue. 

For analysis or more intelligent logic, you can also view the RateLimit properties on your TwitterContext instance to see what Twitter is returning after each request.  TwitterContext also has a Headers property that holds a collection of the headers from the most recent response.

I think that type of request can affect your rate too.  i.e. complex search might affect results. You might have to look at several variables to see if you can improve the situation.

Joe