How can I get rate limit for statuses user_timeline?


#1

I’m using linq to twitter and I’m not able to get rate limit.

I want particular rate limit for statuses user_timeline.


#2

Hi,

You can get rate limits by using the Help/RateLimits query:

Here’s an example of how to use the query and read results:

var helpResult = (from help in twitterCtx.Help where help.Type == HelpType.RateLimits select help) .SingleOrDefault();
        foreach (var category in helpResult.RateLimits)
        {
            Console.WriteLine("\nCategory: {0}", category.Key);

            foreach (var limit in category.Value)
            {
                Console.WriteLine(
                    "\n  Resource: {0}\n    Remaining: {1}" +
                    "\n    Reset: {2}\n    Limit: {3}",
                    limit.Resource, limit.Remaining, 
                    limit.Reset, limit.Limit);
            }
        }